mirror of
https://invent.kde.org/plasma/layer-shell-qt.git
synced 2025-07-14 11:04:20 -04:00
Replace Window::desiredOutput with a Window::screenConfiguration enum
To not overlap with QWindow::screen too much, introduce an enum to make it more clear what the options and the resulting behaviour are.
This commit is contained in:
committed by
Vlad Zahorodnii
parent
511b92f4ab
commit
49f31bb22d
@ -34,7 +34,7 @@ public:
|
||||
Window::KeyboardInteractivity keyboardInteractivity = Window::KeyboardInteractivityExclusive;
|
||||
Window::Layer layer = Window::LayerTop;
|
||||
QMargins margins;
|
||||
std::optional<QPointer<QScreen>> desiredOutput;
|
||||
Window::ScreenConfiguration screenConfiguration = Window::ScreenFromQWindow;
|
||||
};
|
||||
|
||||
static QMap<QWindow *, Window *> s_map;
|
||||
@ -109,19 +109,14 @@ Window::Layer Window::layer() const
|
||||
return d->layer;
|
||||
}
|
||||
|
||||
QScreen *Window::desiredOutput() const
|
||||
Window::ScreenConfiguration Window::screenConfiguration() const
|
||||
{
|
||||
// Don't use .value_or here to avoid a temporary QPointer
|
||||
if (d->desiredOutput.has_value()) {
|
||||
return d->desiredOutput.value();
|
||||
}
|
||||
|
||||
return d->parentWindow->screen();
|
||||
return d->screenConfiguration;
|
||||
}
|
||||
|
||||
void Window::setDesiredOutput(QScreen *output)
|
||||
void Window::setScreenConfiguration(Window::ScreenConfiguration screenConfiguration)
|
||||
{
|
||||
d->desiredOutput = output;
|
||||
d->screenConfiguration = screenConfiguration;
|
||||
}
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 6, 0)
|
||||
|
Reference in New Issue
Block a user