]> git.mdlowis.com Git - proto/labwc.git/commitdiff
Short term solution to prevent segfaulting on TTY switch. See #206.
authorConsolatis <35009135+Consolatis@users.noreply.github.com>
Mon, 17 Jan 2022 22:02:59 +0000 (23:02 +0100)
committerJohan Malm <johanmalm@users.noreply.github.com>
Tue, 18 Jan 2022 06:06:12 +0000 (06:06 +0000)
This will still prevent touchscreens or other absolute pointers to
function correctly after switching the TTY when using a multi
screen setup. But that is still better than segfaulting.

src/seat.c

index c27551ec5c109841bc8e3e7b2b870c84fe6abe43..1f3d5d2ac11f725c709c2008cd3d36ffd3ecede6 100644 (file)
@@ -134,11 +134,13 @@ new_pointer(struct seat *seat, struct input *input)
        wlr_cursor_attach_input_device(seat->cursor, dev);
 
        /* In support of running with WLR_WL_OUTPUTS set to >=2 */
-       wlr_log(WLR_INFO, "map pointer to output %s\n", dev->output_name);
-       struct wlr_output *output =
-               output_by_name(seat->server, dev->output_name);
-       wlr_cursor_map_input_to_output(seat->cursor, dev, output);
-       wlr_cursor_map_input_to_region(seat->cursor, dev, NULL);
+       if (dev->output_name) {
+               wlr_log(WLR_INFO, "map pointer to output %s\n", dev->output_name);
+               struct wlr_output *output =
+                       output_by_name(seat->server, dev->output_name);
+               wlr_cursor_map_input_to_output(seat->cursor, dev, output);
+               wlr_cursor_map_input_to_region(seat->cursor, dev, NULL);
+       }
 }
 
 void