public:
AutoRecoveryDialog(wxWindow *parent);
+#if defined(__WXGTK__) && wxCHECK_VERSION(3, 0, 0)
+ void OnShow(wxShowEvent & event);
+#endif
+
private:
void PopulateList();
void PopulateOrExchange(ShuttleGui & S);
EVT_BUTTON(ID_RECOVER_ALL, AutoRecoveryDialog::OnRecoverAll)
EVT_BUTTON(ID_RECOVER_NONE, AutoRecoveryDialog::OnRecoverNone)
EVT_BUTTON(ID_QUIT_AUDACITY, AutoRecoveryDialog::OnQuitAudacity)
+#if defined(__WXGTK__) && wxCHECK_VERSION(3, 0, 0)
+ EVT_SHOW(AutoRecoveryDialog::OnShow)
+#endif
END_EVENT_TABLE()
void AutoRecoveryDialog::PopulateOrExchange(ShuttleGui& S)
Center();
}
+#if defined(__WXGTK__) && wxCHECK_VERSION(3, 0, 0)
+void AutoRecoveryDialog::OnShow(wxShowEvent & event)
+{
+ // Workaround for wxWidgets bug #16440:
+ // http://trac.wxwidgets.org/ticket/16440
+ // Fit() doesn't work correctly in some desktop environments
+ // with GTK. But it does work after the first window of the
+ // same style class has been shown on screen. So re-execute
+ // Fit() and other methods that depend on its result AFTER
+ // we know that the window has been shown.
+ Fit();
+ SetMinSize(GetSize());
+ Center();
+}
+#endif
+
void AutoRecoveryDialog::PopulateList()
{
mFileList->DeleteAllItems();