[go: up one dir, main page]

Lost mouse events due to using gesture based mouse event reading

Summary:

In f6fcc75e canvas was switched reading mouse press/release events using GestureMultiPress, this causes various issues to tools reacting to mouse events. For example rotation can get stuck due to mouse release event getting lost

More details

The issues with rotation is just one of the examples how bad mouse press/release events are causing problems. While it would be possible to add a hack for fixing the rotation like the middle panning has, I would strongly encourage fixing the underlying issue of mouse release events getting lost.

The usual assumption is that if there is a mouse press events, then later there will be mouse release. With GTK multipress gesture that's not the case. When something doesn't follow the pattern gesture expects it can be canceled or ended and rest of the mouse events will not be considered part of gesture, there are even signals to notify that see Gtk.Gesture::cancel and Gtk.Gesture::end .

I noticed this while trying some ideas for inbox#2985 (moved) which would add potentially add a lot more mouse interactions.

This extra annoying when using a tablet. Not sure if all of them behave the same but the one I have always generate treats touching the surface with stylus as left mouse press. but pressing a button on side generates middle/right click. So if you want to do a middle click drag you need press and hold the side button while hovering the tip few millimeters above surface, it can't be to high as that interrupts movement, and it can't be too low as then it's easy to accidentally touch the surface which would generate left click thus interrupting gtk mouse gesture.

Overall I got the feeling that gestures are best suited for detecting the specific gestures (multipress, long press and so on) not for mouse up down events.

Isn't it possible to just directly subscribe to widget Gtk.Widget::button-press-event m Gtk.Widget::button-release-event ?

Steps to reproduce:

  • make sure canvas rotation is unlocked
  • hold Ctrl
  • press and hold Middle mouse button to start rotating canvas
  • click the left mouse button
  • release middle button

What happened?

Rotation mode gets stuck

What should have happened?

Rotation mode stops when middle click is released

Sample attachments:

Version info

Inkscape 1.4-dev (18db810a, 2024-01-10, custom)

First bad commit: f6fcc75e