opt: dont let window get pointer focus in overview

This commit is contained in:
DreamMaoMao 2026-05-16 15:13:39 +08:00
parent 4ca7439575
commit 469249b39e
3 changed files with 15 additions and 2 deletions

View file

@ -1000,7 +1000,9 @@ void client_animation_next_tick(Client *c) {
surface =
pointer_c && pointer_c == c ? client_surface(pointer_c) : NULL;
if (surface && pointer_c == selmon->sel) {
// avoid game window force grab pointer in overview mode
if (surface && pointer_c == selmon->sel && !selmon->isoverview) {
wlr_seat_pointer_notify_enter(seat, surface, sx, sy);
}

View file

@ -1736,6 +1736,11 @@ int32_t toggleoverview(const Arg *arg) {
// 正常视图到overview,退出所有窗口的浮动和全屏状态参与平铺,
// overview到正常视图,还原之前退出的浮动和全屏窗口状态
if (selmon->isoverview) {
// 让游戏窗口无法强制约束鼠标
wlr_seat_pointer_clear_focus(seat);
wlr_cursor_set_xcursor(cursor, cursor_mgr, "default");
wl_list_for_each(c, &clients, link) {
if (c && c->mon == selmon && !client_is_unmanaged(c) &&
!client_is_x11_popup(c) && !c->isunglobal)

View file

@ -4863,7 +4863,13 @@ void pointerfocus(Client *c, struct wlr_surface *surface, double sx, double sy,
/* Let the client know that the mouse cursor has entered one
* of its surfaces, and make keyboard focus follow if desired.
* wlroots makes this a no-op if surface is already focused */
wlr_seat_pointer_notify_enter(seat, surface, sx, sy);
if (!c || !c->mon || !c->mon->isoverview) {
// don't let window get pointer focus,
// avoid game window force grab pointer in overview mode
wlr_seat_pointer_notify_enter(seat, surface, sx, sy);
}
wlr_seat_pointer_notify_motion(seat, time, sx, sy);
}