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)

This commit is contained in:
jean-pierre charras 2016-08-05 16:10:45 +02:00
parent 91a3b3d396
commit 498c8ce61d
1 changed files with 11 additions and 0 deletions

View File

@ -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;