diff options
author | emersion <contact@emersion.fr> | 2017-11-11 23:53:45 +0100 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2017-11-11 23:53:45 +0100 |
commit | 2dccb11741abd99fd71d4ccaba1ad42362d8f204 (patch) | |
tree | 83fd7ea16b0ec14c5ee0544e72a9b28d57c14d08 /rootston | |
parent | aaf069188319f42bc214f4317c37d533aea64518 (diff) |
rootston: keep one xcursor_theme per seat
Diffstat (limited to 'rootston')
-rw-r--r-- | rootston/cursor.c | 2 | ||||
-rw-r--r-- | rootston/output.c | 11 | ||||
-rw-r--r-- | rootston/seat.c | 12 |
3 files changed, 14 insertions, 11 deletions
diff --git a/rootston/cursor.c b/rootston/cursor.c index 46f4caea..0795cea6 100644 --- a/rootston/cursor.c +++ b/rootston/cursor.c @@ -44,7 +44,7 @@ static void roots_cursor_update_position(struct roots_cursor *cursor, uint32_t t set_compositor_cursor = view_client != cursor->cursor_client; } if (set_compositor_cursor) { - roots_xcursor_theme_set_default(desktop->xcursor_theme, + roots_xcursor_theme_set_default(cursor->xcursor_theme, cursor->cursor); cursor->cursor_client = NULL; } diff --git a/rootston/output.c b/rootston/output.c index 943e14c0..b35e56cd 100644 --- a/rootston/output.c +++ b/rootston/output.c @@ -241,13 +241,14 @@ void output_add_notify(struct wl_listener *listener, void *data) { wlr_output_layout_add_auto(desktop->layout, wlr_output); } - if (roots_xcursor_theme_load(desktop->xcursor_theme, wlr_output->scale)) { - wlr_log(L_ERROR, "Cannot load xcursor theme with scale %d", - wlr_output->scale); - } - struct roots_seat *seat; wl_list_for_each(seat, &input->seats, link) { + if (roots_xcursor_theme_load(seat->cursor->xcursor_theme, + wlr_output->scale)) { + wlr_log(L_ERROR, "Cannot load xcursor theme for output '%s' " + "with scale %d", wlr_output->name, wlr_output->scale); + } + roots_seat_configure_cursor(seat); roots_seat_configure_xcursor(seat); } diff --git a/rootston/seat.c b/rootston/seat.c index 376da67f..ec4e9800 100644 --- a/rootston/seat.c +++ b/rootston/seat.c @@ -186,7 +186,9 @@ static void roots_seat_init_cursor(struct roots_seat *seat) { struct roots_desktop *desktop = seat->input->server->desktop; wlr_cursor_attach_output_layout(wlr_cursor, desktop->layout); - roots_xcursor_theme_set_default(desktop->xcursor_theme, wlr_cursor); + // TODO: be able to configure per-seat cursor themes + seat->cursor->xcursor_theme = desktop->xcursor_theme; + roots_xcursor_theme_set_default(seat->cursor->xcursor_theme, wlr_cursor); wl_list_init(&seat->cursor->touch_points); @@ -444,7 +446,7 @@ void roots_seat_remove_device(struct roots_seat *seat, } void roots_seat_configure_xcursor(struct roots_seat *seat) { - roots_xcursor_theme_set_default(seat->input->server->desktop->xcursor_theme, + roots_xcursor_theme_set_default(seat->cursor->xcursor_theme, seat->cursor->cursor); wlr_cursor_warp(seat->cursor->cursor, NULL, seat->cursor->cursor->x, seat->cursor->cursor->y); @@ -522,7 +524,7 @@ void roots_seat_begin_move(struct roots_seat *seat, struct roots_view *view) { view_maximize(view, false); wlr_seat_pointer_clear_focus(seat->seat); - roots_xcursor_theme_set_move(seat->input->server->desktop->xcursor_theme, + roots_xcursor_theme_set_move(seat->cursor->xcursor_theme, seat->cursor->cursor); } @@ -549,7 +551,7 @@ void roots_seat_begin_resize(struct roots_seat *seat, struct roots_view *view, view_maximize(view, false); wlr_seat_pointer_clear_focus(seat->seat); - roots_xcursor_theme_set_resize(seat->input->server->desktop->xcursor_theme, + roots_xcursor_theme_set_resize(seat->cursor->xcursor_theme, seat->cursor->cursor, edges); } @@ -562,6 +564,6 @@ void roots_seat_begin_rotate(struct roots_seat *seat, struct roots_view *view) { view_maximize(view, false); wlr_seat_pointer_clear_focus(seat->seat); - roots_xcursor_theme_set_rotate(seat->input->server->desktop->xcursor_theme, + roots_xcursor_theme_set_rotate(seat->cursor->xcursor_theme, seat->cursor->cursor); } |