From 9a1e820cc1a97f1e0691a17b1acb652cc29ca736 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Sat, 5 Dec 2020 22:22:04 +0100 Subject: [PATCH] Fix restoring application window when clicking on dock icon This didn't work any more since IsShown() returned true even for iconized windows, so we never did anything if all windows (and, in particular, the only window) were (was) iconized. Fix this by checking for IsIconized() first and IsShown() only if it returns false because it seems that IsShown() is indeed supposed to return true for iconized windows -- at least it also does it in wxMSW. Closes #18998. Co-Authored-By: Vadim Zeitlin --- src/osx/carbon/app.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/osx/carbon/app.cpp b/src/osx/carbon/app.cpp index 4d4f3a89ce..1b6cefa687 100644 --- a/src/osx/carbon/app.cpp +++ b/src/osx/carbon/app.cpp @@ -169,16 +169,16 @@ void wxApp::MacReopenApp() while (node) { wxTopLevelWindow* win = (wxTopLevelWindow*) node->GetData(); - if ( win->IsShown() ) - { - // we do have a visible, non-iconized toplevelwindow -> do nothing - return; - } - else if ( win->IsIconized() ) + if ( win->IsIconized() ) { if ( firstIconized == NULL ) firstIconized = win; } + else if ( win->IsShown() ) + { + // we do have a visible, non-iconized toplevelwindow -> do nothing + return; + } node = node->GetNext(); }