aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Lina Banik <l.banik@stud.uni-hannover.de>2022-06-06 17:16:29 +0200
committerLibravatar Simon Ser <contact@emersion.fr>2023-11-21 11:35:49 +0100
commitf7a40cfa2fd89d41afd596e7bbfbdd66a4a0e4da (patch)
tree8b5ac4ac2e2effac14e3c23e511aae13087704ed
parentinput/input-manager: drop input_manager_configure_all_inputs (diff)
downloadsway-f7a40cfa2fd89d41afd596e7bbfbdd66a4a0e4da.tar.gz
sway-f7a40cfa2fd89d41afd596e7bbfbdd66a4a0e4da.tar.zst
sway-f7a40cfa2fd89d41afd596e7bbfbdd66a4a0e4da.zip
seat: Fix reloading cursor theme after change
This reverts commit afde6369 "seat: avoid unneeded reloading xcursor theme". Always avoiding to reload the xcursor theme prevents reloading the cursor even when this is desired. Instead seat_configure_xcursor can determine whether a full reload is necessary. To stay with the spirit of the reverted change, cursors are only fully reloaded, if the theme has changed. Fixes #6931
-rw-r--r--sway/input/seat.c39
1 files changed, 19 insertions, 20 deletions
diff --git a/sway/input/seat.c b/sway/input/seat.c
index f73946b1..0fd0e8e6 100644
--- a/sway/input/seat.c
+++ b/sway/input/seat.c
@@ -803,9 +803,7 @@ static void seat_apply_input_mapping(struct sway_seat *seat,
803 803
804static void seat_configure_pointer(struct sway_seat *seat, 804static void seat_configure_pointer(struct sway_seat *seat,
805 struct sway_seat_device *sway_device) { 805 struct sway_seat_device *sway_device) {
806 if ((seat->wlr_seat->capabilities & WL_SEAT_CAPABILITY_POINTER) == 0) { 806 seat_configure_xcursor(seat);
807 seat_configure_xcursor(seat);
808 }
809 wlr_cursor_attach_input_device(seat->cursor->cursor, 807 wlr_cursor_attach_input_device(seat->cursor->cursor,
810 sway_device->input_device->wlr_device); 808 sway_device->input_device->wlr_device);
811 wl_event_source_timer_update( 809 wl_event_source_timer_update(
@@ -1069,26 +1067,27 @@ void seat_configure_xcursor(struct sway_seat *seat) {
1069 sway_log(SWAY_ERROR, 1067 sway_log(SWAY_ERROR,
1070 "Cannot create XCursor manager for theme '%s'", cursor_theme); 1068 "Cannot create XCursor manager for theme '%s'", cursor_theme);
1071 } 1069 }
1072 }
1073 1070
1074 for (int i = 0; i < root->outputs->length; ++i) { 1071
1075 struct sway_output *sway_output = root->outputs->items[i]; 1072 for (int i = 0; i < root->outputs->length; ++i) {
1076 struct wlr_output *output = sway_output->wlr_output; 1073 struct sway_output *sway_output = root->outputs->items[i];
1077 bool result = 1074 struct wlr_output *output = sway_output->wlr_output;
1078 wlr_xcursor_manager_load(seat->cursor->xcursor_manager, 1075 bool result =
1079 output->scale); 1076 wlr_xcursor_manager_load(seat->cursor->xcursor_manager,
1080 if (!result) { 1077 output->scale);
1081 sway_log(SWAY_ERROR, 1078 if (!result) {
1082 "Cannot load xcursor theme for output '%s' with scale %f", 1079 sway_log(SWAY_ERROR,
1083 output->name, output->scale); 1080 "Cannot load xcursor theme for output '%s' with scale %f",
1081 output->name, output->scale);
1082 }
1084 } 1083 }
1085 }
1086 1084
1087 // Reset the cursor so that we apply it to outputs that just appeared 1085 // Reset the cursor so that we apply it to outputs that just appeared
1088 cursor_set_image(seat->cursor, NULL, NULL); 1086 cursor_set_image(seat->cursor, NULL, NULL);
1089 cursor_set_image(seat->cursor, "default", NULL); 1087 cursor_set_image(seat->cursor, "default", NULL);
1090 wlr_cursor_warp(seat->cursor->cursor, NULL, seat->cursor->cursor->x, 1088 wlr_cursor_warp(seat->cursor->cursor, NULL, seat->cursor->cursor->x,
1091 seat->cursor->cursor->y); 1089 seat->cursor->cursor->y);
1090 }
1092} 1091}
1093 1092
1094bool seat_is_input_allowed(struct sway_seat *seat, 1093bool seat_is_input_allowed(struct sway_seat *seat,