From 54776dd19c20b0d0775a9426e811f81004a9a960 Mon Sep 17 00:00:00 2001 From: Tony Crisci Date: Sun, 21 Jan 2018 18:32:06 -0500 Subject: [PATCH] fix cursor issue --- rootston/cursor.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/rootston/cursor.c b/rootston/cursor.c index 87f568a8..8f6091ee 100644 --- a/rootston/cursor.c +++ b/rootston/cursor.c @@ -74,6 +74,9 @@ static void seat_view_deco_motion(struct roots_seat_view *view, double deco_sx, } static void seat_view_deco_leave(struct roots_seat_view *view) { + struct roots_cursor *cursor = view->seat->cursor; + wlr_xcursor_manager_set_cursor_image(cursor->xcursor_manager, + cursor->default_xcursor, cursor->cursor); view->has_button_grab = false; } @@ -86,6 +89,13 @@ static void seat_view_deco_button(struct roots_seat_view *view, double sx, } else { view->has_button_grab = false; } + + enum wlr_deco_part parts = view_get_deco_part(view->view, sx, sy); + if (state == WLR_BUTTON_RELEASED && (parts & WLR_DECO_PART_TITLEBAR)) { + struct roots_cursor *cursor = view->seat->cursor; + wlr_xcursor_manager_set_cursor_image(cursor->xcursor_manager, + cursor->default_xcursor, cursor->cursor); + } } static void roots_cursor_update_position(struct roots_cursor *cursor, @@ -246,8 +256,6 @@ static void roots_cursor_press_button(struct roots_cursor *cursor, if (state == WLR_BUTTON_RELEASED && cursor->mode != ROOTS_CURSOR_PASSTHROUGH) { cursor->mode = ROOTS_CURSOR_PASSTHROUGH; - wlr_xcursor_manager_set_cursor_image(cursor->xcursor_manager, - cursor->default_xcursor, cursor->cursor); if (seat->seat->pointer_state.button_count == 0) { return; }