Skip to content

Commit

Permalink
dll: Fix resizing problem on Win10TH2 or earlier
Browse files Browse the repository at this point in the history
Use the old method for earlier Windows.
  • Loading branch information
k-takata committed Sep 3, 2016
1 parent 9c8c6ca commit 0cdf856
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions source/dll/draw.c
Original file line number Diff line number Diff line change
Expand Up @@ -255,24 +255,25 @@ LRESULT CalcRect(HWND hwnd, int *textwidth, int *textheight)

if(g_bFitClock)
{
//RECT rcTray;
RECT rcTaskbar;
RECT rcTray;
int h = g_OrigClockHeight, w = g_OrigClockWidth;

//GetWindowRect(GetParent(hwnd), &rcTray);
GetClientRect(GetParent(GetParent(hwnd)), &rcTaskbar);
if(!(g_winver&WIN10RS1))
{
GetWindowRect(GetParent(hwnd), &rcTray);
h = rcTray.bottom - rcTray.top;
w = rcTray.right - rcTray.left;
}

// horizontal task bar
if(rcTaskbar.right - rcTaskbar.left >
rcTaskbar.bottom - rcTaskbar.top)
if(!IsVertTaskbar(GetParent(GetParent(hwnd))))
{
//hclock = rcTray.bottom - rcTray.top;
hclock = g_OrigClockHeight;
hclock = h;
}
// vertical task bar
else
{
//wclock = rcTray.right - rcTray.left;
wclock = g_OrigClockWidth;
wclock = w;
}
}

Expand Down

0 comments on commit 0cdf856

Please sign in to comment.