[Xfce4-commits] [xfce/xfwm4] 08/11: client: Fix enter/leave on buttons

noreply at xfce.org noreply at xfce.org
Wed May 15 22:51:29 CEST 2019


This is an automated email from the git hooks/post-receive script.

o   l   i   v   i   e   r       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository xfce/xfwm4.

commit 86c88ac79034240c1e43d4f5538857caab1abcab
Author: Olivier Fourdan <fourdan at xfce.org>
Date:   Wed May 15 22:24:32 2019 +0200

    client: Fix enter/leave on buttons
    
    Bug: 14741
    
    For button enter/leave events, checking the crossing mode prevents the
    events from being handled.
    
    Signed-off-by: Olivier Fourdan <fourdan at xfce.org>
---
 src/client.c | 41 ++++++++++++++---------------------------
 1 file changed, 14 insertions(+), 27 deletions(-)

diff --git a/src/client.c b/src/client.c
index 16fdf50..27e72e9 100644
--- a/src/client.c
+++ b/src/client.c
@@ -3787,55 +3787,42 @@ clientButtonPressEventFilter (XfwmEvent *event, gpointer data)
     /* Update the display time */
     myDisplayUpdateCurrentTime (display_info, event);
 
-    status = EVENT_FILTER_CONTINUE;
+    status = EVENT_FILTER_STOP;
     pressed = TRUE;
 
     switch (event->meta.type)
     {
-        case XFWM_EVENT_KEY:
-            status = EVENT_FILTER_STOP;
-            break;
         case XFWM_EVENT_BUTTON:
             if (!event->button.pressed)
             {
                 pressed = FALSE;
-                status = EVENT_FILTER_STOP;
             }
             break;
-        case XFWM_EVENT_MOTION:
-            break;
         case XFWM_EVENT_CROSSING:
             if (event->crossing.enter)
             {
-                if ((event->crossing.mode != NotifyGrab) && (event->crossing.mode != NotifyUngrab))
-                {
-                    c->button_status[b] = BUTTON_STATE_PRESSED;
-                    frameQueueDraw (c, FALSE);
-                }
+                c->button_status[b] = BUTTON_STATE_PRESSED;
+                frameQueueDraw (c, FALSE);
             }
             else
             {
-                if ((event->crossing.mode != NotifyGrab) && (event->crossing.mode != NotifyUngrab))
-                {
-                    c->button_status[b] = BUTTON_STATE_NORMAL;
-                    frameQueueDraw (c, FALSE);
-                }
+                c->button_status[b] = BUTTON_STATE_NORMAL;
+                frameQueueDraw (c, FALSE);
             }
-            status = EVENT_FILTER_STOP;
             break;
         case XFWM_EVENT_XEVENT:
-            switch (event->meta.xevent->type)
+            if ((event->meta.xevent->type == UnmapNotify) && (event->meta.window == c->window))
             {
-                case UnmapNotify:
-                    if (event->meta.window == c->window)
-                    {
-                        pressed = FALSE;
-                        c->button_status[b] = BUTTON_STATE_NORMAL;
-                    }
-                    status = EVENT_FILTER_STOP;
-                    break;
+                pressed = FALSE;
+                c->button_status[b] = BUTTON_STATE_NORMAL;
+            }
+            else
+            {
+                status = EVENT_FILTER_CONTINUE;
             }
             break;
+        default:
+            break;
     }
 
     if (!pressed)

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list