From f450803bd5dc90b9313c68f3581bb0488d22f296 Mon Sep 17 00:00:00 2001 From: jjacky 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: Olivier Brunel --- 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 79de331..3812aac 100644 --- a/src/client.c +++ b/src/client.c @@ -3942,6 +3942,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); @@ -3953,12 +3959,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 561cd5c..51411a8 100644 --- a/src/events.c +++ b/src/events.c @@ -1416,23 +1416,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 */ -- 2.3.1