~exec64/imv#7: 
Keypresses may get repeated

I'm having the same problem as issues #201 and #272 on Github, even on the newest version (4.3.1). I have a binding

[binds]
<Shift+X> = exec garbage put "$imv_current_file"; close

that can get executed multiple times when working with large images, and skipping can also occur when using the arrow keys.

For extra info, this is under wayland using wlroots 0.15.1.

Status
REPORTED
Submitter
~firegem
Assigned to
No-one
Submitted
2 years ago
Updated
1 year, 2 months ago
Labels
No labels applied.

Денис 2 years ago · edit

I confirm that. When i open imv via thunar and press Shift+E for exec gimp "$imv_current_file", it open gimp too many times. if open imv in terminal it work fine

Денис 2 years ago · edit

Check it again, from terminal but repeated.

Finn Steffens 1 year, 6 months ago · edit

On Wayland key presses can repeat indefinitely if the user unfocused the imv window before releasing the key. This issue has to do with the missing handling of the keyboard_enter and keyboard_leave events. At the very least the keyboard_leave event has to clear the running keyboard repeat timer. e.g.:

diff --git a/src/wl_window.c b/src/wl_window.c index 5efa42f..a44a6ca 100644 --- a/src/wl_window.c +++ b/src/wl_window.c @@ -129,10 +129,22 @@ static void keyboard_enter(void *data, struct wl_keyboard *keyboard, static void keyboard_leave(void *data, struct wl_keyboard *keyboard, uint32_t serial, struct wl_surface *surface) {

  • (void)data; (void)keyboard; (void)serial; (void)surface;
  • struct imv_window *window = data;
  • struct itimerspec off = {
  • .it_value = {
  •  .tv_sec = 0,
    
  •  .tv_nsec = 0,
    
  • },
  • .it_interval = {
  •  .tv_sec = 0,
    
  •  .tv_nsec = 0,
    
  • },
  • };
  • timer_settime(window->timer_id, 0, &off, NULL); }

static void cleanup_event(struct imv_event *event)

I haven't figured out though why key presses can repeat when the currently opened image changes.

blankie 1 year, 2 months ago · edit

Finally managed to figure out how to consistently reproduce this bug (without unfocusing imv, which seems to be a different bug). It happens when a keybinding that executes a shell command takes a second or so to execute. For example: the keybinding "t = exec sleep 1 && echo T pressed" would keep printing "T pressed" even after releasing T.

blankie referenced this from #6 3 months ago

Register here or Log in to comment, or comment via email.