From 6c061081eb2fbe028e2dd7bfde912acec8b6d48c Mon Sep 17 00:00:00 2001 From: ann0see Date: Sun, 15 Nov 2026 18:26:13 +0100 Subject: [PATCH] Raise the windows restored from the settings after the main window is shown The settings and chat windows that were open when the application was quit are shown in the CClientDlg constructor, i.e. before the main window exists. On iOS, which has no window manager, the main window is then presented in front of them and the chat is unreachable until the Chat check box is toggled. Bring the restored windows forward once the main window is shown. The call is guarded to iOS so that the behaviour on the other platforms is unchanged. --- src/clientdlg.cpp | 18 ++++++++++++++++++ src/clientdlg.h | 4 ++++ src/main.cpp | 5 +++++ 3 files changed, 27 insertions(+) diff --git a/src/clientdlg.cpp b/src/clientdlg.cpp index 2c7c35f02c..fb30e2b42a 100644 --- a/src/clientdlg.cpp +++ b/src/clientdlg.cpp @@ -1013,6 +1013,24 @@ void CClientDlg::ShowGeneralSettings ( int iTab ) ClientSettingsDlg.activateWindow(); } +#if defined( Q_OS_IOS ) +void CClientDlg::RaiseRestoredWindows() +{ + // the dialogs restored from the settings are shown in the constructor, i.e. before + // this window, so the main window is in front of them. Bring them forward again. + if ( ClientSettingsDlg.isVisible() ) + { + ClientSettingsDlg.raise(); + ClientSettingsDlg.activateWindow(); + } + + if ( ChatDlg.isVisible() ) + { + ChatDlg.raise(); + } +} +#endif + void CClientDlg::ShowChatWindow ( const bool bForceRaise ) { ChatDlg.show(); diff --git a/src/clientdlg.h b/src/clientdlg.h index b127231b27..2768c11458 100644 --- a/src/clientdlg.h +++ b/src/clientdlg.h @@ -105,6 +105,10 @@ class CClientDlg : public CBaseDlg, private Ui_CClientDlgBase const bool bMuteStream, QWidget* parent = nullptr ); +#if defined( Q_OS_IOS ) + void RaiseRestoredWindows(); +#endif + protected: void SetGUIDesign ( const EGUIDesign eNewDesign ); void SetMeterStyle ( const EMeterStyle eNewMeterStyle ); diff --git a/src/main.cpp b/src/main.cpp index f74148cc64..aab8afea75 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1011,6 +1011,11 @@ int main ( int argc, char** argv ) // show dialog ClientDlg.show(); +# if defined( Q_OS_IOS ) + // iOS has no window manager, so the main window is presented in front of + // the windows restored from the settings. Bring them forward again. + ClientDlg.RaiseRestoredWindows(); +# endif // Connect on startup if requested if ( !strConnOnStartupAddress.isEmpty() )