362d549690
Alvin I'm interested in this bug as well. I have experienced it when trying to embed an SDL_Window into a FLTK application. To do this, I create a FLTK window (window inside a window - think video player) and then use SDL_CreateWindowFrom() on the inner most window's Xlib Window*. After which, I create a renderer. In my situation I am using the FLTK GUI toolkit. What I have experienced is that the SDL_CreateRender() will recreate the window in order to properly setup OpenGL capability. As part of this process, the window is hidden and a call is executed that waits indefinitely for an acknowledgement that the window was indeed unmapped. This is where my program hangs. Please correct me if I am wrong, but should SDL2 not make Xlib calls that effect the Xlib Window in this situation (e.g. When SDL_CreateWindowFrom() is used)? The toolkit being used typically assumes responsibility and, I presume, tracks all Xlib Windows it creates. On line src/video/SDL_video.c:1372 the comment associated with setting SDL_WINDOW_FOREIGN reads: /* Can't destroy and re-create foreign windows, hrm */ Since I do not know the reason for hiding the window in the first place, the attached patch simply does not wait for a response when X11_XWithdrawWindow() and X11_XMapRaised() are issued by X11_HideWindow() and X11_ShowWindow(), respectively. I presume that the GUI toolkit (GTK, FLTK, etc.) has or will consume the acknowledging event as it is managing the Xlib Window (or it thinks it is). I have tested the patch against hg 5c645d037de2 and I have successfully tested: * Embedding the SDL_Window inside a FLTK application. * Calling SDL_SetWindowSize() when FLTK resizes the window (e.g. dragging cursor on the edge of the window). * Filling the renderer's default target blue and drawing a red fill square at the centre (exciting, I know!) * Calling SDL_Quit() when the application terminates I do not receive any Xlib erorr messages (BadWindow, etc.) in any of those situations. |
||
---|---|---|
VisualC | ||
VisualC-WinRT | ||
Xcode | ||
Xcode-iOS | ||
acinclude | ||
android-project | ||
build-scripts | ||
cmake | ||
debian | ||
docs | ||
include | ||
src | ||
test | ||
visualtest | ||
.hgignore | ||
Android.mk | ||
BUGS.txt | ||
CMakeLists.txt | ||
COPYING.txt | ||
CREDITS.txt | ||
INSTALL.txt | ||
Makefile.in | ||
Makefile.minimal | ||
Makefile.pandora | ||
Makefile.psp | ||
Makefile.wiz | ||
README-SDL.txt | ||
README.txt | ||
SDL2.spec.in | ||
SDL2Config.cmake | ||
TODO.txt | ||
VisualC.html | ||
WhatsNew.txt | ||
autogen.sh | ||
cmake_uninstall.cmake.in | ||
configure | ||
configure.in | ||
sdl2-config.cmake.in | ||
sdl2-config.in | ||
sdl2.m4 | ||
sdl2.pc.in |
README.txt
Simple DirectMedia Layer (SDL) Version 2.0 --- https://www.libsdl.org/ Simple DirectMedia Layer is a cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL and Direct3D. It is used by video playback software, emulators, and popular games including Valve's award winning catalog and many Humble Bundle games. More extensive documentation is available in the docs directory, starting with README.md Enjoy! Sam Lantinga (slouken@libsdl.org)