rvaiya / warpd

A modal keyboard-driven virtual pointer
MIT License
2.85k stars 126 forks source link

On sway (wayland), warpd sometimes hangs in `discover_pointer_location` #293

Open dylanfprice opened 2 months ago

dylanfprice commented 2 months ago

Issue

After using warpd for a while, any attempt to start warpd will cause warpd to hang in I believe the discover_pointer_location function.

Observed behavior is that I start warpd and the mouse moves a tiny bit, but no red dot is drawn and the keyboard is not captured by warpd. Wish I could share a video but my screen capture is also having issues right now :)

It seems to me that this behavior usually starts after doing some dragging operations in a previous warpd process, but that is a complete hunch and not verified.

Setup

$ warpd -v
warpd v1.3.5 (built from: 01650ea)

$ sway -v
sway version 1.9

I have no warpd config. I have one monitor plugged into my laptop (lid closed and laptop monitor disabled via sway).

Debug output of warpd during repro

$ WAYLAND_DEBUG=1 warpd --normal
[3117164.660]  -> wl_display@1.get_registry(new id wl_registry@2)
[3117164.806] wl_registry@2.global(1, "wl_shm", 1)
[3117164.817]  -> wl_registry@2.bind(1, "wl_shm", 1, new id [unknown]@3)
[3117164.820] wl_registry@2.global(2, "wl_drm", 2)
[3117164.823] wl_registry@2.global(3, "zwp_linux_dmabuf_v1", 4)
[3117164.824] wl_registry@2.global(4, "wl_compositor", 6)
[3117164.826]  -> wl_registry@2.bind(4, "wl_compositor", 4, new id [unknown]@4)
[3117164.831] wl_registry@2.global(5, "wl_subcompositor", 1)
[3117164.833] wl_registry@2.global(6, "wl_data_device_manager", 3)
[3117164.834] wl_registry@2.global(7, "zwlr_gamma_control_manager_v1", 1)
[3117164.836] wl_registry@2.global(8, "zxdg_output_manager_v1", 3)
[3117164.838]  -> wl_registry@2.bind(8, "zxdg_output_manager_v1", 3, new id [unknown]@5)
[3117164.842] wl_registry@2.global(9, "ext_idle_notifier_v1", 1)
[3117164.844] wl_registry@2.global(10, "zwp_idle_inhibit_manager_v1", 1)
[3117164.848] wl_registry@2.global(11, "zwlr_layer_shell_v1", 4)
[3117164.850]  -> wl_registry@2.bind(11, "zwlr_layer_shell_v1", 2, new id [unknown]@6)
[3117164.854] wl_registry@2.global(12, "xdg_wm_base", 2)
[3117164.855] wl_registry@2.global(13, "zwp_tablet_manager_v2", 1)
[3117164.859] wl_registry@2.global(14, "org_kde_kwin_server_decoration_manager", 1)
[3117164.861] wl_registry@2.global(15, "zxdg_decoration_manager_v1", 1)
[3117164.864] wl_registry@2.global(16, "zwp_relative_pointer_manager_v1", 1)
[3117164.865] wl_registry@2.global(17, "zwp_pointer_constraints_v1", 1)
[3117164.868] wl_registry@2.global(18, "wp_presentation", 1)
[3117164.870] wl_registry@2.global(19, "zwlr_output_manager_v1", 4)
[3117164.872] wl_registry@2.global(20, "zwlr_output_power_manager_v1", 1)
[3117164.874] wl_registry@2.global(21, "zwp_input_method_manager_v2", 1)
[3117164.879] wl_registry@2.global(22, "zwp_text_input_manager_v3", 1)
[3117164.882] wl_registry@2.global(23, "zwlr_foreign_toplevel_manager_v1", 3)
[3117164.884] wl_registry@2.global(24, "ext_session_lock_manager_v1", 1)
[3117164.887] wl_registry@2.global(25, "wp_drm_lease_device_v1", 1)
[3117164.889] wl_registry@2.global(26, "zwlr_export_dmabuf_manager_v1", 1)
[3117164.891] wl_registry@2.global(27, "zwlr_screencopy_manager_v1", 3)
[3117164.893] wl_registry@2.global(28, "zwlr_data_control_manager_v1", 2)
[3117164.895] wl_registry@2.global(29, "wp_security_context_manager_v1", 1)
[3117164.899] wl_registry@2.global(30, "wp_viewporter", 1)
[3117164.901] wl_registry@2.global(31, "wp_single_pixel_buffer_manager_v1", 1)
[3117164.903] wl_registry@2.global(32, "wp_content_type_manager_v1", 1)
[3117164.905] wl_registry@2.global(33, "wp_fractional_scale_manager_v1", 1)
[3117164.907] wl_registry@2.global(34, "zxdg_exporter_v1", 1)
[3117164.910] wl_registry@2.global(35, "zxdg_importer_v1", 1)
[3117164.911] wl_registry@2.global(36, "zxdg_exporter_v2", 1)
[3117164.913] wl_registry@2.global(37, "zxdg_importer_v2", 1)
[3117164.915] wl_registry@2.global(38, "xdg_activation_v1", 1)
[3117164.918] wl_registry@2.global(39, "wp_cursor_shape_manager_v1", 1)
[3117164.920] wl_registry@2.global(40, "zwp_virtual_keyboard_manager_v1", 1)
[3117164.922] wl_registry@2.global(41, "zwlr_virtual_pointer_manager_v1", 2)
[3117164.924]  -> wl_registry@2.bind(41, "zwlr_virtual_pointer_manager_v1", 1, new id [unknown]@7)
[3117164.928]  -> zwlr_virtual_pointer_manager_v1@7.create_virtual_pointer(nil, new id zwlr_virtual_pointe
r_v1@8)
[3117164.933] wl_registry@2.global(42, "zwlr_input_inhibit_manager_v1", 1)
[3117164.935] wl_registry@2.global(43, "zwp_keyboard_shortcuts_inhibit_manager_v1", 1)
[3117164.937] wl_registry@2.global(44, "zwp_pointer_gestures_v1", 3)
[3117164.940] wl_registry@2.global(45, "wl_seat", 8)
[3117164.942]  -> wl_registry@2.bind(45, "wl_seat", 7, new id [unknown]@9)
[3117164.945]  -> wl_seat@9.get_keyboard(new id wl_keyboard@10)
[3117164.947] wl_registry@2.global(47, "zwp_primary_selection_device_manager_v1", 1)
[3117164.949] wl_registry@2.global(49, "wl_output", 4)
[3117164.951]  -> wl_registry@2.bind(49, "wl_output", 3, new id [unknown]@11)
[3117164.954]  -> zxdg_output_manager_v1@5.get_xdg_output(new id zxdg_output_v1@12, wl_output@11)
[3117165.272] wl_keyboard@10.keymap(1, fd 4, 64830)
[3117166.709] wl_keyboard@10.repeat_info(25, 600)
[3117166.715] zxdg_output_v1@12.name("HDMI-A-1")
[3117166.717] zxdg_output_v1@12.description("Dell Inc. DELL U2414H TVGN077A03JL (HDMI-A-1)")
[3117166.719] zxdg_output_v1@12.logical_position(0, 0)
[3117166.721] zxdg_output_v1@12.logical_size(1920, 1080)
[3117167.838]  -> wl_shm@3.create_pool(new id wl_shm_pool@13, fd 6, 8302080)
[3117167.877]  -> wl_seat@9.get_pointer(new id wl_pointer@14)
[3117167.882]  -> wl_shm_pool@13.create_buffer(new id wl_buffer@15, 0, 1920, 1080, 7680, 0)
[3117167.886]  -> wl_compositor@4.create_surface(new id wl_surface@16)
[3117167.890]  -> zwlr_layer_shell_v1@6.get_layer_surface(new id zwlr_layer_surface_v1@17, wl_surface@16, 
wl_output@11, 3, "warpd")
[3117167.894]  -> zwlr_layer_surface_v1@17.set_size(10, 10)
[3117167.896]  -> zwlr_layer_surface_v1@17.set_anchor(5)
[3117167.898]  -> zwlr_layer_surface_v1@17.set_margin(0, 0, 0, 0)
[3117167.901]  -> zwlr_layer_surface_v1@17.set_exclusive_zone(-1)
[3117167.904]  -> wl_surface@16.commit()
[3117167.916]  -> zwlr_virtual_pointer_v1@8.motion(0, 1.00000000, 1.00000000)
[3117168.176] zwlr_layer_surface_v1@17.configure(8724, 10, 10)
[3117168.182]  -> zwlr_layer_surface_v1@17.ack_configure(8724)
[3117168.185]  -> wl_surface@16.attach(wl_buffer@15, 0, 0)
[3117168.187]  -> wl_surface@16.commit()
[3117168.191] zwlr_layer_surface_v1@17.configure(8727, 10, 10)
[3117168.193]  -> zwlr_layer_surface_v1@17.ack_configure(8727)
[3117168.195]  -> wl_surface@16.attach(wl_buffer@15, 0, 0)
[3117168.197]  -> wl_surface@16.commit()
[3117168.200]  -> zwlr_virtual_pointer_v1@8.motion(0, 1.00000000, 1.00000000)
[3117186.539] zwlr_layer_surface_v1@17.configure(8730, 10, 10)
[3117186.554]  -> zwlr_layer_surface_v1@17.ack_configure(8730)
[3117186.561]  -> wl_surface@16.attach(wl_buffer@15, 0, 0)
[3117186.566]  -> wl_surface@16.commit()
[3117186.571]  -> zwlr_virtual_pointer_v1@8.motion(0, 1.00000000, 1.00000000)
[3117186.767]  -> zwlr_virtual_pointer_v1@8.motion(0, 1.00000000, 1.00000000)

****** warpd hangs here

Sway logs at same time

00:10:00.943 [DEBUG] [wlr] [types/wlr_text_input_v3.c:185] Text input commit received without focus
00:10:00.943 [DEBUG] [sway/input/text_input.c:159] Text input committed update
00:10:00.943 [INFO] [sway/input/text_input.c:161] Text input committed, but input method is gone
00:10:01.557 [DEBUG] [wlr] [types/wlr_text_input_v3.c:185] Text input commit received without focus
00:10:01.558 [DEBUG] [sway/input/text_input.c:159] Text input committed update
00:10:01.558 [INFO] [sway/input/text_input.c:161] Text input committed, but input method is gone
00:10:02.493 [DEBUG] [wlr] [types/wlr_text_input_v3.c:185] Text input commit received without focus
00:10:02.493 [DEBUG] [sway/input/text_input.c:159] Text input committed update
00:10:02.494 [INFO] [sway/input/text_input.c:161] Text input committed, but input method is gone
00:10:03.089 [DEBUG] [wlr] [types/wlr_text_input_v3.c:185] Text input commit received without focus
00:10:03.089 [DEBUG] [sway/input/text_input.c:159] Text input committed update
00:10:03.089 [INFO] [sway/input/text_input.c:161] Text input committed, but input method is gone
00:10:04.997 [DEBUG] [wlr] [types/wlr_xdg_activation_v1.c:47] Activation token 'a07caeba45e972f2b8fc45be003f4f21' has expired
00:10:06.594 [DEBUG] [sway/input/input-manager.c:443] adding virtual pointer: '0:0:wlr_virtual_pointer_v1'
00:10:06.594 [DEBUG] [sway/input/seat.c:974] adding device 0:0:wlr_virtual_pointer_v1 to seat seat0
00:10:06.594 [DEBUG] [sway/input/seat.c:722] Applying input mapping to 0:0:wlr_virtual_pointer_v1
00:10:06.597 [DEBUG] [wlr] [types/wlr_compositor.c:692] New wlr_surface 0x557134542c50 (res 0x55713454c080)
00:10:06.597 [DEBUG] [wlr] [types/wlr_layer_shell_v1.c:460] new layer_surface 0x557134530140 (res 0x557133f5b640)
00:10:06.597 [DEBUG] [sway/desktop/layer_shell.c:646] new layer surface: namespace warpd layer 3 anchor 5 size 10x10 margin 0,0,0,0,
00:10:06.701 [DEBUG] [wlr] [types/wlr_text_input_v3.c:185] Text input commit received without focus
00:10:06.701 [DEBUG] [sway/input/text_input.c:159] Text input committed update
00:10:06.701 [INFO] [sway/input/text_input.c:161] Text input committed, but input method is gone
00:10:12.805 [DEBUG] [wlr] [types/wlr_xdg_activation_v1.c:47] Activation token '20b76470f3af0613e9551bf4092f1dfd' has expired

****** warpd is hanging here