Compare commits
3 Commits
ffa496fa98
...
16368a8781
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
16368a8781 | ||
|
|
b768f72eaa | ||
|
|
28ab0e6343 |
33
src/mango.c
33
src/mango.c
@@ -1557,12 +1557,19 @@ void apply_window_snap(Client *c) {
|
||||
resize(c, c->geom, 0);
|
||||
}
|
||||
|
||||
void focuslayer(LayerSurface *l) {
|
||||
focusclient(NULL, 0);
|
||||
dwl_im_relay_set_focus(dwl_input_method_relay, l->layer_surface->surface);
|
||||
client_notify_enter(l->layer_surface->surface, wlr_seat_get_keyboard(seat));
|
||||
}
|
||||
|
||||
void reset_exclusive_layer(Monitor *m) {
|
||||
LayerSurface *l = NULL;
|
||||
int i;
|
||||
unsigned int layers_above_shell[] = {
|
||||
ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY,
|
||||
ZWLR_LAYER_SHELL_V1_LAYER_TOP,
|
||||
ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM,
|
||||
};
|
||||
|
||||
if (!m)
|
||||
@@ -1570,18 +1577,24 @@ void reset_exclusive_layer(Monitor *m) {
|
||||
|
||||
for (i = 0; i < (int)LENGTH(layers_above_shell); i++) {
|
||||
wl_list_for_each_reverse(l, &m->layers[layers_above_shell[i]], link) {
|
||||
if (l == exclusive_focus &&
|
||||
l->layer_surface->current.keyboard_interactive !=
|
||||
ZWLR_LAYER_SURFACE_V1_KEYBOARD_INTERACTIVITY_EXCLUSIVE)
|
||||
exclusive_focus = NULL;
|
||||
if (l->layer_surface->current.keyboard_interactive ==
|
||||
ZWLR_LAYER_SURFACE_V1_KEYBOARD_INTERACTIVITY_NONE &&
|
||||
l->layer_surface->surface ==
|
||||
seat->keyboard_state.focused_surface)
|
||||
focusclient(focustop(selmon), 1);
|
||||
|
||||
if (locked ||
|
||||
l->layer_surface->current.keyboard_interactive !=
|
||||
ZWLR_LAYER_SURFACE_V1_KEYBOARD_INTERACTIVITY_EXCLUSIVE ||
|
||||
!l->mapped || l == exclusive_focus)
|
||||
continue;
|
||||
/* Deactivate the focused client. */
|
||||
focusclient(NULL, 0);
|
||||
exclusive_focus = l;
|
||||
dwl_im_relay_set_focus(dwl_input_method_relay,
|
||||
l->layer_surface->surface);
|
||||
client_notify_enter(l->layer_surface->surface,
|
||||
wlr_seat_get_keyboard(seat));
|
||||
focuslayer(l);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -1882,11 +1895,7 @@ buttonpress(struct wl_listener *listener, void *data) {
|
||||
if (l && !exclusive_focus &&
|
||||
l->layer_surface->current.keyboard_interactive ==
|
||||
ZWLR_LAYER_SURFACE_V1_KEYBOARD_INTERACTIVITY_ON_DEMAND) {
|
||||
focusclient(NULL, 0);
|
||||
dwl_im_relay_set_focus(dwl_input_method_relay,
|
||||
l->layer_surface->surface);
|
||||
client_notify_enter(l->layer_surface->surface,
|
||||
wlr_seat_get_keyboard(seat));
|
||||
focuslayer(l);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2215,9 +2224,7 @@ void maplayersurfacenotify(struct wl_listener *listener, void *data) {
|
||||
if (!exclusive_focus &&
|
||||
l->layer_surface->current.keyboard_interactive ==
|
||||
ZWLR_LAYER_SURFACE_V1_KEYBOARD_INTERACTIVITY_ON_DEMAND) {
|
||||
focusclient(NULL, 0);
|
||||
client_notify_enter(l->layer_surface->surface,
|
||||
wlr_seat_get_keyboard(seat));
|
||||
focuslayer(l);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user