libsdl-org / SDL

Simple Directmedia Layer
https://libsdl.org
zlib License
8.79k stars 1.66k forks source link

SDL_SetWindowPosition() does not work on Linux/X11 #9740

Open c-smile opened 2 months ago

c-smile commented 2 months ago

SDL3

If window position is set at creation time by SDL_SetNumberProperty(SDL_PROP_WINDOW_CREATE_X_NUMBER, 10) then SDL_SetWindowPosition() does not work on Linux/X11. At all.

Note that is with X11 backend where window positioning is supposed to work.

Kontrabant commented 2 months ago

What desktop are you using? I'm not seeing this on GNOME or KDE.

c-smile commented 2 months ago

@Kontrabant : Linux Mint 21.3, GNOME/X11, high-dpi monitor if that matters.

I was trying to debug the issue here but I am lost in too many locations of window coordinates: window.x/y windowdata.floating.x/y, windowdata.expected.x/y and couple of more.

I have impression that this is somehow related to mapped status of the window.

Kontrabant commented 2 months ago

Would you have a small reproduction sample that shows the issue? I've set up Mint 21.3 in a VM and I still can't replicate this. Running testsprite and changing the window position programmatically with shift+arrow keys works on both GNOME and the Cinnamon desktop, and I've also tried a sample program that creates the window in the hidden state, changes the position, then shows it, and it correctly appears at the last requested coordinates.

sechshelme commented 2 months ago

I had about a month ago SDL_SetWindowPosition(win, 200, 200); Tried directly after SDL_CreateWindow(...), it didn't work. Now I tried it again and it worked right away. I also use Linux Mint with Connamon.

Does the issue creator perhaps have an outdated SDL 3?