[Xfce4-commits] r26362 - xfwm4/trunk/src

Olivier Fourdan olivier at xfce.org
Sat Nov 17 21:23:19 CET 2007


Author: olivier
Date: 2007-11-17 20:23:19 +0000 (Sat, 17 Nov 2007)
New Revision: 26362

Modified:
   xfwm4/trunk/src/client.c
Log:
Filter out grab/ungrab events so we don't end up redrawing the frame twice

Modified: xfwm4/trunk/src/client.c
===================================================================
--- xfwm4/trunk/src/client.c	2007-11-17 18:54:43 UTC (rev 26361)
+++ xfwm4/trunk/src/client.c	2007-11-17 20:23:19 UTC (rev 26362)
@@ -5228,32 +5228,39 @@
     status = EVENT_FILTER_STOP;
     pressed = TRUE;
 
-    if (xevent->type == EnterNotify)
+    switch (xevent->type)
     {
-        c->button_status[b] = BUTTON_STATE_PRESSED;
-        frameDraw (c, FALSE);
+        case EnterNotify:
+            if ((xevent->xcrossing.mode != NotifyGrab) && (xevent->xcrossing.mode != NotifyUngrab))
+            {
+                c->button_status[b] = BUTTON_STATE_PRESSED;
+                frameDraw (c, FALSE);
+            }
+            break;
+        case LeaveNotify:
+            if ((xevent->xcrossing.mode != NotifyGrab) && (xevent->xcrossing.mode != NotifyUngrab))
+            {
+                c->button_status[b] = BUTTON_STATE_NORMAL;
+                frameDraw (c, FALSE);
+            }
+            break;
+        case ButtonRelease:
+            pressed = FALSE;
+            break;
+        case UnmapNotify:
+            if (xevent->xunmap.window == c->window)
+            {
+                pressed = FALSE;
+                c->button_status[b] = BUTTON_STATE_NORMAL;
+            }
+            break;
+        case KeyPress:
+        case KeyRelease:
+            break;
+        default:
+            status = EVENT_FILTER_CONTINUE;
+            break;
     }
-    else if (xevent->type == LeaveNotify)
-    {
-        c->button_status[b] = BUTTON_STATE_NORMAL;
-        frameDraw (c, FALSE);
-    }
-    else if (xevent->type == ButtonRelease)
-    {
-        pressed = FALSE;
-    }
-    else if ((xevent->type == UnmapNotify) && (xevent->xunmap.window == c->window))
-    {
-        pressed = FALSE;
-        c->button_status[b] = BUTTON_STATE_NORMAL;
-    }
-    else if ((xevent->type == KeyPress) || (xevent->type == KeyRelease))
-    {
-    }
-    else
-    {
-        status = EVENT_FILTER_CONTINUE;
-    }
 
     if (!pressed)
     {
@@ -5378,6 +5385,7 @@
 {
     ScreenInfo *screen_info;
 
+    TRACE ("entering clientGetButtonPixmap button=%i, state=%i", button,state);
     screen_info = c->screen_info;
     switch (button)
     {



More information about the Xfce4-commits mailing list