Recent

Author Topic: Screen.PrimaryMonitor on Linux, wrong one  (Read 2322 times)

mdalacu

  • Full Member
  • ***
  • Posts: 233
    • dmSimpleApps
Screen.PrimaryMonitor on Linux, wrong one
« on: January 22, 2019, 01:55:50 pm »
Hi, i try to show a Form on defined Primary Screen under Ubuntu 18.10 x64. I have a dual monitor setup with the one on the RIGHT as primary screen. The problem is that Screen.PrimaryMonitor or iterating through all the connected monitors is always the primary one in the left, the first one.
I usually turn off that monitor and my applications are always open on that one so i have to turn it on, drag the window and turn it off..:/
Any ideeas how i can correct this?
Thanks.





howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: Screen.PrimaryMonitor on Linux, wrong one
« Reply #1 on: January 22, 2019, 02:04:45 pm »
Swap your monitors so the primary screen (whose Left = 0) is physically on the left?

mdalacu

  • Full Member
  • ***
  • Posts: 233
    • dmSimpleApps
Re: Screen.PrimaryMonitor on Linux, wrong one
« Reply #2 on: January 22, 2019, 02:44:07 pm »
This could be an solution but not for me...one is 24 inch and the main one is 32 inch....
The problem is that Lazarus is not  recognize the promary screen, the one with the taskbar, under Linux...

mdalacu

  • Full Member
  • ***
  • Posts: 233
    • dmSimpleApps
Re: Screen.PrimaryMonitor on Linux, wrong one
« Reply #3 on: January 26, 2019, 06:14:18 pm »
No one have this problem?

Leledumbo

  • Hero Member
  • *****
  • Posts: 8747
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Screen.PrimaryMonitor on Linux, wrong one
« Reply #4 on: January 27, 2019, 08:52:44 pm »
No one have this problem?
Not everyone uses 2 monitors, even less the one that uses the right one as primary. I can't confirm myself the correctness, but if you can, the implementation is in $(LazarusDir)/lcl/interfaces/<your chosen interface>/<your chosen interface>winapi.inc, look for GetMonitorInfo. The code looks correct to me, as it uses respective interface API, at least for gtk2 and qt (I use the latter), but again correctness is not my expertise here.

 

TinyPortal © 2005-2018