updated for version 7.0105
diff --git a/src/gui_gtk.c b/src/gui_gtk.c
index cd7d6bb..5bde791 100644
--- a/src/gui_gtk.c
+++ b/src/gui_gtk.c
@@ -2411,6 +2411,10 @@
3U, (guint32)GDK_CURRENT_TIME);
}
+/* Ugly global variable to pass "mouse_pos" flag from gui_make_popup() to
+ * popup_menu_position_func(). */
+static int popup_mouse_pos;
+
/*
* Menu position callback; used by gui_make_popup() to place the menu
* at the current text cursor position.
@@ -2427,10 +2431,18 @@
# endif
gpointer user_data)
{
- if (curwin != NULL && gui.drawarea != NULL && gui.drawarea->window != NULL)
- {
- gdk_window_get_origin(gui.drawarea->window, x, y);
+ gdk_window_get_origin(gui.drawarea->window, x, y);
+ if (popup_mouse_pos)
+ {
+ int mx, my;
+
+ gui_mch_getmouse(&mx, &my);
+ *x += mx;
+ *y += my;
+ }
+ else if (curwin != NULL && gui.drawarea != NULL && gui.drawarea->window != NULL)
+ {
/* Find the cursor position in the current window */
*x += FILL_X(W_WINCOL(curwin) + curwin->w_wcol + 1) + 1;
*y += FILL_Y(W_WINROW(curwin) + curwin->w_wrow + 1) + 1;
@@ -2438,10 +2450,12 @@
}
void
-gui_make_popup(char_u *path_name)
+gui_make_popup(char_u *path_name, int mouse_pos)
{
vimmenu_T *menu;
+ popup_mouse_pos = mouse_pos;
+
menu = gui_find_menu(path_name);
if (menu != NULL && menu->submenu_id != NULL)
diff --git a/src/gui_w32.c b/src/gui_w32.c
index c4d8e48..11d0281 100644
--- a/src/gui_w32.c
+++ b/src/gui_w32.c
@@ -2206,7 +2206,7 @@
}
void
-gui_make_popup(char_u *path_name)
+gui_make_popup(char_u *path_name, int mouse_pos)
{
vimmenu_T *menu = gui_find_menu(path_name);
@@ -2216,7 +2216,15 @@
/* Find the position of the current cursor */
GetDCOrgEx(s_hdc, &p);
- if (curwin != NULL)
+ if (mouse_pos)
+ {
+ int mx, my;
+
+ gui_mch_getmouse(&mx, &my);
+ p.x += mx;
+ p.y += my;
+ }
+ else if (curwin != NULL)
{
p.x += TEXT_X(W_WINCOL(curwin) + curwin->w_wcol + 1);
p.y += TEXT_Y(W_WINROW(curwin) + curwin->w_wrow + 1);
diff --git a/src/proto/gui_gtk.pro b/src/proto/gui_gtk.pro
index 818d12c..960d631 100644
--- a/src/proto/gui_gtk.pro
+++ b/src/proto/gui_gtk.pro
@@ -15,7 +15,7 @@
char_u *gui_mch_browsedir __ARGS((char_u *title, char_u *initdir));
int gui_mch_dialog __ARGS((int type, char_u *title, char_u *message, char_u *buttons, int def_but, char_u *textfield));
void gui_mch_show_popupmenu __ARGS((vimmenu_T *menu));
-void gui_make_popup __ARGS((char_u *path_name));
+void gui_make_popup __ARGS((char_u *path_name, int mouse_pos));
void gui_mch_find_dialog __ARGS((exarg_T *eap));
void gui_mch_replace_dialog __ARGS((exarg_T *eap));
void gui_gtk_synch_fonts __ARGS((void));
diff --git a/src/version.h b/src/version.h
index 7082204..8331822 100644
--- a/src/version.h
+++ b/src/version.h
@@ -36,5 +36,5 @@
#define VIM_VERSION_NODOT "vim70aa"
#define VIM_VERSION_SHORT "7.0aa"
#define VIM_VERSION_MEDIUM "7.0aa ALPHA"
-#define VIM_VERSION_LONG "VIM - Vi IMproved 7.0aa ALPHA (2005 Jul 6)"
-#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0aa ALPHA (2005 Jul 6, compiled "
+#define VIM_VERSION_LONG "VIM - Vi IMproved 7.0aa ALPHA (2005 Jul 8)"
+#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0aa ALPHA (2005 Jul 8, compiled "