Skip to content

Commit 0cdf856

Browse files
committed
dll: Fix resizing problem on Win10TH2 or earlier
Use the old method for earlier Windows.
1 parent 9c8c6ca commit 0cdf856

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

source/dll/draw.c

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -255,24 +255,25 @@ LRESULT CalcRect(HWND hwnd, int *textwidth, int *textheight)
255255

256256
if(g_bFitClock)
257257
{
258-
//RECT rcTray;
259-
RECT rcTaskbar;
258+
RECT rcTray;
259+
int h = g_OrigClockHeight, w = g_OrigClockWidth;
260260

261-
//GetWindowRect(GetParent(hwnd), &rcTray);
262-
GetClientRect(GetParent(GetParent(hwnd)), &rcTaskbar);
261+
if(!(g_winver&WIN10RS1))
262+
{
263+
GetWindowRect(GetParent(hwnd), &rcTray);
264+
h = rcTray.bottom - rcTray.top;
265+
w = rcTray.right - rcTray.left;
266+
}
263267

264268
// horizontal task bar
265-
if(rcTaskbar.right - rcTaskbar.left >
266-
rcTaskbar.bottom - rcTaskbar.top)
269+
if(!IsVertTaskbar(GetParent(GetParent(hwnd))))
267270
{
268-
//hclock = rcTray.bottom - rcTray.top;
269-
hclock = g_OrigClockHeight;
271+
hclock = h;
270272
}
271273
// vertical task bar
272274
else
273275
{
274-
//wclock = rcTray.right - rcTray.left;
275-
wclock = g_OrigClockWidth;
276+
wclock = w;
276277
}
277278
}
278279

0 commit comments

Comments
 (0)