fix: should ignore empty input layer focus

This commit is contained in:
DreamMaoMao 2026-05-23 13:22:40 +08:00
parent 33735a796f
commit 4a9ab3dd9f
4 changed files with 14 additions and 1 deletions

View file

@ -273,6 +273,7 @@ If your distribution isn't listed above, or you want the latest unreleased chang
> - `hwdata`
> - `seatd`
> - `pcre2`
> - `pixman`
> - `xorg-xwayland`
> - `libxcb`

View file

@ -54,6 +54,7 @@
seatd
pcre2
libxcb
pixman
xcb-util-wm
wlroots-0.19
scenefx))

View file

@ -39,6 +39,7 @@ libinput_dep = dependency('libinput',version: '>=1.27.1')
libwayland_client_dep = dependency('wayland-client')
pcre2_dep = dependency('libpcre2-8')
libscenefx_dep = dependency('scenefx-0.4',version: '>=0.4.1')
pixman_dep = dependency('pixman-1')
# 获取版本信息
@ -110,6 +111,7 @@ executable('mango',
libinput_dep,
libwayland_client_dep,
pcre2_dep,
pixman_dep,
],
install : true,
c_args : c_args,

View file

@ -90,6 +90,15 @@ Client *xytoclient(double x, double y) {
return NULL;
}
static bool layer_ignores_focus(LayerSurface *l) {
if (!l || !l->layer_surface)
return true;
struct wlr_surface *s = l->layer_surface->surface;
return !pixman_region32_not_empty(&s->input_region) ||
l->layer_surface->current.keyboard_interactive ==
ZWLR_LAYER_SURFACE_V1_KEYBOARD_INTERACTIVITY_NONE;
}
void xytonode(double x, double y, struct wlr_surface **psurface, Client **pc,
LayerSurface **pl, double *nx, double *ny) {
struct wlr_scene_node *node, *pnode;
@ -151,7 +160,7 @@ void xytonode(double x, double y, struct wlr_surface **psurface, Client **pc,
if (pl)
*pl = l;
if (selmon && selmon->isoverview && !l) {
if (selmon && selmon->isoverview && (!l || layer_ignores_focus(l))) {
ovc = xytoclient(x, y);
if (pc)
*pc = ovc;