woelper / oculante

A fast and simple image viewer / editor for many operating systems
https://github.com/woelper/oculante
MIT License
812 stars 38 forks source link

Inputs get dropped or ignored completely under certain conditions #374

Open Stoppedpuma opened 3 weeks ago

Stoppedpuma commented 3 weeks ago

Describe the bug Inputs seem to be dropped if they are pressed to fast and are ignored completely if oculante is moved to another workspace.

To Reproduce Steps to reproduce the dropped behavior:

  1. Open a directory containing multiple images
  2. Switch between them quickly
  3. Reproduced

Steps to reproduce the ignored behaviour: 1-2. Open a directory containing multiple images 2-2. Move oculante to another workspace on the same display 3-2. Reproduced

Expected behavior Inputs to not be dropped.

Screenshots / sample files

There's a key overlay in the bottom right which can be used in frame-by-frame analysis if needed, otherwise it can still be noticed without analysing by frame.

https://github.com/woelper/oculante/assets/58333920/2d9d367d-d535-4021-9ae7-7d583dc70f90

https://github.com/woelper/oculante/assets/58333920/8338817c-c8a7-4656-857f-9b510b75d798

Desktop (please complete the following information):

woelper commented 3 weeks ago

Maybe this is related to a design decision. In the past, Oculante blocked any loading operation until the image was loaded. For example if you pressed the button to load the next image, it could not be pressed / did not work until the image was loaded.

This felt more "solid", but also was not feeling responsive when loading very large images, and it also was a problem when the images did not load at all.

After that I decided that you could advance to the next image at any time. Since all the code is async, this would not block at all, and you can super quickly skip over a bunch of files, no matter how long they load.

The other issue with not registering commands at all might be related to the app losing input when moving it to another workspace. I suspect this is related to winit or some other dependency beyond my control, as Oculante does not handle that part directly but instead relies on a library to do that.

Stoppedpuma commented 3 weeks ago

I don't think this is related to the image loading, sometimes it just requires pressing the key twice for some reason I've found. I've also noticed this seems to happen a lot when "zen mode" is enabled and can result in the input being ignored completely as well every once in a while.

Regarding the input blocking problem though I've found out that this is caused by oculante not letting go of shift, pressing shift after moving it to another workspace fixes the input problem.

Since all the code is async, this would not block at all, and you can super quickly skip over a bunch of files, no matter how long they load.

I noticed this and find it very useful, thanks for this!

woelper commented 3 weeks ago

That is very useful info, I will dig deeper on this!

Shortcuts are also provided by a library I use, so I might be limited. But I remember I have some special treatment for "modifier keys" such as Shift, maybe there is a bug.

Stoppedpuma commented 3 weeks ago

Another place where input gets ignored is while holding another key, this is probably why moving workspace is ignoring inputs since it keeps shift held down for some reason.