This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project gfxprim.git.
The branch, master has been updated via ec2f0bf1e1633bd1b8e4eae76f6c99b4ffe067a5 (commit) via fcfd8c99cab2abf5d47b8879f3f12832f365cd1a (commit) from 4e80095b3f5f7da3d999465f8989979a9c2e7595 (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- http://repo.or.cz/w/gfxprim.git/commit/ec2f0bf1e1633bd1b8e4eae76f6c99b4ffe06...
commit ec2f0bf1e1633bd1b8e4eae76f6c99b4ffe067a5 Merge: 4e80095 fcfd8c9 Author: Cyril Hrubis metan@ucw.cz Date: Sun Dec 2 16:05:08 2012 +0100
Merge 192.168.1.100:Devel/gfxprim
http://repo.or.cz/w/gfxprim.git/commit/fcfd8c99cab2abf5d47b8879f3f12832f365c...
commit fcfd8c99cab2abf5d47b8879f3f12832f365cd1a Author: Cyril Hrubis metan@ucw.cz Date: Sun Dec 2 17:43:20 2012 +0100
Fix "X Window Close Button"
This adds partially hacky support for WM_WINDOW_DELETE event. More cleaner solution will need a little change in the current API and will be added later.
diff --git a/libs/backends/GP_X11.c b/libs/backends/GP_X11.c index 8e08476..dbe3fc8 100644 --- a/libs/backends/GP_X11.c +++ b/libs/backends/GP_X11.c @@ -442,7 +442,7 @@ void create_window(struct x11_priv *x11, int x, int y, XMapWindow(x11->dpy, x11->win); return; } - + GP_DEBUG(2, "Opening window '%s' %ix%i-%ux%u", caption, x, y, *w, *h);
@@ -453,6 +453,17 @@ void create_window(struct x11_priv *x11, int x, int y, /* Set window caption */ XmbSetWMProperties(x11->dpy, x11->win, caption, caption, NULL, 0, NULL, NULL, NULL); + + /* Make the window close button send event */ + Atom xa = XInternAtom(x11->dpy, "WM_DELETE_WINDOW", True); + + if (xa != None) { + GP_DEBUG(2, "Setting WM_DELETE_WINWOW Atom to True"); + + XSetWMProtocols(x11->dpy, x11->win, &xa, 1); + } else { + GP_DEBUG(2, "Failed to set WM_DELETE_WINDOW Atom to True"); + } /* Show window */ XMapWindow(x11->dpy, x11->win); diff --git a/libs/input/GP_InputDriverX11.c b/libs/input/GP_InputDriverX11.c index 5caae39..cbfb0c9 100644 --- a/libs/input/GP_InputDriverX11.c +++ b/libs/input/GP_InputDriverX11.c @@ -123,6 +123,19 @@ void GP_InputDriverX11EventPut(XEvent *ev) GP_EventPushKey(key, press, NULL); break; + /* events from WM */ + case ClientMessage: + //TODO: We know we get WM_DELETE_WINDOW because it's the only + // event we requested to get but we must check anyway + GP_EventPush(GP_EV_SYS, GP_EV_SYS_QUIT, 0, NULL); +#if 0 + switch (ev->xclient.message_type) { + default: + GP_WARN("Unknown X11 ClientMessage Atom %i", + ev->xclient.message_type); + } +#endif + break; default: GP_WARN("Unhandled X11 event type %u", ev->type); }
-----------------------------------------------------------------------
Summary of changes: libs/backends/GP_X11.c | 13 ++++++++++++- libs/input/GP_InputDriverX11.c | 13 +++++++++++++ 2 files changed, 25 insertions(+), 1 deletions(-)
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos@gmail.com if you want to unsubscribe, or site admin admin@repo.or.cz if you receive no reply.