Patch 8.2.3654
Problem: GTK: a touch-drag does not update the selection.
Solution: Add GDK_BUTTON1_MASK to the state. (Chris Dalton, close #9196,
closes #9194)
Files: src/gui_gtk_x11.c
*** ../vim-8.2.3653/src/gui_gtk_x11.c 2021-11-21 11:15:45.662752634 +0000
--- src/gui_gtk_x11.c 2021-11-23 12:27:01.225201870 +0000
***************
*** 397,402 ****
--- 397,408 ----
#endif
/*
+ * GTK doesn't set the GDK_BUTTON1_MASK state when dragging a touch. Add this
+ * state when dragging.
+ */
+ static guint dragging_button_state = 0;
+
+ /*
* Parse the GUI related command-line arguments. Any arguments used are
* deleted from argv, and *argc is decremented accordingly. This is called
* when vim is started, whether or not the GUI has been started.
***************
*** 1585,1590 ****
--- 1591,1599 ----
int_u vim_modifiers;
GtkAllocation allocation;
+ // Need to add GDK_BUTTON1_MASK state when dragging a touch.
+ state |= dragging_button_state;
+
button = (state & (GDK_BUTTON1_MASK | GDK_BUTTON2_MASK |
GDK_BUTTON3_MASK | GDK_BUTTON4_MASK |
GDK_BUTTON5_MASK))
***************
*** 1811,1817 ****
{
// Keep in sync with gui_x11.c.
// Buttons 4-7 are handled in scroll_event()
! case 1: button = MOUSE_LEFT; break;
case 2: button = MOUSE_MIDDLE; break;
case 3: button = MOUSE_RIGHT; break;
case 8: button = MOUSE_X1; break;
--- 1820,1830 ----
{
// Keep in sync with gui_x11.c.
// Buttons 4-7 are handled in scroll_event()
! case 1:
! button = MOUSE_LEFT;
! // needed for touch-drag
! dragging_button_state |= GDK_BUTTON1_MASK;
! break;
case 2: button = MOUSE_MIDDLE; break;
case 3: button = MOUSE_RIGHT; break;
case 8: button = MOUSE_X1; break;
***************
*** 1906,1911 ****
--- 1919,1931 ----
gui_send_mouse_event(MOUSE_RELEASE, x, y, FALSE, vim_modifiers);
+ switch (event->button)
+ {
+ case 1: // MOUSE_LEFT
+ dragging_button_state = 0;
+ break;
+ }
+
return TRUE;
}
*** ../vim-8.2.3653/src/version.c 2021-11-23 12:07:21.105730814 +0000
--- src/version.c 2021-11-23 12:22:36.142857508 +0000
***************
*** 759,760 ****
--- 759,762 ----
{ /* Add new patch number below this line */
+ /**/
+ 3654,
/**/
--
It is illegal for anyone to try and stop a child from playfully jumping over
puddles of water.
[real standing law in California, United States of America]
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/20211123123154.23E791C3DF9%40moolenaar.net.