summarylogtreecommitdiffstats
path: root/hover-inactive.patch
blob: 3dc8789b4ef43910feb7dd55e332da44ec427c86 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
diff -r 6ae1e81f12d7 src/client.c
--- a/src/client.c	Tue Dec 20 20:30:57 2011 +0100
+++ b/src/client.c	Tue Dec 20 20:41:38 2011 +0100
@@ -3795,6 +3795,12 @@
 int
 clientGetButtonState (Client *c, int button, int state)
 {
+    if ((c->button_status[button] == BUTTON_STATE_PRELIGHT) &&
+         clientGetButtonPixmap (c, button, PRELIGHT))
+    {
+        return (PRELIGHT);
+    }
+
     if (state == INACTIVE)
     {
         return (state);
@@ -3806,12 +3812,6 @@
         return (PRESSED);
     }
 
-    if ((c->button_status[button] == BUTTON_STATE_PRELIGHT) &&
-        clientGetButtonPixmap (c, button, PRELIGHT))
-    {
-        return (PRELIGHT);
-    }
-
     return (ACTIVE);
 }
 
diff -r 6ae1e81f12d7 src/events.c
--- a/src/events.c	Tue Dec 20 20:30:57 2011 +0100
+++ b/src/events.c	Tue Dec 20 20:41:38 2011 +0100
@@ -1380,23 +1380,20 @@
                 clientClearDelayedFocus ();
             }
         }
-        if (c == clientGetFocus ())
+        for (b = 0; b < BUTTON_COUNT; b++)
         {
-            for (b = 0; b < BUTTON_COUNT; b++)
+            if (MYWINDOW_XWINDOW(c->buttons[b]) == ev->window)
             {
-                if (MYWINDOW_XWINDOW(c->buttons[b]) == ev->window)
+                if (!xfwmPixmapNone(clientGetButtonPixmap(c, b, PRELIGHT)))
                 {
-                    if (!xfwmPixmapNone(clientGetButtonPixmap(c, b, PRELIGHT)))
-                    {
-                        c->button_status[b] = BUTTON_STATE_PRELIGHT;
-                        need_redraw = TRUE;
-                    }
+                    c->button_status[b] = BUTTON_STATE_PRELIGHT;
+                    need_redraw = TRUE;
                 }
             }
-            if (need_redraw)
-            {
-                frameQueueDraw (c, FALSE);
-            }
+        }
+        if (need_redraw)
+        {
+            frameQueueDraw (c, FALSE);
         }
 
         /* No need to process the event any further */