mirror of
https://github.com/labwc/labwc.git
synced 2026-03-15 05:33:53 -04:00
cursor: reload cursor on Reconfigure
This gives instant feedback when changing cursor theme or size. It only works for server side cursors or clients using the cursor-shape protocol. Fixes: #1619
This commit is contained in:
parent
4b6efb7307
commit
8d4f295440
3 changed files with 11 additions and 3 deletions
|
|
@ -119,7 +119,7 @@ void cursor_update_focus(struct server *server);
|
||||||
void cursor_update_image(struct seat *seat);
|
void cursor_update_image(struct seat *seat);
|
||||||
|
|
||||||
void cursor_init(struct seat *seat);
|
void cursor_init(struct seat *seat);
|
||||||
void cursor_load(struct seat *seat);
|
void cursor_reload(struct seat *seat);
|
||||||
void cursor_emulate_move_absolute(struct seat *seat,
|
void cursor_emulate_move_absolute(struct seat *seat,
|
||||||
struct wlr_input_device *device,
|
struct wlr_input_device *device,
|
||||||
double x, double y, uint32_t time_msec);
|
double x, double y, uint32_t time_msec);
|
||||||
|
|
|
||||||
|
|
@ -299,6 +299,7 @@ cursor_update_image(struct seat *seat)
|
||||||
*/
|
*/
|
||||||
if (seat->seat->pointer_state.focused_surface) {
|
if (seat->seat->pointer_state.focused_surface) {
|
||||||
seat->server_cursor = LAB_CURSOR_DEFAULT;
|
seat->server_cursor = LAB_CURSOR_DEFAULT;
|
||||||
|
wlr_cursor_set_xcursor(seat->cursor, seat->xcursor_manager, "");
|
||||||
cursor_update_focus(seat->server);
|
cursor_update_focus(seat->server);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|
@ -1254,7 +1255,7 @@ cursor_frame(struct wl_listener *listener, void *data)
|
||||||
wlr_seat_pointer_notify_frame(seat->seat);
|
wlr_seat_pointer_notify_frame(seat->seat);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
cursor_load(struct seat *seat)
|
cursor_load(struct seat *seat)
|
||||||
{
|
{
|
||||||
const char *xcursor_theme = getenv("XCURSOR_THEME");
|
const char *xcursor_theme = getenv("XCURSOR_THEME");
|
||||||
|
|
@ -1300,6 +1301,13 @@ cursor_load(struct seat *seat)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
cursor_reload(struct seat *seat)
|
||||||
|
{
|
||||||
|
cursor_load(seat);
|
||||||
|
cursor_update_image(seat);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
cursor_init(struct seat *seat)
|
cursor_init(struct seat *seat)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -587,7 +587,7 @@ seat_reconfigure(struct server *server)
|
||||||
{
|
{
|
||||||
struct seat *seat = &server->seat;
|
struct seat *seat = &server->seat;
|
||||||
struct input *input;
|
struct input *input;
|
||||||
cursor_load(seat);
|
cursor_reload(seat);
|
||||||
overlay_reconfigure(seat);
|
overlay_reconfigure(seat);
|
||||||
wl_list_for_each(input, &seat->inputs, link) {
|
wl_list_for_each(input, &seat->inputs, link) {
|
||||||
switch (input->wlr_input_device->type) {
|
switch (input->wlr_input_device->type) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue