aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2023-06-01 17:31:37 +0200
committerAlexander Orzechowski <alex@ozal.ski>2023-06-02 16:27:54 +0000
commit9c9e3f626350fa67405317d60b5dfdb828486b63 (patch)
treeb129745cb09e9fbf40229073cc90a3f58b2fa003
parent75d03f2b68a7c7a2739cb20b16f12d4a291eef28 (diff)
cursor: ignore wlr_cursor_set_surface() with same surface
Avoids damaging the output and rendering the cursor again if it hasn't changed.
-rw-r--r--types/wlr_cursor.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/types/wlr_cursor.c b/types/wlr_cursor.c
index fb267402..867e7d90 100644
--- a/types/wlr_cursor.c
+++ b/types/wlr_cursor.c
@@ -462,6 +462,10 @@ void wlr_cursor_set_surface(struct wlr_cursor *cur, struct wlr_surface *surface,
struct wlr_cursor_output_cursor *output_cursor;
wl_list_for_each(output_cursor, &cur->state->output_cursors, link) {
+ if (surface == output_cursor->surface) {
+ continue;
+ }
+
cursor_output_cursor_reset_image(output_cursor);
output_cursor->surface = surface;