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 88eea356e8494dea8645470506f2087b104d4326 (commit) via 6bc4c8d0ca2ac207dc2a0e2feb9fd482aeff1343 (commit) from 117f44cf3323cab17798651ccdedc9018e5a95fc (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/88eea356e8494dea8645470506f2087b104d4...
commit 88eea356e8494dea8645470506f2087b104d4326 Author: Cyril Hrubis metan@ucw.cz Date: Tue Nov 12 23:43:45 2013 +0100
backends: X11: Flush connection when window was closed.
If one of the windows was closed the connection needs to be flushed so that it's removed from the screen immediately.
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/libs/backends/GP_X11_Win.h b/libs/backends/GP_X11_Win.h index ad0bbf5..1a81fc5 100644 --- a/libs/backends/GP_X11_Win.h +++ b/libs/backends/GP_X11_Win.h @@ -90,6 +90,11 @@ static struct x11_win *win_list_lookup(Window win) return NULL; }
+static int win_list_empty(void) +{ + return win_list == NULL; +} + /* Send NETWM message, most modern Window Managers should understand */ static void x11_win_fullscreen(struct x11_win *win, int mode) { @@ -379,6 +384,9 @@ static void x11_win_close(struct x11_win *win)
XDestroyWindow(win->dpy, win->win);
+ if (!win_list_empty()) + XFlush(win->dpy); + XUnlockDisplay(win->dpy);
/* Close connection/Decrease ref count */
http://repo.or.cz/w/gfxprim.git/commit/6bc4c8d0ca2ac207dc2a0e2feb9fd482aeff1...
commit 6bc4c8d0ca2ac207dc2a0e2feb9fd482aeff1343 Author: Cyril Hrubis metan@ucw.cz Date: Tue Nov 12 23:41:40 2013 +0100
backends: X11: Avoid dereferencing closed window
If X11 backend has two windows opened and one of them was closed the pointer to last window in event parser may became invalid. Now it's cleared when window is closed.
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/libs/backends/GP_X11.c b/libs/backends/GP_X11.c index 5b64b49..ffa0b9c 100644 --- a/libs/backends/GP_X11.c +++ b/libs/backends/GP_X11.c @@ -105,20 +105,24 @@ static void x11_flip(GP_Backend *self) XUnlockDisplay(win->dpy); }
+static struct x11_win *last_win = NULL; + static void x11_ev(XEvent *ev) { - static struct x11_win *win = NULL; + struct x11_win *win;
/* Lookup for window */ - if (win == NULL || win->win != ev->xany.window) { - win = win_list_lookup(ev->xany.window); + if (last_win == NULL || last_win->win != ev->xany.window) { + last_win = win_list_lookup(ev->xany.window);
- if (win == NULL) { + if (last_win == NULL) { GP_WARN("Event for unknown window, ignoring."); return; } }
+ win = last_win; + struct GP_Backend *self = GP_CONTAINER_OF(win, struct GP_Backend, priv);
switch (ev->type) { @@ -546,6 +550,13 @@ static void window_close(GP_Backend *self)
static void x11_exit(GP_Backend *self) { + struct x11_win *win = GP_BACKEND_PRIV(self); + + GP_DEBUG(1, "Closing window %p", win); + + if (win == last_win) + last_win = NULL; + window_close(self);
free(self); diff --git a/libs/backends/GP_X11_Win.h b/libs/backends/GP_X11_Win.h index b728bcf..ad0bbf5 100644 --- a/libs/backends/GP_X11_Win.h +++ b/libs/backends/GP_X11_Win.h @@ -363,6 +363,8 @@ static int x11_win_open(struct x11_wreq *wreq)
static void x11_win_close(struct x11_win *win) { + GP_DEBUG(1, "Closing window"); + XLockDisplay(win->dpy);
win_list_rem(win);
-----------------------------------------------------------------------
Summary of changes: libs/backends/GP_X11.c | 19 +++++++++++++++---- libs/backends/GP_X11_Win.h | 10 ++++++++++ 2 files changed, 25 insertions(+), 4 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.