Hint windows showing on wrong monitor
Original Reporter info from Mantis: torstenchr
-
Reporter name: Torsten Bonde Christiansen
Original Reporter info from Mantis: torstenchr
- Reporter name: Torsten Bonde Christiansen
Description:
Displaying a hint using the 'hint' string on a control or self-created hint form places the hint window on the wrong monitor on some occasions.
This does also happen within the IDE itself - eg. showing tool-top for identifiers etc.
More specifically this only happens if the hint is close enought to the 2nd monitor, but never when far from. In my case I have two monitor - primary on the left and secondary on the right.
Additional information:
A little research gave that calculation the monitor to show the hint is based on TScreen.MonitorFromPoint. Since GTk2 does not have support for MonitorFromPoint the MonitorFromRect is called with "point" and (Top,Left) and (Bottom,Right).
This leads to MonitorFromRect (falsely) calculates Rect as NOT intersecting the designated monitor and instead a distance measure is used. This distance calculation only work correctly if the actual Rect is outside scope of any monitor.
Three possible solutions may fix this:
- Use MonitorFromRec instead in ActivateHint (since a rect is already provided).
- Do not use same point as TopLeft and BottomRight, eg. add 1 to Bottom and Right.
- Do not use IntersectRect in TScreen.MonitorFromRect to find correct monitor - since it doesn't accept single points.
Additional information:
Lazarus 0.9.29 r28448M FPC 2.4.0 x86_64-linux-gtk 2
Ubuntu 10.04
Mantis conversion info:
- Mantis ID: 18040
- Version: 0.9.29 (SVN)
- Fixed in version: 0.9.29 (SVN)
- Fixed in revision: 28458 (#cad7df0f)
- Target version: 1.0.0
- LazTarget: 1.0