From 35b93669f18a2e5ff414b2744e5d2013ad89553e Mon Sep 17 00:00:00 2001 From: Guido Cella Date: Fri, 4 Sep 2020 15:35:04 +0200 Subject: [PATCH] reuse motionnotify() --- dwl.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/dwl.c b/dwl.c index 3b1b999..cd9b7ba 100644 --- a/dwl.c +++ b/dwl.c @@ -1236,16 +1236,8 @@ void maplayersurfacenotify(struct wl_listener *listener, void *data) { LayerSurface *layersurface = wl_container_of(listener, layersurface, map); - double sx = 0.0, sy = 0.0; - struct wlr_surface *sub = wlr_layer_surface_v1_surface_at( - layersurface->layer_surface, - cursor->x - layersurface->geo.x, - cursor->y - layersurface->geo.y, - &sx, &sy); wlr_surface_send_enter(layersurface->layer_surface->surface, layersurface->layer_surface->output); - if (sub) - wlr_seat_pointer_notify_enter(seat, sub, sx, sy); - /* XXX check if the layer surface is below a client */ + motionnotify(0); } void @@ -1317,6 +1309,11 @@ motionnotify(uint32_t time) double sx = 0, sy = 0; struct wlr_surface *surface = NULL; Client *c = NULL; + struct timespec now; + if (!time) { + clock_gettime(CLOCK_MONOTONIC, &now); + time = now.tv_sec * 1000 + now.tv_nsec / 1000000; + } /* Update selmon (even while dragging a window) */ if (sloppyfocus) @@ -2102,7 +2099,8 @@ unmaplayersurface(LayerSurface *layersurface) ) wlr_seat_keyboard_notify_clear_focus(seat); - /* XXX recheck keyboard and pointer focus */ + /* XXX recheck keyboard focus */ + motionnotify(0); // XXX why doesn't this work? } void