From ca8fa35bbc692b7f425f0f42db375fdcce9a7355 Mon Sep 17 00:00:00 2001 From: Charlotte Meyer Date: Mon, 11 Mar 2019 13:29:23 +0100 Subject: [PATCH] Fixed cursors --- kiwmi/desktop/output.c | 4 ++++ kiwmi/input/cursor.c | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/kiwmi/desktop/output.c b/kiwmi/desktop/output.c index 4ac029f..1662826 100644 --- a/kiwmi/desktop/output.c +++ b/kiwmi/desktop/output.c @@ -34,6 +34,10 @@ new_output_notify(struct wl_listener *listener, void *data) return; } + struct kiwmi_cursor *cursor = server->cursor; + + wlr_xcursor_manager_load(cursor->xcursor_manager, wlr_output->scale); + wl_list_insert(&server->outputs, &output->link); wlr_output_layout_add_auto(server->output_layout, wlr_output); diff --git a/kiwmi/input/cursor.c b/kiwmi/input/cursor.c index 515c838..0136072 100644 --- a/kiwmi/input/cursor.c +++ b/kiwmi/input/cursor.c @@ -22,6 +22,8 @@ cursor_motion_notify(struct wl_listener *listener, void *data) wl_container_of(listener, cursor, cursor_motion); struct wlr_event_pointer_motion *event = data; + wlr_xcursor_manager_set_cursor_image( + cursor->xcursor_manager, "left_ptr", cursor->cursor); wlr_cursor_move( cursor->cursor, event->device, event->delta_x, event->delta_y); } @@ -33,6 +35,8 @@ cursor_motion_absolute_notify(struct wl_listener *listener, void *data) wl_container_of(listener, cursor, cursor_motion_absolute); struct wlr_event_pointer_motion_absolute *event = data; + wlr_xcursor_manager_set_cursor_image( + cursor->xcursor_manager, "left_ptr", cursor->cursor); wlr_cursor_warp_absolute(cursor->cursor, event->device, event->x, event->y); } @@ -57,10 +61,6 @@ cursor_create(struct wlr_output_layout *output_layout) wlr_cursor_attach_output_layout(cursor->cursor, output_layout); cursor->xcursor_manager = wlr_xcursor_manager_create(NULL, 24); - wlr_xcursor_manager_load(cursor->xcursor_manager, 1); - - wlr_xcursor_manager_set_cursor_image( - cursor->xcursor_manager, "left_ptr", cursor->cursor); cursor->cursor_motion.notify = cursor_motion_notify; wl_signal_add(&cursor->cursor->events.motion, &cursor->cursor_motion);