diff --git a/src/animation/client.h b/src/animation/client.h index a34a3348..aed97c1f 100644 --- a/src/animation/client.h +++ b/src/animation/client.h @@ -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); } diff --git a/src/dispatch/bind_define.h b/src/dispatch/bind_define.h index 22fc16a3..ff5ccdf5 100644 --- a/src/dispatch/bind_define.h +++ b/src/dispatch/bind_define.h @@ -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) diff --git a/src/mango.c b/src/mango.c index 8c11c318..05da99a5 100644 --- a/src/mango.c +++ b/src/mango.c @@ -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); }