From eeafe3c5de257827139b61dd1d5d5baaf1fab86b 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 0d946de6..46a4b3c7 100644 --- a/src/client.c +++ b/src/client.c @@ -3986,6 +3986,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); @@ -3997,12 +4003,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 50303b03..efc1db6c 100644 --- a/src/events.c +++ b/src/events.c @@ -1421,23 +1421,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.12.0