comparison src/gui.c @ 17306:16d5e91c5e5b v8.1.1652

patch 8.1.1652: GUI: popup window doesn't close on mouse movement commit https://github.com/vim/vim/commit/49fe95f22517b775506ef34681000d84bb417eb3 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Jul 8 21:57:30 2019 +0200 patch 8.1.1652: GUI: popup window doesn't close on mouse movement Problem: GUI: popup window doesn't close on mouse movement. (Paul Jolly) Solution: Generate mouse-move events when a popup window is visible.
author Bram Moolenaar <Bram@vim.org>
date Mon, 08 Jul 2019 22:00:04 +0200
parents 9ca8baed6b90
children 54fcde87a9eb
comparison
equal deleted inserted replaced
17305:f60f78133fca 17306:16d5e91c5e5b
4821 } 4821 }
4822 #endif 4822 #endif
4823 } 4823 }
4824 4824
4825 /* 4825 /*
4826 * Called when the mouse moved (but not when dragging). 4826 * When mouse moved: apply 'mousefocus'.
4827 */ 4827 * Also updates the mouse pointer shape.
4828 void 4828 */
4829 gui_mouse_moved(int x, int y) 4829 static void
4830 gui_mouse_focus(int x, int y)
4830 { 4831 {
4831 win_T *wp; 4832 win_T *wp;
4832 char_u st[8]; 4833 char_u st[8];
4833
4834 /* Ignore this while still starting up. */
4835 if (!gui.in_use || gui.starting)
4836 return;
4837 4834
4838 #ifdef FEAT_MOUSESHAPE 4835 #ifdef FEAT_MOUSESHAPE
4839 /* Get window pointer, and update mouse shape as well. */ 4836 /* Get window pointer, and update mouse shape as well. */
4840 wp = xy2win(x, y); 4837 wp = xy2win(x, y);
4841 #endif 4838 #endif
4889 /* Need to wake up the main loop */ 4886 /* Need to wake up the main loop */
4890 if (gtk_main_level() > 0) 4887 if (gtk_main_level() > 0)
4891 gtk_main_quit(); 4888 gtk_main_quit();
4892 #endif 4889 #endif
4893 } 4890 }
4891 }
4892
4893 /*
4894 * Called when the mouse moved (but not when dragging).
4895 */
4896 void
4897 gui_mouse_moved(int x, int y)
4898 {
4899 // Ignore this while still starting up.
4900 if (!gui.in_use || gui.starting)
4901 return;
4902
4903 // apply 'mousefocus' and pointer shape
4904 gui_mouse_focus(x, y);
4905
4906 #ifdef FEAT_TEXT_PROP
4907 if (popup_visible)
4908 // Generate a mouse-moved event, so that the popup can perhaps be
4909 // closed, just like in the terminal.
4910 gui_send_mouse_event(MOUSE_DRAG, x, y, FALSE, 0);
4911 #endif
4894 } 4912 }
4895 4913
4896 /* 4914 /*
4897 * Called when mouse should be moved to window with focus. 4915 * Called when mouse should be moved to window with focus.
4898 */ 4916 */