diff options
-rw-r--r-- | src/gui_w16.c | 16 | ||||
-rw-r--r-- | src/proto/gui_kde.pro | 2 |
2 files changed, 13 insertions, 5 deletions
diff --git a/src/gui_w16.c b/src/gui_w16.c index 497033642..2452ce360 100644 --- a/src/gui_w16.c +++ b/src/gui_w16.c @@ -802,7 +802,7 @@ gui_mch_show_popupmenu(vimmenu_T *menu) } 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); @@ -814,10 +814,18 @@ gui_make_popup(char_u *path_name) temp_p = GetDCOrg(s_hdc); p.x = LOWORD(temp_p); p.y = HIWORD(temp_p); - if (curwin!=NULL) + if (mouse_pos) { - p.x+= TEXT_X(W_WINCOL(curwin) + curwin->w_wcol +1); - p.y+= TEXT_Y(W_WINROW(curwin) + curwin->w_wrow +1); + 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); } msg_scroll = FALSE; gui_mch_show_popupmenu_at(menu, (int)p.x, (int)p.y); diff --git a/src/proto/gui_kde.pro b/src/proto/gui_kde.pro index 50671f44e..a72b358d4 100644 --- a/src/proto/gui_kde.pro +++ b/src/proto/gui_kde.pro @@ -15,5 +15,5 @@ void gui_mch_show_popupmenu __ARGS((vimmenu_T *menu)); void gui_mch_find_dialog __ARGS((exarg_T *eap)); void gui_mch_replace_dialog __ARGS((exarg_T *eap)); void ex_helpfind __ARGS((exarg_T *eap)); -void gui_make_popup __ARGS((char_u *path_name)); +void gui_make_popup __ARGS((char_u *path_name, int mouse_pos)); /* vim: set ft=cpp : */ |