SDL icon indicating copy to clipboard operation
SDL copied to clipboard

SDL_SetWindowPosition() does not work on Linux/X11

Open c-smile opened this issue 1 year ago • 4 comments

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.

c-smile avatar May 09 '24 18:05 c-smile

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

Kontrabant avatar May 09 '24 19:05 Kontrabant

@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.

c-smile avatar May 11 '24 00:05 c-smile

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.

Kontrabant avatar May 11 '24 15:05 Kontrabant

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?

sechshelme avatar May 15 '24 07:05 sechshelme