Problem: In GTK4, when a dialog pops up while a mouse button is pressed,
moving the mouse afterwards starts a Visual selection without
any button being held down.
Solution: Forget about the pressed mouse button when a mouse move reports
that no button is down, since the button release event may have
gone to another widget.
related: #20907
The GTK4 half of #21014, which fixes the same bug for GTK2/GTK3.
mouse_pressed_button is only cleared in button_release_event(). When a modal
dialog takes the release, the latch stays set and every later pointer motion is
reported as MOUSE_DRAG, which Vim turns into K_LEFTDRAG.
The fix differs from #21014 on purpose. GTK3 has gtk_grab_add() and
GtkWidget::grab-notify, so there the latch is cleared when another widget
shadows the text area with a grab. GTK4 has neither, and it is not clear that
GtkGestureClick gets a ::cancel when a modal toplevel appears. Here the latch
is dropped when a motion event reports that no button is down, which does not
depend on why the release was lost.
The comment claiming that the modifier state may not carry button masks on
Wayland is removed with it: dragging to extend a Visual selection was checked on
a Wayland session and works.
https://github.com/vim/vim/pull/21022
(1 file)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
thanks
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()