From 2b4c477e3e8c60edda36231137d55967799fb7d8 Mon Sep 17 00:00:00 2001 From: Ansgar Becker Date: Sun, 16 Dec 2007 22:29:46 +0000 Subject: [PATCH] Try to fix bug #1850003 "DB treeview context menu opens only on first monitor" and bug #1846610 "Database View/List Popup Menu position issue" Although I can't test the solution completely as I'm lacking a second monitor (like the reporter of the first bug), it seems correct that TPopupMenu.Popup() needs the clientorigin added to the mousepoint which is only a relative position to the underlying TWinControl. @see TMDIChild.btnDataClick() --- source/childwin.pas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/childwin.pas b/source/childwin.pas index 668b05cb..455bbb78 100644 --- a/source/childwin.pas +++ b/source/childwin.pas @@ -1520,7 +1520,7 @@ procedure TMDIChild.DBtreeContextPopup(Sender: TObject; MousePos: TPoint; begin debug('context menu; storing right click item so it won''t get lost'); DBRightClickSelectedItem := DBtree.Selected; - popupTreeView.Popup(MousePos.X, MousePos.Y); + popupTreeView.Popup(DBtree.ClientOrigin.X + MousePos.X, DBtree.ClientOrigin.Y + MousePos.Y); PostMessage(MainForm.Handle, WM_CLEAR_RIGHTCLICK_POINTER, 0, 0); end;