dwl

My patch set and modifications to dwl
git clone git://git.ethandl.dev/dwl
Log | Files | Refs | README | LICENSE

commit e0822926068e84b0fc391e0306f66ea0ec16cf47
parent deb48ff48b186ff77a7e9d3b3ab724ff4c3c340f
Author: Leonardo Hernández Hernández <leohdz172@protonmail.com>
Date:   Mon, 20 Jun 2022 18:33:14 -0500

do not focus clients if a layer surface is focused

Diffstat:
Mdwl.c | 11+++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/dwl.c b/dwl.c @@ -299,6 +299,7 @@ static void zoom(const Arg *arg); /* variables */ static const char broken[] = "broken"; static pid_t child_pid = -1; +static struct wlr_surface *exclusive_focus; static struct wl_display *dpy; static struct wlr_backend *backend; static struct wlr_scene *scene; @@ -610,11 +611,12 @@ arrangelayers(Monitor *m) layersurface->layer_surface->mapped) { /* Deactivate the focused client. */ focusclient(NULL, 0); + exclusive_focus = layersurface->layer_surface->surface; if (kb) - wlr_seat_keyboard_notify_enter(seat, layersurface->layer_surface->surface, + wlr_seat_keyboard_notify_enter(seat, exclusive_focus, kb->keycodes, kb->num_keycodes, &kb->modifiers); else - wlr_seat_keyboard_notify_enter(seat, layersurface->layer_surface->surface, NULL, 0, NULL); + wlr_seat_keyboard_notify_enter(seat, exclusive_focus, NULL, 0, NULL); return; } } @@ -1125,6 +1127,9 @@ focusclient(Client *c, int lift) struct wlr_surface *old = seat->keyboard_state.focused_surface; struct wlr_keyboard *kb; int i; + /* Do not focus clients if a layer surface is focused */ + if (exclusive_focus) + return; /* Raise client in stacking order if requested */ if (c && lift) @@ -2261,6 +2266,8 @@ unmaplayersurfacenotify(struct wl_listener *listener, void *data) layersurface->layer_surface->mapped = (layersurface->mapped = 0); wlr_scene_node_set_enabled(layersurface->scene, 0); + if (layersurface->layer_surface->surface == exclusive_focus) + exclusive_focus = NULL; if (layersurface->layer_surface->surface == seat->keyboard_state.focused_surface) focusclient(selclient(), 1);