summarylogtreecommitdiffstats
path: root/0001-Add-hover-effects-for-titlebar-s-buttons-of-inactive.patch
diff options
context:
space:
mode:
Diffstat (limited to '0001-Add-hover-effects-for-titlebar-s-buttons-of-inactive.patch')
-rw-r--r--0001-Add-hover-effects-for-titlebar-s-buttons-of-inactive.patch85
1 files changed, 85 insertions, 0 deletions
diff --git a/0001-Add-hover-effects-for-titlebar-s-buttons-of-inactive.patch b/0001-Add-hover-effects-for-titlebar-s-buttons-of-inactive.patch
new file mode 100644
index 000000000000..9bc2c2099853
--- /dev/null
+++ b/0001-Add-hover-effects-for-titlebar-s-buttons-of-inactive.patch
@@ -0,0 +1,85 @@
+From b1d3fb99c60bc716ec9e648790fd2a0f30b6891c Mon Sep 17 00:00:00 2001
+From: jjacky <i.am.jack.mail@gmail.com>
+Date: Thu, 4 Apr 2013 16:58:07 +0200
+Subject: [PATCH] Add hover effects for (titlebar's) buttons of inactive
+ windows
+
+Importing this old patch from the old mercurial repo (too lazy to convert it,
+and there was no history anyways).
+
+Signed-off-by: jjacky <i.am.jack.mail@gmail.com>
+---
+ src/client.c | 12 ++++++------
+ src/events.c | 21 +++++++++------------
+ 2 files changed, 15 insertions(+), 18 deletions(-)
+
+diff --git a/src/client.c b/src/client.c
+index 4e86808..bb89029 100644
+--- a/src/client.c
++++ b/src/client.c
+@@ -3851,6 +3851,12 @@ clientGetButtonPixmap (Client *c, int button, int state)
+ 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);
+@@ -3862,12 +3868,6 @@ clientGetButtonState (Client *c, int button, int state)
+ return (PRESSED);
+ }
+
+- if ((c->button_status[button] == BUTTON_STATE_PRELIGHT) &&
+- clientGetButtonPixmap (c, button, PRELIGHT))
+- {
+- return (PRELIGHT);
+- }
+-
+ return (ACTIVE);
+ }
+
+diff --git a/src/events.c b/src/events.c
+index 4b49171..f5e782c 100644
+--- a/src/events.c
++++ b/src/events.c
+@@ -1394,23 +1394,20 @@ handleEnterNotify (DisplayInfo *display_info, XCrossingEvent * ev)
+ 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 */
+--
+1.8.2.2
+