bugfix: warp cursor to current position on output add

This commit is contained in:
Tony Crisci 2017-09-05 07:52:17 -04:00
parent 57c18c38bb
commit 6904ed8bd9
1 changed files with 4 additions and 4 deletions

View File

@ -151,15 +151,15 @@ static void handle_output_add(struct output_state *ostate) {
configure_devices(sample); configure_devices(sample);
// TODO move to wlr_cursor // TODO the cursor must be set depending on which surface it is displayed
// over which should happen in the compositor.
if (!wlr_output_set_cursor(wlr_output, image->buffer, if (!wlr_output_set_cursor(wlr_output, image->buffer,
image->width, image->width, image->height)) { image->width, image->width, image->height)) {
wlr_log(L_DEBUG, "Failed to set hardware cursor"); wlr_log(L_DEBUG, "Failed to set hardware cursor");
return; return;
} }
if (!wlr_output_move_cursor(wlr_output, 0, 0)) {
wlr_log(L_DEBUG, "Failed to move hardware cursor"); wlr_cursor_warp(sample->cursor, NULL, sample->cursor->x, sample->cursor->y);
}
} }
static void handle_output_remove(struct output_state *ostate) { static void handle_output_remove(struct output_state *ostate) {