[Linux] Impossible to move window relatively to current position with multi-monitor-setup #4003
Labels
awaiting feedback
More information is required from the requestor
Enhancement
New feature or request
Description
Imagine you have multiple monitors. With these screen-setup (for example)
If you set the application to Position 0,0:
WindowSetPosition(0,0)
the window will be set correctly to the current screen's left-top-corner. But if the current screen is (in my case) the HDMI-1 the functionWindowGetPosition()
will not return0, 0
but1920, 0
.So i am unable to move the application relatively to their current position:
This code will only work correctly if the application will spawn on primary screen (in my case eDP-1) - because the
WindowGetPosition()
then return0, 0
.To Reproduce
a. wails init -n myproject
b. change app.go a little bit:
Expected behaviour
I would expect that that code will work properly:
Screenshots
No response
Attempted Fixes
I think the problem is, that in the function
SetPosition
window.c#226 the monitor-dimension will be added.I could "correct" the position while subtracting the screens dimensions before. But with the information wails can gave me, i am not able to determine where the current screen is placed. So i could do that (for example):
But this will only work in my special monitor setup. If for example the secondary monitor (HDMI-1) is on the left side, this code will not work.
I think the "correct" solution would be, that "WindowGetPosition" will also return the position on the current screen instead of the position in combined-screen-setup. But this change could be break some applications...
Another solution could be providing some functions to get more information about screen positioning.
System Details
Additional context
No response
The text was updated successfully, but these errors were encountered: