Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gfx_sdl2/KDE: some window resizes lost, so doesn't draw over whole window & wrong mouse position #1190

Closed
rversteegen opened this issue Jan 19, 2021 · 1 comment
Labels
bug Yeah... that's broken controls Keyboard, mouse and joystick/gamepad input/controls gfx_sdl2 Specific to the SDL 2 graphics/IO backend os: unix Specific to Linux/BSD/etc. Possibly also Mac and Android.

Comments

@rversteegen
Copy link
Contributor

On Linux/KDE/X11 I've noticed that sometimes when I resize the window by dragging the corner gfx_sdl2 doesn't seem to tell the engine about the final window resize event (as if there's some lag while dragging and the last part of the drag gets lost), so it continues to draw a frame of the old size, which is somewhat off. This can result in black bars at the right and bottom of the window, and the mouse position gets miscalculated in get_image_origin_and_ratio. I haven't seen this happen on Windows.

@rversteegen rversteegen added bug Yeah... that's broken os: unix Specific to Linux/BSD/etc. Possibly also Mac and Android. controls Keyboard, mouse and joystick/gamepad input/controls gfx_sdl2 Specific to the SDL 2 graphics/IO backend labels Jan 19, 2021
@rversteegen rversteegen changed the title Linux gfx_sdl2: some window resizes lost, so doesn't draw over whole window & wrong mouse position gfx_sdl2/KDE: some window resizes lost, so doesn't draw over whole window & wrong mouse position Sep 25, 2021
@rversteegen
Copy link
Contributor Author

This doesn't happen under xfce4. I was running KDE 4 at the time, but my distro has since upgraded to KDE 5, and it's still happening on that, including under latest SDL git.

Through trial and error, after comparing with a simple test program that didn't suffer this problem, I figured out that the problem is calling SDL_SetWindowSize while the user is resizing the window. I'm fixed this by skipping the SDL_SetWindowSize in that case.

This bug sounds like the same thing as another bug I noticed in gfx_sdl/sdl2 (under at least xfce4), where if the user is resizing the window (or at least has the mouse button held down on the window frame) at the moment the engine tries to resize the window (e.g. on starting a game) then it doesn't resize properly. But that doesn't happen if the window isn't resizable either before or after the forced-resize, so it's very minor and I'll ignore it.

bob-the-hamster pushed a commit that referenced this issue Sep 25, 2021
…r whole window & wrong mouse position

git-svn-id: https://rpg.hamsterrepublic.com/source/wip@12483 7d344553-34f0-0310-a9b1-970ce8f1c3a2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Yeah... that's broken controls Keyboard, mouse and joystick/gamepad input/controls gfx_sdl2 Specific to the SDL 2 graphics/IO backend os: unix Specific to Linux/BSD/etc. Possibly also Mac and Android.
Projects
None yet
Development

No branches or pull requests

1 participant