Tooltips are off-screen in hidpi when source window is contained in a strut (panel)
Steps to reproduce
(This is with the X11 backend)
- With a hidpi display/laptop, set to 2x scale factor
- Compile attached test-panel.c:
gcc -o test-panel -g -O0 test-panel.c `pkg-config --libs --cflags gtk+-3.0`
- Hover over icon, observe that no tooltip appears.
Current behavior
No tooltip
Expected outcome
Tooltip appears above panel (in y).
Version information
- Verison 3.24.18
- Mint/Ubuntu, Mate, Cinnamon
Additional information
I had traced things down to gdkwindowimpl.c, maybe_flip_position() failing to catch the tooltip window and flip it - it misses by only a few px in the secondary check, then falls thru to the end of the function. In the sample program, you can uncomment the gtk_set_valign, and this will cause the tooltip to be positioned correctly if there is enough size difference between the image widget and the panel.
As I said, this is only a few pixels miss on the flip calculations. But it seems as though there could be one final (simple) sanity check before returning - is the tooltip rect contained by the workarea? Obviously more math should be avoided, so maybe someone with a bit more familiarity with this positioning code (and the various cases it needs to handle) could resolve by modifying the existing calculations.
Thanks.