Skip to content

Commit 3ba02de

Browse files
authored
Fix position of the tray icon info tip when the taskbar is at the top of the screen (#711)
* Position tooltip below the taskbar when it is at the top of the screen Fixes github issue #710 Signed-off-by: Selva Nair <[email protected]> * Update CHANGES.rst Signed-off-by: Selva Nair <[email protected]> --------- Signed-off-by: Selva Nair <[email protected]>
1 parent 1a65364 commit 3ba02de

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

CHANGES.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
Version 11.51.0
2+
===============
3+
4+
* Higher resolution eye icons
5+
* Support for concatenating OTP with password
6+
* Optionally always prompt for OTP
7+
* Fix tooltip positioning when the taskbar is at top
8+
9+
Version 11.50.0
10+
===============
11+
12+
* Translation improvements (Italian)
13+
114
Version 11.49.0
215
===============
316

tray.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,8 @@ PositionTrayToolTip(LONG x, LONG y)
374374
{
375375
RECT r;
376376
LONG cxmax = GetSystemMetrics(SM_CXSCREEN);
377+
LONG cymax = GetSystemMetrics(SM_CYSCREEN);
378+
APPBARDATA abd = {.cbSize = sizeof(APPBARDATA) };
377379
GetWindowRect(traytip, &r);
378380
LONG w = r.right - r.left;
379381
LONG h = r.bottom - r.top;
@@ -383,6 +385,14 @@ PositionTrayToolTip(LONG x, LONG y)
383385
*/
384386
r.left = (x < w/2) ? 0 : ((x + w/2 < cxmax) ? x - w/2 : cxmax - w);
385387
r.top = (y > h + 10) ? y - (h + 10) : y + 10;
388+
389+
/* If taskbar is at top, move the top of the window to the bottom of the taskbar */
390+
if (SHAppBarMessage(ABM_GETTASKBARPOS, &abd)
391+
&& (abd.rc.bottom < cymax/2))
392+
{
393+
r.top = abd.rc.bottom;
394+
}
395+
386396
SendMessageW(traytip, TTM_TRACKPOSITION, 0, MAKELONG(r.left, r.top));
387397
SetWindowPos(traytip, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE);
388398
}

0 commit comments

Comments
 (0)