On 12/04/2010 01:45 AM, H Xu wrote:
On Thu, Oct 28, 2010 at 4:58 PM, George Hawkins
<george.c.hawk...@gmail.com> wrote:
Hi there --
I'm using the standard yum installed Gvim on a normal Fedora 13 system
running Gnome.
For whatever reason I quite like the Windows Gvim arrangement where
clicking the right mouse button brings up the paste and select popup
menu - so I have "behave mswin".
However on my latest system this menu pops down unless I keep the
right mouse button held down, i.e. I have to hold, drag and release to
choose a menu option. This is contrary to the normal UI behavior in
Gnome (and I think most modern Windowing systems), where selecting a
menu item can be accompanied by two separate clicks (and releases),
one to popup the menu and one to select the desired menu item.
Is this something I can control via my vimrc? I looked through the
documentation but didn't find anything obvious. Or is it the result of
the build time options of whoever built the gvim install for Fedora
13?
I did gvim --version on an older Fedora system where I don't have this
issue and compared the output with that on my current system and the
only difference in features is that the newer one has +ruby and
+startuptime and the only difference in defined marcos is that the
newer one has -DPERL_USE_SAFE_PUTENV and -DRUBY_VERSION=18.
So can anyone explain the behavior I see?
For reference I include the version info below.
Thanks for your time and help,
/George
VIM - Vi IMproved 7.2 (2008 Aug 9, compiled Mar 25 2010 23:22:32)
Included patches: 1-411
Modified by<bugzi...@redhat.com>
Compiled by<bugzi...@redhat.com>
Huge version with GTK2 GUI. Features included (+) or not (-):
+arabic +autocmd +balloon_eval +browse ++builtin_terms +byte_offset
+cindent
+clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info
+comments
+cryptv +cscope +cursorshape +dialog_con_gui +diff +digraphs +dnd -
ebcdic
+emacs_tags +eval +ex_extra +extra_search +farsi +file_in_path
+find_in_path
+float +folding -footer +fork() +gettext -hangul_input +iconv
+insert_expand
+jumplist +keymap +langmap +libcall +linebreak +lispindent +listcmds
+localmap
+menu +mksession +modify_fname +mouse +mouseshape +mouse_dec
+mouse_gpm
-mouse_jsbterm +mouse_netterm -mouse_sysmouse +mouse_xterm
+multi_byte
+multi_lang -mzscheme +netbeans_intg -osfiletype +path_extra +perl
+postscript
+printer +profile +python +quickfix +reltime +rightleft +ruby
+scrollbind
+signs +smartindent -sniff +startuptime +statusline -sun_workshop
+syntax
+tag_binary +tag_old_static -tag_any_white -tcl +terminfo
+termresponse
+textobjects +title +toolbar +user_commands +vertsplit +virtualedit
+visual
+visualextra +viminfo +vreplace +wildignore +wildmenu +windows
+writebackup
+X11 -xfontset +xim +xsmp_interact +xterm_clipboard -xterm_save
system vimrc file: "/etc/vimrc"
user vimrc file: "$HOME/.vimrc"
user exrc file: "$HOME/.exrc"
system gvimrc file: "/etc/gvimrc"
user gvimrc file: "$HOME/.gvimrc"
system menu file: "$VIMRUNTIME/menu.vim"
fall-back for $VIM: "/etc"
f-b for $VIMRUNTIME: "/usr/share/vim/vim72"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK -
pthread -I/usr/include/gtk-2.0 -I/usr/lib64/gtk-2.0/include -I/usr/
include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/
include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1
-I/usr/include/freetype2 -I/usr/include/libpng12 -O2 -g -pipe -
Wall -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -
mtune=generic -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -
D_FORTIFY_SOURCE=1 -D_REENTRANT -D_GNU_SOURCE -
DPERL_USE_SAFE_PUTENV -fstack-protector -I/usr/local/include -
D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/lib64/perl5/CORE -I/
usr/include/python2.6 -pthread -I/usr/lib64/ruby/1.8/x86_64-linux -
DRUBY_VERSION=18
Linking: gcc -L. -rdynamic -Wl,-export-dynamic -Wl,-E -Wl,-rpath,/
usr/lib64/perl5/CORE -L/usr/local/lib -o vim -pthread -lgtk-
x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -
lgdk_pixbuf-2.0 -lpangocairo-1.0 -lcairo -lpango-1.0 -lfreetype -
lfontconfig -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -
lglib-2.0 -lXt -lX11 -lSM -lICE -lselinux -lncurses -lacl -lgpm -
Wl,-E -Wl,-rpath,/usr/lib64/perl5/CORE -fstack-protector -L/usr/
lib64/perl5/CORE -lperl -lresolv -lutil -lc -L/usr/lib64/python2.6/
config -lpython2.6 -lutil -Xlinker -export-dynamic -lruby -lrt -ldl -
lm
--
You received this message from the "vim_use" 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
Hi,
I have the same problem and don't how to solve it. The windows popup
behavior is better than this.
Hong Xu
2010/12/4
Hello,
I think I have fixed this problem. The attachment is the patch. The
reason is that when gtk_menu_popup is called, its last parameter is
not passed in the correct time stamp but GDK_CURRENT_TIME. I fixed
this by adding a global varible, which is ugly, I think. Is there a
better way to pass the time stamp?
Regards,
Hong Xu
12/04/2010
--
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
diff -r d94c32250814 src/gui_gtk.c
--- a/src/gui_gtk.c Thu Dec 02 21:44:40 2010 +0100
+++ b/src/gui_gtk.c Sat Dec 04 11:48:13 2010 +0800
@@ -1390,7 +1390,7 @@
gtk_menu_popup(GTK_MENU(menu->submenu_id),
NULL, NULL,
(GtkMenuPositionFunc)NULL, NULL,
- 3U, (guint32)GDK_CURRENT_TIME);
+ 3U, menu_event_time);
}
/* Ugly global variable to pass "mouse_pos" flag from gui_make_popup() to
diff -r d94c32250814 src/gui_gtk_f.h
--- a/src/gui_gtk_f.h Thu Dec 02 21:44:40 2010 +0100
+++ b/src/gui_gtk_f.h Sat Dec 04 11:48:13 2010 +0800
@@ -72,6 +72,9 @@
void gtk_form_thaw(GtkForm *form);
+/* used to save the time stamp for the popup menu */
+extern guint32 menu_event_time;
+
#ifdef __cplusplus
}
#endif
diff -r d94c32250814 src/gui_gtk_x11.c
--- a/src/gui_gtk_x11.c Thu Dec 02 21:44:40 2010 +0100
+++ b/src/gui_gtk_x11.c Sat Dec 04 11:48:13 2010 +0800
@@ -1607,6 +1607,11 @@
}
+#ifdef FEAT_MENU
+/* used to save the time stamp for the popup menu */
+guint32 menu_event_time = 0;
+#endif
+
/*
* Mouse button handling. Note please that we are capturing multiple click's
* by our own timeout mechanism instead of the one provided by GTK+ itself.
@@ -1624,6 +1629,11 @@
clipboard_event_time = event->time;
+#ifdef FEAT_MENU
+ /* save the time stamp for the popup menu */
+ menu_event_time = event->time;
+#endif
+
/* Make sure we have focus now we've been selected */
if (gtk_socket_id != 0 && !GTK_WIDGET_HAS_FOCUS(widget))
gtk_widget_grab_focus(widget);