aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2021-06-10 00:57:23 +0200
committerJohn Ankarström <john@ankarstrom.se>2021-06-10 00:57:23 +0200
commitbc236b7fbc4a2603dacb682926df64e2a70c48f1 (patch)
tree74d8e4e2087e947a9290ca2c2a12afeacf8dd271 /src
parent2a0edf6b012c6bc553118767cd6c7354caf79003 (diff)
downloadjwm-bc236b7fbc4a2603dacb682926df64e2a70c48f1.tar.gz
Focus window when hovered in taskbar
This may call FocusClient a thousand times per second, I don't know. But it works.
Diffstat (limited to 'src')
-rw-r--r--src/taskbar.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/taskbar.c b/src/taskbar.c
index 1e2cb1b..f0a72fe 100644
--- a/src/taskbar.c
+++ b/src/taskbar.c
@@ -446,15 +446,17 @@ void SignalTaskbar(const TimeType *now, int x, int y) {
for(bp = bars; bp; bp = bp->next) {
if(abs(bp->mousex - x) < POPUP_DELTA
&& abs(bp->mousey - y) < POPUP_DELTA) {
- if(GetTimeDifference(now, &bp->mouseTime) >= popupDelay) {
- if(bp->layout == LAYOUT_HORIZONTAL) {
- np = GetNode(bp, x - bp->cp->screenx);
- } else {
- np = GetNode(bp, y - bp->cp->screeny);
- }
+ if(bp->layout == LAYOUT_HORIZONTAL) {
+ np = GetNode(bp, x - bp->cp->screenx);
+ } else {
+ np = GetNode(bp, y - bp->cp->screeny);
+ }
+ if(GetTimeDifference(now, &bp->mouseTime)>=popupDelay) {
if(np) {
ShowPopup(x, y, np->client->name);
}
+ } else {
+ FocusClient(np->client);
}
}
}