]> git.mdlowis.com Git - proto/labwc.git/commitdiff
Fix graphical artifacts after adding/removing outputs
authorJohn Lindgren <john@jlindgren.net>
Sat, 27 Nov 2021 21:47:49 +0000 (16:47 -0500)
committerJohan Malm <johanmalm@users.noreply.github.com>
Sun, 28 Nov 2021 08:32:45 +0000 (08:32 +0000)
When an output is added or removed, the position of the other
outputs can also change, resulting in windows moving between them.
We need to redraw all the outputs (not just the new one) to prevent
stale/corrupted screen contents.

src/output.c

index c2381988a724361d2d683d292e746ce48db9daad..1062f9b6604d4e5d3403833ab478219a87a3a9d9 100644 (file)
@@ -936,6 +936,9 @@ output_destroy_notify(struct wl_listener *listener, void *data)
        struct output *output = wl_container_of(listener, output, destroy);
        wl_list_remove(&output->link);
        wl_list_remove(&output->destroy.link);
+
+       /* Windows may have moved; redraw all outputs */
+       damage_all_outputs(output->server);
 }
 
 static void
@@ -1036,7 +1039,8 @@ new_output_notify(struct wl_listener *listener, void *data)
        wlr_xcursor_manager_set_cursor_image(server->seat.xcursor_manager,
                XCURSOR_DEFAULT, server->seat.cursor);
 
-       wlr_output_schedule_frame(wlr_output);
+       /* Windows may have moved; redraw all outputs */
+       damage_all_outputs(server);
 }
 
 void