Skip to content

Commit

Permalink
fix: [window]window state config lost
Browse files Browse the repository at this point in the history
there is a default window hidden while all filemanager windows closed, but the default window will save default window state to the config while it closed.

Log: fix window display issue
Bug: https://pms.uniontech.com/bug-view-211293.html
  • Loading branch information
Lighto-Ku authored and deepin-bot[bot] committed Jul 28, 2023
1 parent 2c878c3 commit e975c24
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/dfm-base/widgets/dfmwindow/filemanagerwindowsmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ void FileManagerWindowsManagerPrivate::onWindowClosed(FileManagerWindow *window)
return;

if (count == 1) { // last window
if (window->saveClosedSate())
auto isDefaultWindow = window->property("_dfm_isDefaultWindow");
if (window->saveClosedSate() && (!isDefaultWindow.isValid() || !isDefaultWindow.toBool()))
saveWindowState(window);
qInfo() << "Last window deletelater" << window->internalWinId();
emit manager->lastWindowClosed();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ void CoreHelper::cacheDefaultWindow()
qWarning() << "cache window failed";
return;
}
window->setProperty("_dfm_isDefaultWindow", true);
window->removeEventFilter(this);
// cache all UI components
QMetaObject::invokeMethod(window, "aboutToOpen", Qt::DirectConnection);
Expand Down

0 comments on commit e975c24

Please sign in to comment.