fix cursor issue

This commit is contained in:
Tony Crisci 2018-01-21 18:32:06 -05:00
parent 4183271475
commit 54776dd19c
1 changed files with 10 additions and 2 deletions

View File

@ -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;
}