mirror of
https://github.com/swaywm/sway.git
synced 2024-12-28 16:06:37 +01:00
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
This commit is contained in:
parent
5c99b98805
commit
f7a40cfa2f
1 changed files with 19 additions and 20 deletions
|
@ -803,9 +803,7 @@ static void seat_apply_input_mapping(struct sway_seat *seat,
|
||||||
|
|
||||||
static void seat_configure_pointer(struct sway_seat *seat,
|
static void seat_configure_pointer(struct sway_seat *seat,
|
||||||
struct sway_seat_device *sway_device) {
|
struct sway_seat_device *sway_device) {
|
||||||
if ((seat->wlr_seat->capabilities & WL_SEAT_CAPABILITY_POINTER) == 0) {
|
seat_configure_xcursor(seat);
|
||||||
seat_configure_xcursor(seat);
|
|
||||||
}
|
|
||||||
wlr_cursor_attach_input_device(seat->cursor->cursor,
|
wlr_cursor_attach_input_device(seat->cursor->cursor,
|
||||||
sway_device->input_device->wlr_device);
|
sway_device->input_device->wlr_device);
|
||||||
wl_event_source_timer_update(
|
wl_event_source_timer_update(
|
||||||
|
@ -1069,26 +1067,27 @@ void seat_configure_xcursor(struct sway_seat *seat) {
|
||||||
sway_log(SWAY_ERROR,
|
sway_log(SWAY_ERROR,
|
||||||
"Cannot create XCursor manager for theme '%s'", cursor_theme);
|
"Cannot create XCursor manager for theme '%s'", cursor_theme);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
for (int i = 0; i < root->outputs->length; ++i) {
|
|
||||||
struct sway_output *sway_output = root->outputs->items[i];
|
for (int i = 0; i < root->outputs->length; ++i) {
|
||||||
struct wlr_output *output = sway_output->wlr_output;
|
struct sway_output *sway_output = root->outputs->items[i];
|
||||||
bool result =
|
struct wlr_output *output = sway_output->wlr_output;
|
||||||
wlr_xcursor_manager_load(seat->cursor->xcursor_manager,
|
bool result =
|
||||||
output->scale);
|
wlr_xcursor_manager_load(seat->cursor->xcursor_manager,
|
||||||
if (!result) {
|
output->scale);
|
||||||
sway_log(SWAY_ERROR,
|
if (!result) {
|
||||||
"Cannot load xcursor theme for output '%s' with scale %f",
|
sway_log(SWAY_ERROR,
|
||||||
output->name, output->scale);
|
"Cannot load xcursor theme for output '%s' with scale %f",
|
||||||
|
output->name, output->scale);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Reset the cursor so that we apply it to outputs that just appeared
|
// Reset the cursor so that we apply it to outputs that just appeared
|
||||||
cursor_set_image(seat->cursor, NULL, NULL);
|
cursor_set_image(seat->cursor, NULL, NULL);
|
||||||
cursor_set_image(seat->cursor, "default", NULL);
|
cursor_set_image(seat->cursor, "default", NULL);
|
||||||
wlr_cursor_warp(seat->cursor->cursor, NULL, seat->cursor->cursor->x,
|
wlr_cursor_warp(seat->cursor->cursor, NULL, seat->cursor->cursor->x,
|
||||||
seat->cursor->cursor->y);
|
seat->cursor->cursor->y);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool seat_is_input_allowed(struct sway_seat *seat,
|
bool seat_is_input_allowed(struct sway_seat *seat,
|
||||||
|
|
Loading…
Reference in a new issue