mirror of
https://github.com/cage-kiosk/cage.git
synced 2026-02-15 22:05:37 -05:00
Move xcursor theme loading and cursor warping to output
Since this is inherently output independent, we can move this to here and avoid the inexistance of an output we ran into in the previous commit. Warping the cursor is no problem here either: since we restrict ourselves to a single output, there won't be any confusing UX by having the cursor jump from one output to the newly attached one.
This commit is contained in:
parent
2cf40f7a9b
commit
fd4ff669dd
3 changed files with 13 additions and 15 deletions
11
output.c
11
output.c
|
|
@ -163,4 +163,15 @@ handle_new_output(struct wl_listener *listener, void *data)
|
|||
|
||||
/* Disconnect the signal now, because we only use one static output. */
|
||||
wl_list_remove(&server->new_output.link);
|
||||
|
||||
if (wlr_xcursor_manager_load(server->seat->xcursor_manager, wlr_output->scale)) {
|
||||
wlr_log(WLR_ERROR, "Cannot load XCursor theme for output '%s' with scale %f",
|
||||
wlr_output->name,
|
||||
wlr_output->scale);
|
||||
}
|
||||
wlr_xcursor_manager_set_cursor_image(server->seat->xcursor_manager, DEFAULT_XCURSOR,
|
||||
server->seat->cursor);
|
||||
|
||||
/* Place the cursor in the center of the screen. */
|
||||
wlr_cursor_warp(server->seat->cursor, NULL, wlr_output->width / 2, wlr_output->height / 2);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue