From 498c8ce61df588ff58e0c37b3a52e1c892bf82cf Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Fri, 5 Aug 2016 16:10:45 +0200 Subject: [PATCH] Fix issue: When left-clicking on the "window frame" (blue top area on Windows) (Any editor), the window jumps to bottom half of the screen, if a context menu is currently opened (could be Windows specific) --- common/draw_panel.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/common/draw_panel.cpp b/common/draw_panel.cpp index 439d951845..a70579105c 100644 --- a/common/draw_panel.cpp +++ b/common/draw_panel.cpp @@ -885,6 +885,17 @@ bool EDA_DRAW_PANEL::OnRightClick( wxMouseEvent& event ) pos = event.GetPosition(); m_ignoreMouseEvents = true; PopupMenu( &MasterMenu, pos ); + // here, we are waiting for popup menu closing. + // Among different ways, it can be closed by clicking on the left mouse button. + // The expected behavior is to move the mouse cursor to its initial + // location, where the right click was made. + // However there is a case where the move cursor does not work as expected: + // when the user left clicks on the caption frame: the entire window is moved. + // Calling wxSafeYield avoid this behavior because it allows the left click + // to be proceeded before moving the mouse + wxSafeYield(); + + // Move the mouse cursor to its initial position: MoveCursorToCrossHair(); m_ignoreMouseEvents = false;