View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0018040||Lazarus||LCL||public||2010-11-24 14:56||2010-11-25 08:42|
|Reporter||Torsten Bonde Christiansen||Assigned To||Paul Ishenin|
|Product Version||0.9.29 (SVN)|
|Target Version||1.0.0||Fixed in Version||0.9.29 (SVN)|
|Summary||0018040: Hint windows showing on wrong monitor|
|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:
1) Use MonitorFromRec instead in ActivateHint (since a rect is already provided).
2) Do not use same point as TopLeft and BottomRight, eg. add 1 to Bottom and Right.
2) Do not use IntersectRect in TScreen.MonitorFromRect to find correct monitor - since it doesn't accept single points.
Lazarus 0.9.29 r28448M FPC 2.4.0 x86_64-linux-gtk 2
|Tags||No tags attached.|
|Fixed in Revision||28458|
||Fun :) Just fixed with the second solution and found your report. Please test and close if ok.|
hehe... nice job. Although may I ask why you chose the second solution? I thought it more natural to use the first solution as a rect is already provided, to which I understand is the user/programmers choice of where the rect should be (and hence also it's height and width).
Will close bug-report tomorrow - curious for an answer ;)
|2010-11-24 14:56||Torsten Bonde Christiansen||New Issue|
|2010-11-24 14:56||Torsten Bonde Christiansen||Widgetset||=> GTK 2|
|2010-11-24 15:43||Vincent Snijders||LazTarget||=> 1.0|
|2010-11-24 15:43||Vincent Snijders||Status||new => acknowledged|
|2010-11-24 15:43||Vincent Snijders||Target Version||=> 1.0.0|
|2010-11-24 15:51||Paul Ishenin||Fixed in Revision||=> 28458|
|2010-11-24 15:51||Paul Ishenin||Status||acknowledged => resolved|
|2010-11-24 15:51||Paul Ishenin||Fixed in Version||=> 0.9.29 (SVN)|
|2010-11-24 15:51||Paul Ishenin||Resolution||open => fixed|
|2010-11-24 15:51||Paul Ishenin||Assigned To||=> Paul Ishenin|
|2010-11-24 15:51||Paul Ishenin||Note Added: 0043477|
|2010-11-24 20:22||Torsten Bonde Christiansen||Note Added: 0043489|
|2010-11-25 08:42||Torsten Bonde Christiansen||Status||resolved => closed|