gauntlet icon indicating copy to clipboard operation
gauntlet copied to clipboard

Input Events Multiplying/Repeating: Single Keystrokes Trigger Multiple Actions

Open rithvikvibhu opened this issue 1 year ago • 13 comments

I've yet to find the exact conditions, but, on any input (either typing characters in search, or navigating with arrow keys), the effect is multiplied.

For example:

  • Pressing a once adds this to the input: aaaaaaaaaaaaaaaaaaaaa
  • Pressing up/down once moves the selection N times

Restarting the service makes it normal again.

While this isn't the first time it's happened, I haven't looked into it much. Will record screenshots and log next time it happens.

rithvikvibhu avatar Jan 30 '25 11:01 rithvikvibhu

Please provide your environment (operating system/desktop environment/window manager, if linux wayland/x11)

Exidex avatar Jan 30 '25 11:01 Exidex

Manjaro (rolling, up to date) KDE, Wayland

rithvikvibhu avatar Jan 30 '25 11:01 rithvikvibhu

Also please provide version of Gauntlet used because v12 has big changes in wayland implementation

Exidex avatar Jan 31 '25 17:01 Exidex

I was on v12, but the issue exists on v14 also.

Also found a reliable way to reproduce:

  1. start gauntlet
  2. make sure everything is normal: typing a in search adds a
  3. put system to sleep/suspend
  4. wake up
  5. repeated inputs: typing a adds aaa
  6. sleep-wake again
  7. more repeated inputs: typing a adds aaaaa

rithvikvibhu avatar Jan 31 '25 18:01 rithvikvibhu

This is huge, thanks a lot

Exidex avatar Jan 31 '25 18:01 Exidex

Welp, this is one of those "I cant reproduce it" bugs. For some reason works fine on my EndeavourOS KDE Wayland, it may be hardware or configuration specific issue

Exidex avatar Feb 02 '25 18:02 Exidex

Oh well. Will try sprinkling a few more log lines and see what's being called when it's not supposed to.

rithvikvibhu avatar Feb 03 '25 02:02 rithvikvibhu

we need to check:

  • whether it is KDE bug or not, so whether the issue still present on other wayland windows manager like sway or hyprland
  • or if it is a bug in underlying layershell implementation. could be done by running counter example from here

Exidex avatar Feb 03 '25 08:02 Exidex

I can confirm that this is not a KDE specific bug as this occurs for me on Hyprland.

Airradda avatar Feb 03 '25 09:02 Airradda

+1 On this issue, on KDE Plasma 6.2.5 (Wayland), I'm experiencing the same thing:

https://github.com/user-attachments/assets/54715780-6c3c-463e-b0f2-673c69076cbe

cswimr avatar Feb 03 '25 13:02 cswimr

had a bit of time, tried running the counter example you linked, but failed:

❯ cargo run
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.83s
     Running `/tmp/exwlshelleventloop/target/debug/counter`

thread 'main' panicked at /home/rithvik/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wgpu-0.19.4/src/backend/wgpu_core.rs:724:18:
Error in Surface::configure: Validation Error

Caused by:
    Parent device is lost

Will try getting it to run later, have gtg now

rithvikvibhu avatar Feb 04 '25 08:02 rithvikvibhu

Can confirm this happened multiple times on nixOS Hyprland and gauntlet v14, still yet to discover the pattern though. Also, I just noticed that there isn't a convenient way to determine the version installed, other than reading from the package manager. An -v subcommand would be great!

j4ger avatar Feb 10 '25 01:02 j4ger

OK so I don't know how helpful this will be, but I tried killall gauntlet and relaunching and that fixed it, so might have something to do with multiple instances?

Mrid22 avatar Feb 15 '25 02:02 Mrid22

After long wait, I have finally managed to update dependencies, so this is a call for testing, you can try out latest main or download prebuild binaries here: https://github.com/project-gauntlet/gauntlet/actions/runs/15754299239

There is no guarantee that this will be fixed, but if not, I have another option to try out

Exidex avatar Jun 19 '25 10:06 Exidex

Okay built from latest main (f529d061ff34b5a1a390f6a47d1d711d0102dbff).

  • run: ./target/debug/gauntlet
  • window opens, normal typing
  • window closes with esc
  • run: ./target/debug/gauntlet open
  • window opens, normal typing
  • window closes with esc
  • sleep computer
  • wake up and log back in
  • gauntlet has panicked
❯ ./target/debug/gauntlet
wl_display#1: error 1: invalid method 1 (since 1 < 3), object wl_pointer#15
Io error: Invalid argument (os error 22)
Panic on 1750414939043
Payload: Error during event loop!: OtherError(IoError(Os { code: 22, kind: InvalidInput, message: "Invalid argument" }))
Location: Some("/home/rithvik/.cargo/git/checkouts/exwlshelleventloop-fa7cea22042d9280/1f14198/layershellev/src/lib.rs:3355:14")
Backtrace:
   0: gauntlet_cli::register_panic_hook::{{closure}}
             at ./rust/cli/src/lib.rs:206:25
   1: <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call
             at /rustc/255aa220821c05c3eac7605fce4ea1c9ab2cbdb4/library/alloc/src/boxed.rs:1980:9
   2: std::panicking::rust_panic_with_hook
             at /rustc/255aa220821c05c3eac7605fce4ea1c9ab2cbdb4/library/std/src/panicking.rs:841:13
   3: std::panicking::begin_panic_handler::{{closure}}
             at /rustc/255aa220821c05c3eac7605fce4ea1c9ab2cbdb4/library/std/src/panicking.rs:706:13
   4: std::sys::backtrace::__rust_end_short_backtrace
             at /rustc/255aa220821c05c3eac7605fce4ea1c9ab2cbdb4/library/std/src/sys/backtrace.rs:168:18
   5: __rustc::rust_begin_unwind
             at /rustc/255aa220821c05c3eac7605fce4ea1c9ab2cbdb4/library/std/src/panicking.rs:697:5
   6: core::panicking::panic_fmt
             at /rustc/255aa220821c05c3eac7605fce4ea1c9ab2cbdb4/library/core/src/panicking.rs:75:14
   7: core::result::unwrap_failed
             at /rustc/255aa220821c05c3eac7605fce4ea1c9ab2cbdb4/library/core/src/result.rs:1761:5
   8: core::result::Result<T,E>::expect
             at /home/rithvik/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:1119:23
   9: layershellev::WindowState<T>::running_with_proxy_option
             at /home/rithvik/.cargo/git/checkouts/exwlshelleventloop-fa7cea22042d9280/1f14198/layershellev/src/lib.rs:3355:14
  10: layershellev::WindowState<T>::running_with_proxy
             at /home/rithvik/.cargo/git/checkouts/exwlshelleventloop-fa7cea22042d9280/1f14198/layershellev/src/lib.rs:2732:14
  11: iced_layershell::multi_window::run
             at /home/rithvik/.cargo/git/checkouts/exwlshelleventloop-fa7cea22042d9280/1f14198/iced_layershell/src/multi_window.rs:122:16
  12: iced_layershell::build_pattern::daemon::Daemon<P>::run
             at /home/rithvik/.cargo/git/checkouts/exwlshelleventloop-fa7cea22042d9280/1f14198/iced_layershell/src/build_pattern/daemon.rs:615:9
  13: gauntlet_client::ui::run_wayland
             at ./rust/client/src/ui/mod.rs:352:10
  14: gauntlet_client::ui::run
             at ./rust/client/src/ui/mod.rs:299:13
  15: gauntlet_client::run_app
             at ./rust/client/src/lib.rs:5:5                                                   16: gauntlet_cli::init
             at ./rust/cli/src/lib.rs:112:21                                                   17: gauntlet::main
             at ./src/main.rs:4:5
  18: core::ops::function::FnOnce::call_once
             at /home/rithvik/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:250:5
  19: std::sys::backtrace::__rust_begin_short_backtrace                                                   at /home/rithvik/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/backtrace.rs:152:18
  20: std::rt::lang_start::{{closure}}                                                                    at /home/rithvik/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/rt.rs:206:18
  21: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once                 at /rustc/255aa220821c05c3eac7605fce4ea1c9ab2cbdb4/library/core/src/ops/function.rs:284:21
  22: std::panicking::catch_unwind::do_call                                                               at /rustc/255aa220821c05c3eac7605fce4ea1c9ab2cbdb4/library/std/src/panicking.rs:589:40
  23: std::panicking::catch_unwind                                                                        at /rustc/255aa220821c05c3eac7605fce4ea1c9ab2cbdb4/library/std/src/panicking.rs:552:19
  24: std::panic::catch_unwind                                                                            at /rustc/255aa220821c05c3eac7605fce4ea1c9ab2cbdb4/library/std/src/panic.rs:359:14
  25: std::rt::lang_start_internal::{{closure}}                                                           at /rustc/255aa220821c05c3eac7605fce4ea1c9ab2cbdb4/library/std/src/rt.rs:175:24
  26: std::panicking::catch_unwind::do_call
             at /rustc/255aa220821c05c3eac7605fce4ea1c9ab2cbdb4/library/std/src/panicking.rs:589:40
  27: std::panicking::catch_unwind
             at /rustc/255aa220821c05c3eac7605fce4ea1c9ab2cbdb4/library/std/src/panicking.rs:552:19
  28: std::panic::catch_unwind
             at /rustc/255aa220821c05c3eac7605fce4ea1c9ab2cbdb4/library/std/src/panic.rs:359:14
  29: std::rt::lang_start_internal
             at /rustc/255aa220821c05c3eac7605fce4ea1c9ab2cbdb4/library/std/src/rt.rs:171:5    30: std::rt::lang_start
             at /home/rithvik/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/rt.rs:205:5                                                          31: main
  32: <unknown>
  33: __libc_start_main
  34: _start

rithvikvibhu avatar Jun 20 '25 10:06 rithvikvibhu

Welp, that's even worse

Exidex avatar Jun 20 '25 10:06 Exidex

Latest changes on main contain another migration to different implementation of layer shell, hopefully this time it works, please test

Exidex avatar Jul 01 '25 21:07 Exidex

IT WORKS!! put it to sleep multiple times and there's no repeated inputs at all. Amazing, thanks @Exidex :D

This warning shows up on every gauntlet close (regardless of sleep, just ESC), fyi

warning: queue 0x55cf88d49000 destroyed while proxies still attached:
  wl_registry#62 still attached
warning: queue 0x55cf899ae200 destroyed while proxies still attached:
  wl_registry#79 still attached
warning: queue 0x55cf88d6e010 destroyed while proxies still attached:
  wl_registry#96 still attached
warning: queue 0x55cf88dbbc30 destroyed while proxies still attached:
  wl_registry#113 still attached
warning: queue 0x55cf8913bb00 destroyed while proxies still attached:
  wl_registry#130 still attached
warning: queue 0x55cf89d45480 destroyed while proxies still attached:
  wl_registry#147 still attached

rithvikvibhu avatar Jul 02 '25 05:07 rithvikvibhu

Gauntlet v20 released with the fix. Closing

Exidex avatar Jul 07 '25 19:07 Exidex

I can confirm that this is fixed for my wayland-hyprland setup I don't know about others

LordWorm1996 avatar Jul 07 '25 21:07 LordWorm1996