Windows: Window location on startup / Primary Screen

82 views
Skip to first unread message

expeehaa

unread,
Jul 30, 2017, 10:28:51 AM7/30/17
to XWT Widget Toolkit
Hi.
I've just started to use Xwt and I really like the API.
Yet I have not tried the program on ubuntu or macos, but first i have a problem on Windows
When I first started my Application, the window appeared on the left screen.
Would be totally normal if my screen setup would have marked the left screen as primary.
But that isn't the case. I have a setup of 3 screens, the one in the middle is marked as primary.
When I try to get the primary screen with Desktop.PrimaryScreen I instead get the left screen.

I probably could take a look into the Windows settings with an API, but that would eliminate the system-independent programming goal, as far as I know.
Has anyone had this problem or knows how to solve it?
Thanks in advance.

expeehaa

unread,
Jul 30, 2017, 6:29:43 PM7/30/17
to XWT Widget Toolkit
Ok, I have solved it on my own. Desktop provides a Screens property, where my real primary screen is listed first. However the last Screen in this list is marked as Primary, which is wrong. Using the first Screen's bounds I was able to move the window to the middle of the screen easily.
Reply all
Reply to author
Forward
0 new messages