Recent

Author Topic: Dual monitor issue  (Read 680 times)

petevick

  • Sr. Member
  • ****
  • Posts: 419
Dual monitor issue
« on: July 14, 2024, 01:38:37 pm »
I'm trying to get the height of the taskbar on a second monitor, initially I thought I had it worked out, until I moved the 2nd monitor from being tops level to bottoms level. With tops level i was using....

Code: Pascal  [Select][+][-]
  1.         Trec:= Screen.Monitors[n].WorkareaRect;
  2.         TskBarHt:= Monitor.Height - Trec.Height;
  3.  
...where n = the 2nd monitor, this resulted in the correct taskbar height, but with the monitor bottoms level TskBarHt returns zero as Screen.Monitors[n].WorkareaRect returns values that do not account for the taskbar height.
Is this the expected behaviour ?? if so I can't see any viable way to reliably calculate the actual available work area height, and ultimately the task bar height, for a 2nd monitor whose top is more the zero.
Pete Vickerstaff
Linux Mint 21.2 Cinnamon, Windows 10, Lazarus 3.2, FPC 3.2.2

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 10553
  • Debugger - SynEdit - and more
    • wiki
Re: Dual monitor issue
« Reply #1 on: July 14, 2024, 03:21:57 pm »
I would think there is a bug...

Btw, I am not sure it is the position of the taskbar.

I get the reduced workarea for all my monitors. EXCEPT the main monitor. (Win-10).
- I tried top/bottom for my main monitor, and one of my 2ndary monitors.
- I did not try to redefine, which monitor is my main monitor.

It could also be, because the coordinates of the other monitors exceed the bounds of my main monitor. I.e., the main monitors top is zero, but there is a monitor with a negative top coordinate. And the main monitors bottom is 1440, but there is another monitor with a further down bottom.
Though 2 of my 2ndary monitor account for the taskbar at the bottom, despite one has a lower bottom than the other....



petevick

  • Sr. Member
  • ****
  • Posts: 419
Re: Dual monitor issue
« Reply #2 on: July 15, 2024, 10:31:03 am »
I would think there is a bug...

Btw, I am not sure it is the position of the taskbar.

I wasn't moving the taskbar, I was moving the 2nd monitor in relationship to the my primary monitor in Display settings. With tops level the taskbar height is calculated correctly, with monitor bottoms level, the rectangle data holds no values for work area.

And I agree, it certainly looks like a bug.
Pete Vickerstaff
Linux Mint 21.2 Cinnamon, Windows 10, Lazarus 3.2, FPC 3.2.2

 

TinyPortal © 2005-2018