| Summary: | No SDL_VIDEORESIZE event generated when the window manager sets the window size. | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Niriel <daneel_libre> |
| Component: | video | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | andreas.eriksson, icculus, lekensteyn, slh352, stsp2 |
| Version: | HG 2.0 | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Attachments: |
[sdl-2.0] Do not drop events queue
[sdl-1.2.15] Do not drop events queue [sdl-2.0.3] Do not drop events queue |
||
|
Description
Niriel
2013-05-21 08:35:05 UTC
Confirmed with two other WMs: - Openbox: set <maximized>True</maximized> in rc.xml to make a QEMU window full-screen. - KWin: set a window rule to maximize the window by default. Sometimes, the SDL_VIDEORESIZE event is generated and the window contents gets scaled correctly. At other times, there is no SDL_VIDEORESIZE event. I identified that the X ConfigureNotify event is somehow dropped as can seen in log14 [1]. (for comparison, log13 is correct). After some debugging, I can finally conclude that this issue happens because of the use of XSync(SDL_Display, True) in src/video/x11/SDL_x11modes.c (src/video/x11/SDL_x11framebuffer.c in tip). Changing that True to False causes a lot more events to be initially launched, but at least events are not dropped which result in more predictable behavior. Could this code be copied from x11vnc[2]? [1]: http://lekensteyn.nl/files/qemu-sdl-debug/ [2]: http://cgit.freedesktop.org/xorg/app/x11perf/tree/do_blt.c#n421 Created attachment 1188 [details] [sdl-2.0] Do not drop events queue It seems very likely that this SDL code is based on x11perf's code. After some talk on #xorg-devel and reading about the MIT-SHM extension[1], it becomes apparent that the "True" parameter to XSync is not justified. - The XSync manual page warns against it use. - x11perf does not care about events, but SDL does. Events should not be dropped, it causes bugs like this one. Furthermore, the dropped events are non-deterministic. - A possible event from MIT-SHM is Completion, but that is only sent when a certain parameter to XShmPutImage is True which is not the case. After this patch, events are not dropped anymore. Programs behave more predictable. [1]: http://www.x.org/releases/current/doc/xextproto/shm.html Created attachment 1189 [details]
[sdl-1.2.15] Do not drop events queue
Created attachment 1715 [details]
[sdl-2.0.3] Do not drop events queue
This bug still exists in 2.0.3. I tried the above patch and it fixed the problem for me. It didn't apply cleanly anymore so I'm attaching a modified version that does.
Hello, and sorry if you're getting several copies of this message by email, since we are closing many bugs at once here. We have decided to mark all SDL 1.2-related bugs as RESOLVED ENDOFLIFE, as we don't intend to work on SDL 1.2 any further, but didn't want to mark a large quantity of bugs as RESOLVED WONTFIX, to clearly show what was left unattended to and make it easily searchable. Our current focus is on SDL 2.0. If you are still having problems with an ENDOFLIFE bug, your absolute best option is to move your program to SDL2, as it will likely fix the problem by default, and give you access to modern platforms and tons of super-cool new features. Failing that, we _will_ accept small patches to fix these issues, and put them in revision control, although we do not intend to do any further official 1.2 releases. Failing that, please feel free to contact me directly by email (icculus@icculus.org) and we'll try to find some way to help you out of your situation. Thank you, --ryan. I haven't looked at this yet, but apparently this still affects SDL2, so I've reopened the bug. --ryan. (In reply to Ryan C. Gordon from comment #6) > I haven't looked at this yet, but apparently this still affects SDL2, so > I've reopened the bug. > > --ryan. Just confirming that the patch from Andreas (attachment 1715 [details]) works for me under SDL 2.0.3 with xmonad. /me too Confirming that the patch in this ticket fixes the full-screen switching for dosemu2 on ubuntu-16.04. Note that I am not using xmonad, so this bug appears to be generic. I wish someone to take care of that patch, as it is already 3 years old and it seems vital for full-screen to work reliably. Patched applied, thanks! https://hg.libsdl.org/SDL/rev/f931db466859 https://hg.libsdl.org/SDL/rev/f318f6a4882f |