Bugfix: Fix warping of cursor when only switching screen, not workspace
This commit is contained in:
parent
7133974306
commit
b7e8a63474
|
@ -501,8 +501,13 @@ void show_workspace(xcb_connection_t *conn, int workspace) {
|
||||||
|
|
||||||
/* Check if we need to change something or if we’re already there */
|
/* Check if we need to change something or if we’re already there */
|
||||||
if (c_ws->screen->current_workspace == (workspace-1)) {
|
if (c_ws->screen->current_workspace == (workspace-1)) {
|
||||||
if (CUR_CELL->currently_focused != NULL)
|
if (CUR_CELL->currently_focused != NULL) {
|
||||||
set_focus(conn, CUR_CELL->currently_focused, true);
|
set_focus(conn, CUR_CELL->currently_focused, true);
|
||||||
|
if (need_warp) {
|
||||||
|
warp_pointer_into(conn, CUR_CELL->currently_focused);
|
||||||
|
xcb_flush(conn);
|
||||||
|
}
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -555,8 +560,10 @@ void show_workspace(xcb_connection_t *conn, int workspace) {
|
||||||
/* Restore focus on the new workspace */
|
/* Restore focus on the new workspace */
|
||||||
if (CUR_CELL->currently_focused != NULL) {
|
if (CUR_CELL->currently_focused != NULL) {
|
||||||
set_focus(conn, CUR_CELL->currently_focused, true);
|
set_focus(conn, CUR_CELL->currently_focused, true);
|
||||||
if (need_warp)
|
if (need_warp) {
|
||||||
warp_pointer_into(conn, CUR_CELL->currently_focused);
|
warp_pointer_into(conn, CUR_CELL->currently_focused);
|
||||||
|
xcb_flush(conn);
|
||||||
|
}
|
||||||
} else xcb_set_input_focus(conn, XCB_INPUT_FOCUS_POINTER_ROOT, root, XCB_CURRENT_TIME);
|
} else xcb_set_input_focus(conn, XCB_INPUT_FOCUS_POINTER_ROOT, root, XCB_CURRENT_TIME);
|
||||||
|
|
||||||
//xcb_ungrab_server(conn);
|
//xcb_ungrab_server(conn);
|
||||||
|
|
Loading…
Reference in New Issue