summaryrefslogtreecommitdiff
path: root/dwl.c
diff options
context:
space:
mode:
authorGuido Cella <guido@guidocella.xyz>2020-12-20 15:34:36 +0100
committerGuido Cella <guido@guidocella.xyz>2020-12-20 15:46:31 +0100
commit39946e07f2b2ac09cfa622668585f2223fc277d4 (patch)
tree0b7723c252245bbdfd3cc5bd7d0c528b7617b321 /dwl.c
parentf80f08848b8b7e08ed2f20c7f0a8675a3b4df394 (diff)
fix keyboard focus with overlays
Don't let internal calls to motionnotify(0) meant to update the pointer focus from maplayersurfacenotify and destroylayersurfacenotify also shift the keyboard focus to the surface under the cursor with sloppyfocus.
Diffstat (limited to 'dwl.c')
-rw-r--r--dwl.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/dwl.c b/dwl.c
index 7a12817..46ba04a 100644
--- a/dwl.c
+++ b/dwl.c
@@ -1412,12 +1412,6 @@ motionabsolute(struct wl_listener *listener, void *data)
void
motionnotify(uint32_t time)
{
- struct timespec now;
- if (!time) {
- clock_gettime(CLOCK_MONOTONIC, &now);
- time = now.tv_sec * 1000 + now.tv_nsec / 1000000;
- }
-
wlr_idle_notify_activity(idle, seat);
/* Update selmon (even while dragging a window) */
@@ -1608,6 +1602,13 @@ pointerfocus(Client *c, struct wlr_surface *surface, double sx, double sy,
return;
}
+ bool internal_call = !time;
+ if (!time) {
+ struct timespec now;
+ clock_gettime(CLOCK_MONOTONIC, &now);
+ time = now.tv_sec * 1000 + now.tv_nsec / 1000000;
+ }
+
/* If surface is already focused, only notify of motion */
if (surface == seat->pointer_state.focused_surface) {
wlr_seat_pointer_notify_motion(seat, time, sx, sy);
@@ -1626,7 +1627,7 @@ pointerfocus(Client *c, struct wlr_surface *surface, double sx, double sy,
return;
#endif
- if (sloppyfocus)
+ if (sloppyfocus && !internal_call)
focusclient(c, false);
}