From c0d381e5881f75fc5fe97127c6ada7c7ebc115e1 Mon Sep 17 00:00:00 2001 From: Ian McInerney Date: Sat, 17 Oct 2020 20:54:28 +0100 Subject: [PATCH] Force the view switcher dialog to always be centered on the window The dialog isn't actually movable with the mouse, so all the placement logic inside DIALOG_SHIM is extraneous and actually causes the switcher to appear on the wrong monitor if pcbnew was moved across monitors after it was opened. Fixes https://gitlab.com/kicad/code/kicad/issues/5789 --- common/dialogs/eda_view_switcher.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/common/dialogs/eda_view_switcher.cpp b/common/dialogs/eda_view_switcher.cpp index 3c730127e1..255dd50bd6 100644 --- a/common/dialogs/eda_view_switcher.cpp +++ b/common/dialogs/eda_view_switcher.cpp @@ -70,8 +70,13 @@ bool EDA_VIEW_SWITCHER::Show( bool aShow ) bool ret = DIALOG_SHIM::Show( aShow ); if( aShow ) + { m_receivingEvents = true; + // Force the dialog to always be centered over the window + Centre(); + } + return ret; }