mirror of
https://github.com/cage-kiosk/cage.git
synced 2025-10-29 05:40:19 -04:00
cage: center cursor only on initial startup
With Cage now supporting hotplugging of outputs, we shouldn't warp the cursor to the center of every new output. Rather, we should warp it only on the initial startup.
This commit is contained in:
parent
e3f9959519
commit
cc1f975c44
2 changed files with 6 additions and 4 deletions
4
cage.c
4
cage.c
|
|
@ -397,6 +397,10 @@ main(int argc, char *argv[])
|
|||
goto end;
|
||||
}
|
||||
|
||||
/* Place the cursor in the center of the output layout. */
|
||||
struct wlr_box *layout_box = wlr_output_layout_get_box(server.output_layout, NULL);
|
||||
wlr_cursor_warp(server.seat->cursor, NULL, layout_box->width / 2, layout_box->height / 2);
|
||||
|
||||
wl_display_run(server.wl_display);
|
||||
|
||||
#if CAGE_HAS_XWAYLAND
|
||||
|
|
|
|||
6
output.c
6
output.c
|
|
@ -365,12 +365,10 @@ handle_new_output(struct wl_listener *listener, void *data)
|
|||
wlr_output->scale);
|
||||
}
|
||||
|
||||
/* Place the cursor in the center of the screen. */
|
||||
wlr_cursor_warp(server->seat->cursor, NULL, wlr_output->width / 2, wlr_output->height / 2);
|
||||
wlr_output_damage_add_whole(output->damage);
|
||||
|
||||
wlr_output_enable(wlr_output, true);
|
||||
wlr_output_commit(wlr_output);
|
||||
|
||||
wlr_output_damage_add_whole(output->damage);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue