LayoutSaver: Store the floating window flags too
(cherry-picked from commit c2208b169e)
This commit is contained in:
@@ -221,6 +221,7 @@ void to_json(nlohmann::json &json, const LayoutSaver::FloatingWindow &window)
|
||||
json["normalGeometry"] = window.normalGeometry;
|
||||
json["screenIndex"] = window.screenIndex;
|
||||
json["screenSize"] = window.screenSize;
|
||||
json["flags"] = window.flags;
|
||||
json["isVisible"] = window.isVisible;
|
||||
json["windowState"] = window.windowState;
|
||||
|
||||
@@ -238,6 +239,7 @@ void from_json(const nlohmann::json &json, LayoutSaver::FloatingWindow &window)
|
||||
window.screenIndex = json.value("screenIndex", 0);
|
||||
window.screenSize = json.value("screenSize", QSize(800, 600));
|
||||
window.isVisible = json.value("isVisible", false);
|
||||
window.flags = json.value("flags", -1);
|
||||
window.windowState = ( WindowState )json.value("windowState", 0);
|
||||
window.affinities = json.value("affinities", QStringList());
|
||||
|
||||
|
||||
@@ -74,6 +74,13 @@ static FloatingWindow::Flags flagsForFloatingWindow()
|
||||
if (Config::self().flags() & Config::Flag_AlwaysTitleBarWhenFloating)
|
||||
flags |= FloatingWindow::Flag::AlwaysTitleBarWhenFloating;
|
||||
|
||||
if (Config::self().internalFlags() & Config::InternalFlag_DontUseParentForFloatingWindows)
|
||||
flags |= FloatingWindow::Flag::DontUseParentForFloatingWindows;
|
||||
|
||||
if (Config::self().internalFlags()
|
||||
& Config::InternalFlag_DontUseQtToolWindowsForFloatingWindows)
|
||||
flags |= FloatingWindow::Flag::DontUseQtToolWindowsForFloatingWindows;
|
||||
|
||||
return flags;
|
||||
}
|
||||
|
||||
@@ -595,6 +602,7 @@ LayoutSaver::FloatingWindow FloatingWindow::serialize() const
|
||||
fw.screenSize = Platform::instance()->screenSizeFor(view());
|
||||
fw.affinities = affinities();
|
||||
fw.windowState = windowStateOverride();
|
||||
fw.flags = d->m_flags;
|
||||
|
||||
Window::Ptr transientParentWindow = view()->transientWindow();
|
||||
auto transientMainWindow = DockRegistry::self()->mainWindowForHandle(transientParentWindow);
|
||||
|
||||
@@ -44,7 +44,9 @@ public:
|
||||
KeepAboveIfNotUtilityWindow = 4,
|
||||
NativeTitleBar = 8,
|
||||
HideTitleBarWhenTabsVisible = 16,
|
||||
AlwaysTitleBarWhenFloating = 32
|
||||
AlwaysTitleBarWhenFloating = 32,
|
||||
DontUseParentForFloatingWindows = 64,
|
||||
DontUseQtToolWindowsForFloatingWindows = 128
|
||||
};
|
||||
Q_DECLARE_FLAGS(Flags, Flag);
|
||||
|
||||
|
||||
@@ -212,6 +212,7 @@ struct LayoutSaver::FloatingWindow
|
||||
QRect geometry;
|
||||
QRect normalGeometry;
|
||||
int screenIndex;
|
||||
int flags = -1;
|
||||
QSize screenSize; // for relative-size restoring
|
||||
bool isVisible = true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user