mirror of
https://github.com/labwc/labwc.git
synced 2026-03-20 05:34:12 -04:00
cursor: fix focus.followMouse glitches
Update focus correctly when using `<focus><followMouse>` and (a) the focused window is closed; and (b) after switching desktops using action GoToDesktop. Issue #830 Written-by: @Consolatis Reported-by: @jech
This commit is contained in:
parent
7914d06760
commit
f5c4651c67
1 changed files with 13 additions and 0 deletions
13
src/cursor.c
13
src/cursor.c
|
|
@ -508,6 +508,19 @@ cursor_update_focus(struct server *server)
|
||||||
|
|
||||||
/* Focus surface under cursor if it isn't already focused */
|
/* Focus surface under cursor if it isn't already focused */
|
||||||
struct cursor_context ctx = get_cursor_context(server);
|
struct cursor_context ctx = get_cursor_context(server);
|
||||||
|
|
||||||
|
if (ctx.view && rc.focus_follow_mouse) {
|
||||||
|
desktop_focus_and_activate_view(&server->seat, ctx.view);
|
||||||
|
if (rc.raise_on_focus) {
|
||||||
|
/*
|
||||||
|
* Call view method directly as desktop_move_to_front()
|
||||||
|
* contains a call to cursor_update_focus() and thus
|
||||||
|
* loops inifinitely
|
||||||
|
*/
|
||||||
|
ctx.view->impl->move_to_front(ctx.view);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
cursor_update_common(server, &ctx, msec(&now),
|
cursor_update_common(server, &ctx, msec(&now),
|
||||||
/*cursor_has_moved*/ false);
|
/*cursor_has_moved*/ false);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue