Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Examples under Wayland "no successful connection" error #378

Open
dimparf opened this issue Jan 14, 2025 · 6 comments
Open

Examples under Wayland "no successful connection" error #378

dimparf opened this issue Jan 14, 2025 · 6 comments

Comments

@dimparf
Copy link

dimparf commented Jan 14, 2025

Describe the bug
When I run the examples with this command:
WAYLAND_DEBUG=1 RUST_LOG=debug cargo run --example keyboard --features wayland --no-default-features
I get the following log:
`[2025-01-14T04:06:55Z DEBUG enigo] using default settings
[2025-01-14T04:06:55Z DEBUG enigo::platform::wayland] trying to establish a connection to $WAYLAND_DISPLAY
[2970936.495][rs] -> [email protected]_registry(wl_registry@2)
[2970936.592][rs] -> [email protected](wl_callback@3)
[2970944.214][rs] <- [email protected], (1, Some("wl_compositor"), 6)
[2970944.298][rs] <- [email protected], (3, Some("zwp_tablet_manager_v2"), 1)
[2970944.360][rs] <- [email protected], (4, Some("zwp_keyboard_shortcuts_inhibit_manager_v1"), 1)
[2970944.438][rs] <- [email protected], (5, Some("zxdg_decoration_manager_v1"), 1)
[2970944.507][rs] <- [email protected], (6, Some("wp_viewporter"), 1)
[2970944.575][rs] <- [email protected], (7, Some("wp_security_context_manager_v1"), 1)
[2970944.629][rs] <- [email protected], (8, Some("wp_fractional_scale_manager_v1"), 1)
[2970944.706][rs] <- [email protected], (9, Some("wl_shm"), 1)
[2970944.778][rs] <- [email protected], (10, Some("wl_seat"), 9)
[2970944.859][rs] <- [email protected], (11, Some("zwp_pointer_gestures_v1"), 3)
[2970944.930][rs] <- [email protected], (12, Some("zwp_pointer_constraints_v1"), 1)
[2970945.008][rs] <- [email protected], (13, Some("zwp_relative_pointer_manager_v1"), 1)
[2970945.085][rs] <- [email protected], (14, Some("wl_data_device_manager"), 3)
[2970945.152][rs] <- [email protected], (15, Some("zwlr_data_control_manager_v1"), 2)
[2970945.226][rs] <- [email protected], (16, Some("wp_cursor_shape_manager_v1"), 1)
[2970945.304][rs] <- [email protected], (17, Some("zwp_primary_selection_device_manager_v1"), 1)
[2970945.383][rs] <- [email protected], (18, Some("org_kde_kwin_idle"), 1)
[2970945.464][rs] <- [email protected], (19, Some("zwp_idle_inhibit_manager_v1"), 1)
[2970945.542][rs] <- [email protected], (20, Some("ext_idle_notifier_v1"), 1)
[2970945.617][rs] <- [email protected], (21, Some("org_kde_plasma_shell"), 8)
[2970945.695][rs] <- [email protected], (22, Some("org_kde_kwin_appmenu_manager"), 1)
[2970945.772][rs] <- [email protected], (23, Some("org_kde_kwin_server_decoration_palette_manager"), 1)
[2970945.843][rs] <- [email protected], (25, Some("org_kde_plasma_virtual_desktop_management"), 2)
[2970945.921][rs] <- [email protected], (27, Some("org_kde_kwin_shadow_manager"), 2)
[2970946.022][rs] <- [email protected], (28, Some("org_kde_kwin_dpms_manager"), 1)
[2970946.095][rs] <- [email protected], (29, Some("org_kde_kwin_server_decoration_manager"), 1)
[2970946.172][rs] <- [email protected], (30, Some("kde_output_management_v2"), 9)
[2970946.244][rs] <- [email protected], (31, Some("zxdg_output_manager_v1"), 3)
[2970946.315][rs] <- [email protected], (32, Some("wl_subcompositor"), 1)
[2970946.384][rs] <- [email protected], (33, Some("zxdg_exporter_v2"), 1)
[2970946.463][rs] <- [email protected], (34, Some("zxdg_importer_v2"), 1)
[2970946.542][rs] <- [email protected], (37, Some("xdg_activation_v1"), 1)
[2970946.615][rs] <- [email protected], (39, Some("wp_content_type_manager_v1"), 1)
[2970946.695][rs] <- [email protected], (40, Some("wp_tearing_control_manager_v1"), 1)
[2970946.769][rs] <- [email protected], (41, Some("xdg_toplevel_drag_manager_v1"), 1)
[2970946.837][rs] <- [email protected], (42, Some("kde_screen_edge_manager_v1"), 1)
[2970946.907][rs] <- [email protected], (43, Some("frog_color_management_factory_v1"), 1)
[2970946.977][rs] <- [email protected], (44, Some("wp_presentation"), 1)
[2970947.052][rs] <- [email protected], (45, Some("xx_color_manager_v4"), 1)
[2970947.123][rs] <- [email protected], (46, Some("xdg_wm_dialog_v1"), 1)
[2970947.194][rs] <- [email protected], (47, Some("kde_external_brightness_v1"), 1)
[2970947.266][rs] <- [email protected], (48, Some("wp_alpha_modifier_v1"), 1)
[2970947.335][rs] <- [email protected], (51, Some("xdg_wm_base"), 6)
[2970947.410][rs] <- [email protected], (52, Some("zwlr_layer_shell_v1"), 5)
[2970947.482][rs] <- [email protected], (54, Some("wp_drm_lease_device_v1"), 1)
[2970947.552][rs] <- [email protected], (55, Some("kde_output_order_v1"), 1)
[2970947.616][rs] <- [email protected], (56, Some("zwp_text_input_manager_v1"), 1)
[2970947.690][rs] <- [email protected], (57, Some("zwp_text_input_manager_v2"), 1)
[2970947.761][rs] <- [email protected], (58, Some("zwp_text_input_manager_v3"), 1)
[2970947.834][rs] <- [email protected], (60, Some("wl_drm"), 2)
[2970947.897][rs] <- [email protected], (61, Some("zwp_linux_dmabuf_v1"), 4)
[2970947.955][rs] <- [email protected], (62, Some("wp_linux_drm_syncobj_manager_v1"), 1)
[2970948.018][rs] <- [email protected], (63, Some("kde_output_device_v2"), 9)
[2970948.086][rs] <- [email protected], (64, Some("wl_output"), 4)
[2970948.153][rs] <- [email protected], (65, Some("org_kde_kwin_blur_manager"), 1)
[2970948.214][rs] <- [email protected], (66, Some("org_kde_kwin_slide_manager"), 1)
[2970948.277][rs] <- [email protected], (4306)
[2970948.323][rs] <- [email protected]_id, (3)
[2970948.440][rs] -> [email protected](10, Some("wl_seat"), 1, wl_seat@3)
[2970948.713][rs] -> [email protected](wl_callback@4)
[2970948.802][rs] <- [email protected], (7)
[2970948.861][rs] <- [email protected], (4306)
[2970948.908][rs] <- [email protected]_id, (4)
[2025-01-14T04:06:55Z WARN enigo::platform::wayland] Got a seat event Capabilities { capabilities: Value(Capability(Pointer | Keyboard | Touch)) }
[2025-01-14T04:06:55Z WARN enigo::platform] no connection could be established: (no protocol available to simulate input)
[2025-01-14T04:06:55Z ERROR enigo::platform] no successful connection

thread 'main' panicked at examples/keyboard.rs:11:54:
called Result::unwrap() on an Err value: EstablishCon("no successful connection")`

To Reproduce

  1. Use KDE 6.8.0 on Arch Linux Wayland session.
  2. Run WAYLAND_DEBUG=1 RUST_LOG=debug cargo run --example keyboard --features wayland --no-default-features

Expected behavior
The example should work. No crash happens.

Environment (please complete the following information):

  • OS: Arch Linux, kernel 6.11.11
  • Rust 1.86.0-nightly & Rust 1.83.0 stable
  • Library Version 16c7611
@pentamassiv
Copy link
Collaborator

I don't think KDE uses a Wayland protocol to enter input. They do support libei though, so you should be able to use the libei feature instead.

The Wayland feature is for compositor that use a Wayland protocol to simulate input such as labwc and phosh. Libei is for Gnome and KDE.

@pentamassiv
Copy link
Collaborator

Do you have xdg-desktop-portal-kde installed? I am not sure why you'd get that error

@pentamassiv pentamassiv added the Linux Linux spedific label Jan 29, 2025
@L-Acacia
Copy link

2025-02-26 21:40:46 [DEBUG] - trying to establish a connection to $WAYLAND_DISPLAY 
2025-02-26 21:40:46 [WARN] - Got a seat event Capabilities { capabilities: Value(Capability(Pointer | Keyboard | Touch)) } 
2025-02-26 21:40:46 [WARN] - no connection could be established: (no protocol available to simulate input)
$ systemctl --user status plasma-xdg-desktop-portal-kde.service
● plasma-xdg-desktop-portal-kde.service - Xdg Desktop Portal For KDE
     Loaded: loaded (/run/current-system/sw/share/systemd/user/plasma-xdg-desktop-portal-kde.service; linked-runtime; preset: ignored)
     Active: active (running) since Wed 2025-02-26 20:04:19 CET; 1h 59min ago
 Invocation: b96f19c2f9b847c1bc73c46934f39a60
   Main PID: 10303 (.xdg-desktop-po)
      Tasks: 4 (limit: 37908)
     Memory: 64.3M (peak: 68.6M)
        CPU: 2.128s
     CGroup: /user.slice/user-1000.slice/[email protected]/session.slice/plasma-xdg-desktop-portal-kde.service
             └─10303 /nix/store/9mh7alqq1s0n2ym3fv3x2cfwv6d6fzhs-xdg-desktop-portal-kde-6.3.0/libexec/xdg-desktop-portal-kde

Environment :

  • OS: Nixos, kernel 6.13.3
  • Rust 1.85.0
  • Library Version 3.0.0

I think Plasma doesn't support the protocols used for virtual inpu by default

@pentamassiv
Copy link
Collaborator

cargo run --example keyboard --features libei --no-default-features should work. As far as I know they are supporting libei

@L-Acacia
Copy link

2025-02-26 23:26:26 [DEBUG] - using libei
2025-02-26 23:26:26 [DEBUG] - Unable to find ei socket. Trying xdg desktop portal.
2025-02-26 23:26:29 [DEBUG] - libei connection established
2025-02-26 23:26:29 [DEBUG] - fast_text(text: C'est un test, je fait réglage)
2025-02-26 23:26:29 [WARN] - fast text entry is not yet implemented with libei
2025-02-26 23:26:29 [DEBUG] - fast text entry not available. Trying to enter individual letters now
2025-02-26 23:26:29 [ERROR] - you tried to simulate invalid input: (Key is not mapped)

libei doesn't seem to work correctly on my system, it panics on some characters (é) in this case

I got a bit further with the wayland feature. I'll test on a more complete distro like fedora to see if it is caused by missing packages after my vacations.

@pentamassiv
Copy link
Collaborator

That's unfortunately still to be expected. libei is still experimental and the same crash happens on my machine as well. I probably have to ask libei to update the keymap in order for them to work. That's what is being done with Wayland and Xdo as well.

I think compositors usually support the X11 protocol and then chose between libei and Wayland protocols for the Wayland implementation. Libei works so I'd be surprised if they also support Wayland protocols.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants