We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
These attachments are available in the static archive:
Reported in version: 2.0.12 Reported for operating system, platform: Linux, x86_64
On 2020-10-10 14:32:46 +0000, Alberts Muktupāvels wrote:
https://github.com/SDL-mirror/SDL/blob/master/src/video/x11/SDL_x11events.c#L949-L956 SDL receiving UnmapNotify event assumes that window has been iconified. This assumption seems wrong... For example UnmapNotify event is also sent when window is reparented, see https://tronche.com/gui/x/xlib/window-and-session-manager/XReparentWindow.html. This causes problems when using SDL applications with Metacity 3.36+. Metacity now removes decorations when windows are fullscreen. Perhaps SDL could check if next event is ReparentNotify and not dispatch UnmapNotify in that case? Something like this: XEvent ev; if (X11_XCheckIfEvent(display, &ev, &isReparentNotify, (XPointer)&xevent.xunmap)) X11_XCheckIfEvent(display, &ev, &isMapNotify, (XPointer)&xevent.xunmap); else X11_DispatchUnmapNotify(data); static Bool isMapNotify(Display *dpy, XEvent *ev, XPointer unmap) { XUnmapEvent *event; event = (XUnmapEvent*) unmap; return ev->type == MapNotify && ev->xmap.window == event->window && ev->xmap.serial == event->serial; } static Bool isReparentNotify(Display *dpy, XEvent *ev, XPointer unmap) { XUnmapEvent *event; event = (XUnmapEvent*) unmap; return ev->type == ReparentNotify && ev->xreparent.window == event->window && ev->xreparent.serial == event->serial; }
https://github.com/SDL-mirror/SDL/blob/master/src/video/x11/SDL_x11events.c#L949-L956
SDL receiving UnmapNotify event assumes that window has been iconified. This assumption seems wrong... For example UnmapNotify event is also sent when window is reparented, see https://tronche.com/gui/x/xlib/window-and-session-manager/XReparentWindow.html.
This causes problems when using SDL applications with Metacity 3.36+. Metacity now removes decorations when windows are fullscreen.
Perhaps SDL could check if next event is ReparentNotify and not dispatch UnmapNotify in that case? Something like this:
XEvent ev; if (X11_XCheckIfEvent(display, &ev, &isReparentNotify, (XPointer)&xevent.xunmap)) X11_XCheckIfEvent(display, &ev, &isMapNotify, (XPointer)&xevent.xunmap); else X11_DispatchUnmapNotify(data);
static Bool isMapNotify(Display *dpy, XEvent *ev, XPointer unmap) { XUnmapEvent *event;
event = (XUnmapEvent*) unmap; return ev->type == MapNotify && ev->xmap.window == event->window && ev->xmap.serial == event->serial;
}
static Bool isReparentNotify(Display *dpy, XEvent *ev, XPointer unmap) { XUnmapEvent *event;
event = (XUnmapEvent*) unmap; return ev->type == ReparentNotify && ev->xreparent.window == event->window && ev->xreparent.serial == event->serial;
On 2020-10-12 16:27:58 +0000, Sam Lantinga wrote:
That seems reasonable, can you provide a tested and working patch? Can you also make sure that iconification is still detected correctly?
On 2020-10-17 20:11:44 +0000, Alberts Muktupāvels wrote:
Created attachment 4480 x11events: ignore UnmapNotify events from XReparentWindow
On 2020-10-17 20:16:32 +0000, Alberts Muktupāvels wrote:
(In reply to Sam Lantinga from comment # 1) That seems reasonable, can you provide a tested and working patch? Can you also make sure that iconification is still detected correctly? Patch attached. Iconification seems to work as expected.
(In reply to Sam Lantinga from comment # 1)
Patch attached. Iconification seems to work as expected.
On 2020-10-20 00:27:20 +0000, Sam Lantinga wrote:
Patch added, thanks! https://hg.libsdl.org/SDL/rev/204628027601
The text was updated successfully, but these errors were encountered:
No branches or pull requests
This bug report was migrated from our old Bugzilla tracker.
These attachments are available in the static archive:
Reported in version: 2.0.12
Reported for operating system, platform: Linux, x86_64
Comments on the original bug report:
On 2020-10-10 14:32:46 +0000, Alberts Muktupāvels wrote:
On 2020-10-12 16:27:58 +0000, Sam Lantinga wrote:
On 2020-10-17 20:11:44 +0000, Alberts Muktupāvels wrote:
On 2020-10-17 20:16:32 +0000, Alberts Muktupāvels wrote:
On 2020-10-20 00:27:20 +0000, Sam Lantinga wrote:
The text was updated successfully, but these errors were encountered: