Recent

Author Topic: Hint windows misplaced and mis-scaled in multi-monitor layout  (Read 1378 times)

DimTim

  • New Member
  • *
  • Posts: 44
Tried to post the bug to the bugtracker, but nobody noticed it. 😅

My OS is Windows 10.  My Lazarus IDE is laid out on two monitors: the main (4K, scaled at 200%) and the secondary (UHD, scaled at 150%).  Layout is docked.  On the main monitor is placed the main form with menu, coolbar and code editor.  On the second - Messages, Components, Object Inspector and different debug tools, tabbed.

And, when the secondary form is VISIBLE - active or not, - all the hints on the MAIN form are heavily misplaced (often out of the screen limits) and scaled by the secondary monitor's value.  And Coolbar's pulldown menus not visible at all - possibly also misplaced out of screen limits.  If I minimize the second form, all works OK.

I tried debugging Lazarus sources in another copy of IDE.  All methods in ..\Lazarus\lazarus\lcl\include\hintwindow.inc show correct monitor and hint window coordinates!  And I couldn't pinpoint actual method/procedure that paints the hint at the wrong location.  Maybe it "lives" in another thread?

UPD: I tried different versions of Lazarus: Trunk, 2.2.0.
« Last Edit: July 08, 2025, 08:56:54 am by DimTim »

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12518
  • Debugger - SynEdit - and more
    • wiki
Re: Hint windows misplaced and mis-scaled in multi-monitor layout
« Reply #1 on: July 08, 2025, 09:27:50 am »
I recall that this has been discussed before, but I couldn't find where...

I know it happens, but from what I could tell in the past, it only happens if
- the focused form was on one monitor
- the hint or dropdown was for a form on a different monitor.

Your description (if I read correct) said that the focus was on the same monitor on which you did the hint.
(and the dropdown requires focus on the same).

Then again, all my prior experience is without anchor docking. So possible that anchordocking makes it worse.

--------------------

I don't know the underlying details of how the scaling exactly works. From what I recall the info I got was that there are different modes, an app can do this for the entire app, or each window.

Afaik Lazarus scale the entire app. (But I am not sure / this may be wrong). Which means Lazarus only takes one DPI setting as input. The rest is scaled by the OS.

As for the OS (Windows) scaling this. I have myself experienced that Windows gets it wrong (on its own windows). E.g. I have 2 diff scaled monitors, and the "file copy progress" window of the Windows file explorer is drawn with incorrect scaling and errors on one of those monitors (if the explorer that started it is on the other).

--------------------

As for the bug report, it can happen that some reports take longer.  There isn't a "rule" who picks up what or in which order.

DimTim

  • New Member
  • *
  • Posts: 44
Re: Hint windows misplaced and mis-scaled in multi-monitor layout
« Reply #2 on: July 08, 2025, 11:08:12 am »
Yes, all the mess happens on the main form/monitor.  But only when the second form on the second monitor is visible.  If I minimize it, or move to the main monitor, the bug doesn't manifest.

Concerning Windows scaling - it seems that it is mainly done correct.  When I move forms between monitors (incl. Lazarus forms), they change scaling to the target factor.  Yes, some older programs may behave unstable, when performing scaling on their own.

n7800

  • Hero Member
  • *****
  • Posts: 729
  • Lazarus IDE contributor
    • GitLab profile
Re: Hint windows misplaced and mis-scaled in multi-monitor layout
« Reply #3 on: July 09, 2025, 09:59:53 pm »
Tried to post the bug to the bugtracker, but nobody noticed it. 😅

Next time, be sure to add a link to it: https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/41741

Otherwise, the discussion gets split and someone might waste time asking questions/doing work that has already been done in another thread/report.

 

TinyPortal © 2005-2018