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

Flickering/blinking openvpn-gui sys tray icon tooltip on mouseover if taskbar is on top of the screen #710

Open
TotoCon opened this issue Nov 16, 2024 · 5 comments

Comments

@TotoCon
Copy link

TotoCon commented Nov 16, 2024

For some reason i cannot post on the forums, so i'll try here:

I have the taskbar on top of the windows desktop.
When i move my mouse on the gui sys tray icon, the tooltip flickers/blinks.
I think the mouseover event tries to place the tooltip above the icon but fails to do so.
This does not happens if the taskbar is left/right or at the bottom of the screen.

@selvanair
Copy link
Collaborator

I can reproduce this but not consistently. With taskbar at the top, for some mouse positions the flicker is present not for some other. I think its caused by the popup overlapping with mouse which leads the system to send repeated NIM_ POPUPCLOSE and OPEN messages.

Since commit 0c9ae87 we use a custom window for tray tooltip instead of NIF_TIP as the latter has a limited in text length. But that makes it necessary to carefully position this window depending on the trackbar location and size. If anyone has ideas on how to do this better than in the above commit, please share. Note that we can only use win32 API.

@TotoCon
Copy link
Author

TotoCon commented Nov 16, 2024

Just want to add, that all other tooltips are placed directly attached to the taskbar.
If the taskbar is on top, the tooltips are placed derictly below it.
If placed on the right, tooltips are shown attached left to the taskbar.
If on the left, tooltips are shown attached right to the taskbar.
And if the taskbar is at the bottom, the tips are shown attached directly above the taskbar.

@selvanair
Copy link
Collaborator

Just want to add, that all other tooltips are placed directly attached to the taskbar. If the taskbar is on top, the tooltips are placed derictly below it. If placed on the right, tooltips are shown attached left to the taskbar. If on the left, tooltips are shown attached right to the taskbar. And if the taskbar is at the bottom, the tips are shown attached directly above the taskbar.

I have noticed this behaviour of built-in tray icons except when the taskbar is on the bottom. For that case only, the positioning appears right above the mouse and not in line with the taskbar boundary. Not very consistent. In any case, I have not found a win32 API call that will do this automatically so that we can inherit the behaviour of system icons. When we used to use NIF_TIP, positioning was automatic, but then our text often gets truncated which is the reason for using a custom window.

Also, for left and right positions, our current style looks better especially when the taskbar gets wider. And for bottom, we position the tip well above the taskbar which looks good too.

I'll consider shifting it down for the top case.

selvanair added a commit to selvanair/openvpn-gui that referenced this issue Nov 17, 2024
@selvanair
Copy link
Collaborator

@TotoCon Could you check whether this one fixes it? The position is adjusted only when the taskbar is at top. 209725d

May be tested using exe from the CI artifact here: https://github.com/selvanair/openvpn-gui/actions/runs/11874383419#artifacts

Just extract to a temp folder and run the exe after stopping the currently running GUI.

@TotoCon
Copy link
Author

TotoCon commented Nov 17, 2024

@selvanair I can confirm that the tooltip works as it should if running the file you provided. No more flicker if taskbar on top.

selvanair added a commit that referenced this issue Nov 18, 2024
… 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants