Description: Revert change that provokes freeze when opening dialogs With upstream's 12.1 version, there started to be a freeze when opening some dialogs. Upstream author identified this might come from a given change detailed in https://freefilesync.org/forum/viewtopic.php?t=10103 . Until the problem is fixed upstream, this patch reverts that change. Author: Fab Stz Origin: self Bug: https://freefilesync.org/forum/viewtopic.php?t=10103 Forwarded: https://freefilesync.org/forum/viewtopic.php?t=10103 Last-Update: 2023-03-07 Index: freefilesync/FreeFileSync/Source/ui/abstract_folder_picker.cpp =================================================================== --- freefilesync.orig/FreeFileSync/Source/ui/abstract_folder_picker.cpp 2023-04-04 22:33:59.278761616 +0200 +++ freefilesync/FreeFileSync/Source/ui/abstract_folder_picker.cpp 2023-04-04 22:33:59.274761559 +0200 @@ -127,10 +127,7 @@ //---------------------------------------------------------------------- GetSizer()->SetSizeHints(this); //~=Fit() + SetMinSize() -#ifdef __WXGTK3__ - Show(); //GTK3 size calculation requires visible window: https://github.com/wxWidgets/wxWidgets/issues/16088 - Hide(); //avoid old position flash when Center() moves window (asynchronously?) -#endif + //=> works like a charm for GTK2 with window resizing problems and title bar corruption; e.g. Debian!!! Center(); //needs to be re-applied after a dialog size change! Bind(wxEVT_CHAR_HOOK, [this](wxKeyEvent& event) { onLocalKeyEvent(event); }); //dialog-specific local key events Index: freefilesync/FreeFileSync/Source/ui/batch_config.cpp =================================================================== --- freefilesync.orig/FreeFileSync/Source/ui/batch_config.cpp 2023-04-04 22:33:59.278761616 +0200 +++ freefilesync/FreeFileSync/Source/ui/batch_config.cpp 2023-04-04 22:33:59.274761559 +0200 @@ -82,10 +82,7 @@ Bind(wxEVT_CHAR_HOOK, [this](wxKeyEvent& event) { onLocalKeyEvent(event); }); //enable dialog-specific key events GetSizer()->SetSizeHints(this); //~=Fit() + SetMinSize() -#ifdef __WXGTK3__ - Show(); //GTK3 size calculation requires visible window: https://github.com/wxWidgets/wxWidgets/issues/16088 - Hide(); //avoid old position flash when Center() moves window (asynchronously?) -#endif + //=> works like a charm for GTK2 with window resizing problems and title bar corruption; e.g. Debian!!! Center(); //needs to be re-applied after a dialog size change! m_buttonSaveAs->SetFocus(); Index: freefilesync/FreeFileSync/Source/ui/progress_indicator.cpp =================================================================== --- freefilesync.orig/FreeFileSync/Source/ui/progress_indicator.cpp 2023-04-04 22:33:59.278761616 +0200 +++ freefilesync/FreeFileSync/Source/ui/progress_indicator.cpp 2023-04-04 22:33:59.274761559 +0200 @@ -221,10 +221,7 @@ m_panelTimeStats->Layout(); GetSizer()->SetSizeHints(this); //~=Fit() + SetMinSize() -#ifdef __WXGTK3__ - Show(); //GTK3 size calculation requires visible window: https://github.com/wxWidgets/wxWidgets/issues/16088 - Hide(); //avoid old position flash when Center() moves window (asynchronously?) -#endif + //=> works like a charm for GTK2 with window resizing problems and title bar corruption; e.g. Debian!!! } @@ -902,10 +899,6 @@ //make sure that standard height matches ProcessPhase::comparingContent statistics layout (== largest) this->GetSizer()->SetSizeHints(this); //~=Fit() + SetMinSize() -#ifdef __WXGTK3__ - this->Show(); //GTK3 size calculation requires visible window: https://github.com/wxWidgets/wxWidgets/issues/16088 - this->Hide(); //avoid old position flash when Center() moves window (asynchronously?) -#endif pnl_.Layout(); this->Center(); //call *after* dialog layout update and *before* wxWindow::Show()! Index: freefilesync/FreeFileSync/Source/ui/small_dlgs.cpp =================================================================== --- freefilesync.orig/FreeFileSync/Source/ui/small_dlgs.cpp 2023-04-04 22:33:59.278761616 +0200 +++ freefilesync/FreeFileSync/Source/ui/small_dlgs.cpp 2023-04-04 22:33:59.274761559 +0200 @@ -145,10 +145,6 @@ //-------------------------------------------------------------------------- //have animal + text match *final* dialog width GetSizer()->SetSizeHints(this); //~=Fit() + SetMinSize() -#ifdef __WXGTK3__ - Show(); //GTK3 size calculation requires visible window: https://github.com/wxWidgets/wxWidgets/issues/16088 - Hide(); //avoid old position flash when Center() moves window (asynchronously?) -#endif { const int imageWidth = (m_panelDonate->GetSize().GetWidth() - 5 - 5 - 5 /* grey border*/) / 2; @@ -164,10 +160,7 @@ Bind(wxEVT_CHAR_HOOK, [this](wxKeyEvent& event) { onLocalKeyEvent(event); }); //enable dialog-specific key events GetSizer()->SetSizeHints(this); //~=Fit() + SetMinSize() -#ifdef __WXGTK3__ - Show(); //GTK3 size calculation requires visible window: https://github.com/wxWidgets/wxWidgets/issues/16088 - Hide(); //avoid old position flash when Center() moves window (asynchronously?) -#endif + //=> works like a charm for GTK2 with window resizing problems and title bar corruption; e.g. Debian!!! Center(); //needs to be re-applied after a dialog size change! m_buttonClose->SetFocus(); //on GTK ESC is only associated with wxID_OK correctly if we set at least *any* focus at all!!! @@ -401,11 +394,7 @@ m_checkBoxPasswordPrompt->Hide(); GetSizer()->SetSizeHints(this); //~=Fit() + SetMinSize() - //=> works like a charm for GTK with window resizing problems and title bar corruption; e.g. Debian!!! -#ifdef __WXGTK3__ - Show(); //GTK3 size calculation requires visible window: https://github.com/wxWidgets/wxWidgets/issues/16088 - Hide(); //avoid old position flash when Center() moves window (asynchronously?) -#endif + //=> works like a charm for GTK2 with window resizing problems and title bar corruption; e.g. Debian!!! Center(); //needs to be re-applied after a dialog size change! updateGui(); //*after* SetSizeHints when standard dialog height has been calculated @@ -973,10 +962,7 @@ Bind(wxEVT_CHAR_HOOK, [this](wxKeyEvent& event) { onLocalKeyEvent(event); }); //enable dialog-specific key events GetSizer()->SetSizeHints(this); //~=Fit() + SetMinSize() -#ifdef __WXGTK3__ - Show(); //GTK3 size calculation requires visible window: https://github.com/wxWidgets/wxWidgets/issues/16088 - Hide(); //avoid old position flash when Center() moves window (asynchronously?) -#endif + //=> works like a charm for GTK2 with window resizing problems and title bar corruption; e.g. Debian!!! Center(); //needs to be re-applied after a dialog size change! m_buttonOK->SetFocus(); @@ -1091,10 +1077,7 @@ Bind(wxEVT_CHAR_HOOK, [this](wxKeyEvent& event) { onLocalKeyEvent(event); }); //enable dialog-specific key events GetSizer()->SetSizeHints(this); //~=Fit() + SetMinSize() -#ifdef __WXGTK3__ - Show(); //GTK3 size calculation requires visible window: https://github.com/wxWidgets/wxWidgets/issues/16088 - Hide(); //avoid old position flash when Center() moves window (asynchronously?) -#endif + //=> works like a charm for GTK2 with window resizing problems and title bar corruption; e.g. Debian!!! Center(); //needs to be re-applied after a dialog size change! m_buttonOK->SetFocus(); @@ -1234,10 +1217,7 @@ setIntValue(*m_staticTextDeleteRight, st.deleteCount(), *m_bitmapDeleteRight, "so_delete_right_sicon"); GetSizer()->SetSizeHints(this); //~=Fit() + SetMinSize() -#ifdef __WXGTK3__ - Show(); //GTK3 size calculation requires visible window: https://github.com/wxWidgets/wxWidgets/issues/16088 - Hide(); //avoid old position flash when Center() moves window (asynchronously?) -#endif + //=> works like a charm for GTK2 with window resizing problems and title bar corruption; e.g. Debian!!! Center(); //needs to be re-applied after a dialog size change! m_buttonStartSync->SetFocus(); @@ -1501,10 +1481,7 @@ updateGui(); GetSizer()->SetSizeHints(this); //~=Fit() + SetMinSize() -#ifdef __WXGTK3__ - Show(); //GTK3 size calculation requires visible window: https://github.com/wxWidgets/wxWidgets/issues/16088 - Hide(); //avoid old position flash when Center() moves window (asynchronously?) -#endif + //=> works like a charm for GTK2 with window resizing problems and title bar corruption; e.g. Debian!!! Center(); //needs to be re-applied after a dialog size change! //restore actual value: @@ -1824,10 +1801,7 @@ Bind(wxEVT_CHAR_HOOK, [this](wxKeyEvent& event) { onLocalKeyEvent(event); }); //enable dialog-specific key events GetSizer()->SetSizeHints(this); //~=Fit() + SetMinSize() -#ifdef __WXGTK3__ - Show(); //GTK3 size calculation requires visible window: https://github.com/wxWidgets/wxWidgets/issues/16088 - Hide(); //avoid old position flash when Center() moves window (asynchronously?) -#endif + //=> works like a charm for GTK2 with window resizing problems and title bar corruption; e.g. Debian!!! Center(); //needs to be re-applied after a dialog size change! m_buttonOkay->SetFocus(); @@ -1923,10 +1897,7 @@ m_textCtrlPasswordVisible->Hide(); GetSizer()->SetSizeHints(this); //~=Fit() + SetMinSize() -#ifdef __WXGTK3__ - Show(); //GTK3 size calculation requires visible window: https://github.com/wxWidgets/wxWidgets/issues/16088 - Hide(); //avoid old position flash when Center() moves window (asynchronously?) -#endif + //=> works like a charm for GTK2 with window resizing problems and title bar corruption; e.g. Debian!!! Center(); //needs to be re-applied after a dialog size change! updateGui(); //*after* SetSizeHints when standard dialog height has been calculated @@ -2009,10 +1980,7 @@ m_spinCtrlOverdueDays->SetValue(cfgHistSyncOverdueDays); GetSizer()->SetSizeHints(this); //~=Fit() + SetMinSize() -#ifdef __WXGTK3__ - Show(); //GTK3 size calculation requires visible window: https://github.com/wxWidgets/wxWidgets/issues/16088 - Hide(); //avoid old position flash when Center() moves window (asynchronously?) -#endif + //=> works like a charm for GTK2 with window resizing problems and title bar corruption; e.g. Debian!!! Center(); //needs to be re-applied after a dialog size change! m_spinCtrlOverdueDays->SetFocus(); @@ -2078,10 +2046,7 @@ m_textCtrlOfflineActivationKey->ChangeValue(manualActivationKey); GetSizer()->SetSizeHints(this); //~=Fit() + SetMinSize() -#ifdef __WXGTK3__ - Show(); //GTK3 size calculation requires visible window: https://github.com/wxWidgets/wxWidgets/issues/16088 - Hide(); //avoid old position flash when Center() moves window (asynchronously?) -#endif + //=> works like a charm for GTK2 with window resizing problems and title bar corruption; e.g. Debian!!! Center(); //needs to be re-applied after a dialog size change! m_buttonActivateOnline->SetFocus(); @@ -2186,12 +2151,8 @@ updateGui(); GetSizer()->SetSizeHints(this); //~=Fit() + SetMinSize() -#ifdef __WXGTK3__ - Show(); //GTK3 size calculation requires visible window: https://github.com/wxWidgets/wxWidgets/issues/16088 - Hide(); //avoid old position flash when Center() moves window (asynchronously?) -#endif + //=> works like a charm for GTK2 with window resizing problems and title bar corruption; e.g. Debian!!! Center(); //needs to be re-applied after a dialog size change! - Show(); //clear gui flicker: window must be visible to make this work! Index: freefilesync/FreeFileSync/Source/ui/sync_cfg.cpp =================================================================== --- freefilesync.orig/FreeFileSync/Source/ui/sync_cfg.cpp 2023-04-04 22:33:59.278761616 +0200 +++ freefilesync/FreeFileSync/Source/ui/sync_cfg.cpp 2023-04-04 22:33:59.274761559 +0200 @@ -681,10 +681,7 @@ selectFolderPairConfig(-1); GetSizer()->SetSizeHints(this); //~=Fit() + SetMinSize() -#ifdef __WXGTK3__ - Show(); //GTK3 size calculation requires visible window: https://github.com/wxWidgets/wxWidgets/issues/16088 - Hide(); //avoid old position flash when Center() moves window (asynchronously?) -#endif + //=> works like a charm for GTK2 with window resizing problems and title bar corruption; e.g. Debian!!! Center(); //needs to be re-applied after a dialog size change! //keep stable sizer height: "two way" description is smaller than grid of sync directions Index: freefilesync/wx+/popup_dlg.cpp =================================================================== --- freefilesync.orig/wx+/popup_dlg.cpp 2023-04-04 22:33:59.278761616 +0200 +++ freefilesync/wx+/popup_dlg.cpp 2023-04-04 22:33:59.274761559 +0200 @@ -272,17 +272,12 @@ //set std order after button visibility was set setStandardButtonLayout(*bSizerStdButtons, stdBtns); - updateGui(); + updateGui(); GetSizer()->SetSizeHints(this); //~=Fit() + SetMinSize() -#ifdef __WXGTK3__ - Show(); //GTK3 size calculation requires visible window: https://github.com/wxWidgets/wxWidgets/issues/16088 - Hide(); //avoid old position flash when Center() moves window (asynchronously?) -#endif Center(); //needs to be re-applied after a dialog size change! - Raise(); //[!] popup may be triggered by ffs_batch job running in the background! if (m_buttonAccept->IsEnabled()) Index: freefilesync/wx+/tooltip.cpp =================================================================== --- freefilesync.orig/wx+/tooltip.cpp 2023-04-04 22:33:59.278761616 +0200 +++ freefilesync/wx+/tooltip.cpp 2023-04-04 22:33:59.274761559 +0200 @@ -78,12 +78,11 @@ } if (imgChanged || txtChanged) + { //tipWindow_->Layout(); -> apparently not needed!? tipWindow_->GetSizer()->SetSizeHints(tipWindow_); //~=Fit() + SetMinSize() -#ifdef __WXGTK3__ - //GTK3 size calculation requires visible window: https://github.com/wxWidgets/wxWidgets/issues/16088 - //=> call wxWindow::Show() to "execute" -#endif + //Linux: Fit() seems to be broken => call EVERY time inside show, not only if text or bmp change -> still true?!? + } const wxPoint newPos = wxTheApp->GetLayoutDirection() == wxLayout_RightToLeft ? mousePos - wxPoint(fastFromDIP(TIP_WINDOW_OFFSET_DIP) + tipWindow_->GetSize().GetWidth(), 0) :