x11 video driver and saving window position |
Dominus
|
I noticed similar with Exult. Cycling through scaler factors the window would gradually move lower and lower.
|
|||||||||||
|
fau
|
Apparently this behaviour is specific to x11 video driver. What it does it that window manager adds decorations at some point after window creation and afaik there is no SDL event to tell when. When borders are added window gets shifted by their offsets and any further coordinates used eg by SDL_GetWindowPosition or SDL_SetWindowPosition are relative to parent window including decorations.
SDL_GetWindowBordersSize came to rescue. It's not perfect but I subtract border offsets when saving window position (so these coordinates can be used directly in SDL_CreateWindow). I still think it would be better for SDL API to use window coordinates relative to borderless window, but maybe there are other considerations I don't know about. If I can discuss it with some x11 driver devs and they think the same, I would be willing to commit such changes. |
|||||||||||
|