mirror of
https://github.com/labwc/labwc.git
synced 2025-11-03 09:01:51 -05:00
desktop: harden window stacking order while window switching
This commit moves the check against server->input_mode from the callers of desktop_focus_view() into desktop_focus_view() itself. This eliminates code duplications and makes it harder to mess up the window stacking order while window switching. I also added the same check in view_minimize() so that minimize requests from panels never messes up the window stacking order (I think only this should be described in the release note).
This commit is contained in:
parent
cf759ec183
commit
270b45da88
6 changed files with 13 additions and 25 deletions
|
|
@ -599,9 +599,7 @@ cursor_process_motion(struct server *server, uint32_t time, double *sx, double *
|
|||
dnd_icons_move(seat, seat->cursor->x, seat->cursor->y);
|
||||
}
|
||||
|
||||
if ((ctx.view || ctx.surface) && rc.focus_follow_mouse
|
||||
&& server->input_mode
|
||||
!= LAB_INPUT_STATE_WINDOW_SWITCHER) {
|
||||
if ((ctx.view || ctx.surface) && rc.focus_follow_mouse) {
|
||||
desktop_focus_view_or_surface(seat, ctx.view, ctx.surface,
|
||||
rc.raise_on_focus);
|
||||
}
|
||||
|
|
@ -641,15 +639,10 @@ _cursor_update_focus(struct server *server)
|
|||
struct cursor_context ctx = get_cursor_context(server);
|
||||
|
||||
if ((ctx.view || ctx.surface) && rc.focus_follow_mouse
|
||||
&& !rc.focus_follow_mouse_requires_movement
|
||||
&& server->input_mode
|
||||
!= LAB_INPUT_STATE_WINDOW_SWITCHER) {
|
||||
&& !rc.focus_follow_mouse_requires_movement) {
|
||||
/*
|
||||
* Always focus the surface below the cursor when
|
||||
* followMouse=yes and followMouseRequiresMovement=no.
|
||||
*
|
||||
* We should ignore them while window-switching though, because
|
||||
* calling desktop_focus_view() un-minimizes previewed window.
|
||||
*/
|
||||
desktop_focus_view_or_surface(&server->seat, ctx.view,
|
||||
ctx.surface, rc.raise_on_focus);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue