mirror of
https://github.com/cage-kiosk/cage.git
synced 2026-02-25 01:41:06 -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
15
seat.c
15
seat.c
|
|
@ -20,7 +20,6 @@
|
|||
#include "server.h"
|
||||
#include "view.h"
|
||||
|
||||
#define DEFAULT_XCURSOR "left_ptr"
|
||||
#define XCURSOR_SIZE 24
|
||||
|
||||
static inline bool
|
||||
|
|
@ -452,20 +451,6 @@ cg_seat_create(struct cg_server *server)
|
|||
}
|
||||
}
|
||||
|
||||
float scale = 1.f; // TODO: segault because server->output->wlr_output->scale does not exist yet;
|
||||
if (wlr_xcursor_manager_load(seat->xcursor_manager, scale)) {
|
||||
wlr_log(WLR_ERROR, "Cannot load XCursor theme for output '%s' with scale %f",
|
||||
server->output->wlr_output->name,
|
||||
server->output->wlr_output->scale);
|
||||
}
|
||||
|
||||
wlr_xcursor_manager_set_cursor_image(seat->xcursor_manager, DEFAULT_XCURSOR, seat->cursor);
|
||||
|
||||
// TODO: warp to the center?
|
||||
/* /\* Place the cursor in the center of the screen and make it visible. *\/ */
|
||||
/* wlr_cursor_warp_absolute(seat->cursor, NULL, .5, .5); */
|
||||
wlr_cursor_warp(seat->cursor, NULL, seat->cursor->x, seat->cursor->y);
|
||||
|
||||
seat->cursor_motion.notify = handle_cursor_motion;
|
||||
wl_signal_add(&seat->cursor->events.motion, &seat->cursor_motion);
|
||||
seat->cursor_motion_absolute.notify = handle_cursor_motion_absolute;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue