diff --git a/docs/installation.md b/docs/installation.md index c5d4936c..ba51a109 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -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` diff --git a/mangowm.scm b/mangowm.scm index 44031ed0..83bcf168 100644 --- a/mangowm.scm +++ b/mangowm.scm @@ -54,6 +54,7 @@ seatd pcre2 libxcb + pixman xcb-util-wm wlroots-0.19 scenefx)) diff --git a/meson.build b/meson.build index 4644b38a..36ba100c 100644 --- a/meson.build +++ b/meson.build @@ -38,6 +38,7 @@ xkbcommon_dep = dependency('xkbcommon') libinput_dep = dependency('libinput',version: '>=1.27.1') libwayland_client_dep = dependency('wayland-client') pcre2_dep = dependency('libpcre2-8') +pixman_dep = dependency('pixman-1') # 获取版本信息 @@ -107,6 +108,7 @@ executable('mango', libinput_dep, libwayland_client_dep, pcre2_dep, + pixman_dep, ], install : true, c_args : c_args, diff --git a/src/fetch/common.h b/src/fetch/common.h index 43f58f82..f58bd33a 100644 --- a/src/fetch/common.h +++ b/src/fetch/common.h @@ -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;