Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix position of the tray icon info tip when the taskbar is at the top of the screen #711

Merged
merged 2 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
Version 11.51.0
===============

* Higher resolution eye icons
* Support for concatenating OTP with password
* Optionally always prompt for OTP
* Fix tooltip positioning when the taskbar is at top

Version 11.50.0
===============

* Translation improvements (Italian)

Version 11.49.0
===============

Expand Down
10 changes: 10 additions & 0 deletions tray.c
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,8 @@ PositionTrayToolTip(LONG x, LONG y)
{
RECT r;
LONG cxmax = GetSystemMetrics(SM_CXSCREEN);
LONG cymax = GetSystemMetrics(SM_CYSCREEN);
APPBARDATA abd = {.cbSize = sizeof(APPBARDATA) };
GetWindowRect(traytip, &r);
LONG w = r.right - r.left;
LONG h = r.bottom - r.top;
Expand All @@ -383,6 +385,14 @@ PositionTrayToolTip(LONG x, LONG y)
*/
r.left = (x < w/2) ? 0 : ((x + w/2 < cxmax) ? x - w/2 : cxmax - w);
r.top = (y > h + 10) ? y - (h + 10) : y + 10;

/* If taskbar is at top, move the top of the window to the bottom of the taskbar */
if (SHAppBarMessage(ABM_GETTASKBARPOS, &abd)
&& (abd.rc.bottom < cymax/2))
{
r.top = abd.rc.bottom;
}

SendMessageW(traytip, TTM_TRACKPOSITION, 0, MAKELONG(r.left, r.top));
SetWindowPos(traytip, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE);
}
Expand Down
Loading