Fix empty editor windows (#7515)

Fix the problem with empty windows as described in issue #7412.

The `refocus` method in `MainWindow` is made public so that it can be called from `Editor::closeEvent`. It has also been refactored for better readability.

---------

Co-authored-by: Michael Gregorius <michael.gregorius.git@arcor.de>
Co-authored-by: Dalton Messmer <messmer.dalton@gmail.com>
This commit is contained in:
firewall1110
2024-10-07 14:15:07 +03:00
committed by GitHub
parent 7dbc80926d
commit 639e122efe
4 changed files with 18 additions and 19 deletions

View File

@@ -56,7 +56,7 @@ protected:
DropToolBar * addDropToolBar(Qt::ToolBarArea whereToAdd, QString const & windowTitle);
DropToolBar * addDropToolBar(QWidget * parent, Qt::ToolBarArea whereToAdd, QString const & windowTitle);
void closeEvent( QCloseEvent * _ce ) override;
void closeEvent(QCloseEvent * event) override;
protected slots:
virtual void play() {}
virtual void record() {}

View File

@@ -72,6 +72,8 @@ public:
LMMS_EXPORT SubWindow* addWindowedWidget(QWidget *w, Qt::WindowFlags windowFlags = QFlag(0));
void refocus();
///
/// \brief Asks whether changes made to the project are to be saved.
///
@@ -195,7 +197,6 @@ private:
void finalize();
void toggleWindow( QWidget *window, bool forceShow = false );
void refocus();
void exportProject(bool multiExport = false);
void handleSaveResult(QString const & filename, bool songSavedSuccessfully);