]> git.mdlowis.com Git - proto/labwc.git/commitdiff
Fix invisible cursor at startup
authorJohn Lindgren <john@jlindgren.net>
Sat, 27 Nov 2021 18:48:48 +0000 (13:48 -0500)
committerARDiDo <90479315+ARDiDo@users.noreply.github.com>
Sat, 27 Nov 2021 19:31:23 +0000 (14:31 -0500)
src/output.c

index f7cfa944977e4d63e2acaae51c3b43bb11f1aec4..c2381988a724361d2d683d292e746ce48db9daad 100644 (file)
@@ -1022,6 +1022,20 @@ new_output_notify(struct wl_listener *listener, void *data)
                wlr_output_enable_adaptive_sync(wlr_output, true);
        }
        wlr_output_layout_add_auto(server->output_layout, wlr_output);
+
+       /*
+        * Output positions may have changed, so make sure that each
+        * wlr_output_cursor is "moved" (in per-output coordinates) to
+        * align with the seat cursor.  Set a default cursor image so
+        * that the cursor isn't invisible on the new output.
+        *
+        * TODO: remember the most recent cursor image (see cursor.c)
+        * and set that rather than XCURSOR_DEFAULT
+        */
+       wlr_cursor_move(server->seat.cursor, NULL, 0, 0);
+       wlr_xcursor_manager_set_cursor_image(server->seat.xcursor_manager,
+               XCURSOR_DEFAULT, server->seat.cursor);
+
        wlr_output_schedule_frame(wlr_output);
 }