From 6de45e4ce8b0a11d31b6d7a559e9bf74d2671d84 Mon Sep 17 00:00:00 2001 From: andrew Date: Wed, 18 Jan 2006 21:44:51 +0000 Subject: [PATCH] Fixed big 1641 git-svn-id: trunk@8559 - --- lcl/interfaces/gtk/gtkwsmenus.pp | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/lcl/interfaces/gtk/gtkwsmenus.pp b/lcl/interfaces/gtk/gtkwsmenus.pp index 6e1a489199..a3cdc86232 100644 --- a/lcl/interfaces/gtk/gtkwsmenus.pp +++ b/lcl/interfaces/gtk/gtkwsmenus.pp @@ -83,6 +83,8 @@ type implementation +uses Controls; + { TGtkWSMenuItem } procedure TGtkWSMenuItem.AttachMenu(const AMenuItem: TMenuItem); @@ -267,17 +269,23 @@ end; procedure TGtkWSPopupMenu.Popup(const APopupMenu: TPopupMenu; const X, Y: integer); var APoint: TPoint; +AProc: Pointer; begin ReleaseMouseCapture; APoint.X := X; APoint.Y := Y; + + if (X = Mouse.CursorPos.X) and (Y = Mouse.CursorPos.Y) then + AProc := nil + else + AProc := @GtkWS_Popup; gtk_menu_popup(PgtkMenu(APopupMenu.Handle), - nil, - nil, - TGtkMenuPositionFunc(@GtkWS_Popup), - @APoint, - 0, - 0); + nil, + nil, + TGtkMenuPositionFunc(AProc), + @APoint, + 0, + 0); {Displays a menu and makes it available for selection. Applications can use this function to display context-sensitive menus, and will typically supply NULL for the parent_menu_shell, parent_menu_item,