Why the app freezed at SDL_HideWindow while calling SDL_DetroyWindow or SDL_CreateRenderer with SDL_RENDERER_ACCERLATED?

Dear all, please help.

I met two confusing situations while using SDL2.0 in Qt5.1.0 to build a
media player under vmware virtual machine (ubuntu12.04 on x86 32 laptop).

  1. SDL_CreateRenderer(pt_sdl_window, -1, SDL_RENDERER_ACCELERATED) hangs on
    infinitely.

pt_sdl_window points to a SDL window created by SDL_CreateWindowFrom from a
QWidget placed on QMainWindow.

I built a debug version of SDL2.0 to check out why the application stopped,
then came across that it’s the code inside function X11_HideWindow blocked,
the code is as below(SDL_x11window.c):

if (X11_IsWindowMapped(_this, window)) {
    XUnmapWindow(display, data->xwindow);
    /* Blocking wait for "UnmapNotify" event */
    XIfEvent(display, &event, &isUnmapNotify, (XPointer)&data->xwindow);
    XFlush(display);
}

It’s very obviously after calling the XUnmapWindow, no UnmapNotify event
received, so that the code infinitely blocked…

Further, I found the documentation of XUnmapWindow as below:

The XUnmapWindow() function unmaps the specified window and causes the X
server to generate an UnmapNotify event. If the specified window is already
unmapped, XUnmapWindow() has no effect. Normal exposure processing on
formerly obscured windows is performed. Any child window will no longer be
visible until another map call is made on the parent. In other words, the
subwindows are still mapped but are not visible until the parent is mapped.
Unmapping a window will generate Expose events on windows that were formerly
obscured by it.

The apparent reason would be that the X server wasn’t generate any
UnmapNotify event at all after calling XUnmapWindow.

  1. SDL_DetroyWindow(pt_sdl_window) hangs on.

The reason was absolutely the same as the above one. They hanged on at the
same place.

Why does this happen? Any suggestions on that?

Thanks a million! By the way, the SDL2.0 documentation is so …you know.

Could you please test this patch, and see if it helps?

http://bugzilla.libsdl.org/show_bug.cgi?id=1526On Wed, 10 Jul 2013 20:30:25 +0800 ??? Joy Woo wrote:

Dear all, please help.

I met two confusing situations while using SDL2.0 in Qt5.1.0 to build
a media player under vmware virtual machine (ubuntu12.04 on x86 32
laptop).

  1. SDL_CreateRenderer(pt_sdl_window, -1, SDL_RENDERER_ACCELERATED)
    hangs on infinitely.

pt_sdl_window points to a SDL window created by SDL_CreateWindowFrom
from a QWidget placed on QMainWindow.

I built a debug version of SDL2.0 to check out why the application
stopped, then came across that it’s the code inside function
X11_HideWindow blocked, the code is as below(SDL_x11window.c):

if (X11_IsWindowMapped(_this, window)) {
    XUnmapWindow(display, data->xwindow);
    /* Blocking wait for "UnmapNotify" event */
    XIfEvent(display, &event, &isUnmapNotify,

(XPointer)&data->xwindow); XFlush(display);
}

It’s very obviously after calling the XUnmapWindow, no UnmapNotify
event received, so that the code infinitely blocked…

Further, I found the documentation of XUnmapWindow as below:

The XUnmapWindow() function unmaps the specified window and causes
the X server to generate an UnmapNotify event. If the specified
window is already unmapped, XUnmapWindow() has no effect. Normal
exposure processing on formerly obscured windows is performed. Any
child window will no longer be visible until another map call is made
on the parent. In other words, the subwindows are still mapped but
are not visible until the parent is mapped. Unmapping a window will
generate Expose events on windows that were formerly obscured by it.

The apparent reason would be that the X server wasn’t generate any
UnmapNotify event at all after calling XUnmapWindow.

  1. SDL_DetroyWindow(pt_sdl_window) hangs on.

The reason was absolutely the same as the above one. They hanged on
at the same place.

Why does this happen? Any suggestions on that?

Thanks a million! By the way, the SDL2.0 documentation is so …you
know.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


driedfruit