[Xfce4-commits] <xfce4-notifyd:master> Fix race with window becoming invalid (bug #7643).

Jérôme Guelfucci noreply at xfce.org
Thu Jun 30 23:12:01 CEST 2011


Updating branch refs/heads/master
         to 37d571aee335f263d05a117cdf9051aa66b154ad (commit)
       from 2c4b6d985d1895f18e680cb5a08b405b6a2f72ce (commit)

commit 37d571aee335f263d05a117cdf9051aa66b154ad
Author: Ricky Zhou <ricky at fedoraproject.org>
Date:   Thu Jun 2 05:22:01 2011 -0400

    Fix race with window becoming invalid (bug #7643).

 xfce4-notifyd/xfce-notify-daemon.c |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/xfce4-notifyd/xfce-notify-daemon.c b/xfce4-notifyd/xfce-notify-daemon.c
index 0d6eddd..6e49ab2 100644
--- a/xfce4-notifyd/xfce-notify-daemon.c
+++ b/xfce4-notifyd/xfce-notify-daemon.c
@@ -517,11 +517,22 @@ xfce_notify_daemon_get_workarea(GdkScreen *screen,
 
     for(l = g_list_first(windows_list); l != NULL; l = g_list_next(l)) {
         GdkWindow *window = l->data;
+        GdkWindowTypeHint type_hint;
 
-        if(gdk_window_get_type_hint(window) == GDK_WINDOW_TYPE_HINT_DOCK) {
+        gdk_error_trap_push();
+        type_hint = gdk_window_get_type_hint(window);
+        gdk_flush();
+        if (gdk_error_trap_pop())
+            continue;
+
+        if(type_hint == GDK_WINDOW_TYPE_HINT_DOCK) {
             GdkRectangle window_geom, intersection;
 
+            gdk_error_trap_push();
             gdk_window_get_frame_extents(window, &window_geom);
+            gdk_flush();
+            if (gdk_error_trap_pop())
+                continue;
 
             DBG("Got a dock window: x(%d), y(%d), w(%d), h(%d)",
                 window_geom.x,



More information about the Xfce4-commits mailing list