Backport fix for multi-screen sddm

epel9
Alessandro Astone 2 years ago
parent 0a98946212
commit 887a64334c

@ -0,0 +1,53 @@
From 3c85e2e8899d1253430783a618d7584d985bd614 Mon Sep 17 00:00:00 2001
From: Fabian Vogt <fabian@ritter-vogt.de>
Date: Tue, 21 Feb 2023 16:03:51 +0100
Subject: [PATCH] Use the QScreen of the QWindow as default output
If the Window::setDesiredOutput API was not called for the QWindow, use
QWindow::screen(). This allows assigning QWindows to specific screens using
the plain Qt API.
Passing nullptr to Window::setDesiredOutput explicitly results in nil as
desired output for the layer, which lets the compositor select a screen.
---
src/interfaces/window.cpp | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/src/interfaces/window.cpp b/src/interfaces/window.cpp
index 477b74e..7aa39f4 100644
--- a/src/interfaces/window.cpp
+++ b/src/interfaces/window.cpp
@@ -8,6 +8,7 @@
#include <layershellqt_logging.h>
#include <QPointer>
+#include <optional>
using namespace LayerShellQt;
@@ -26,7 +27,7 @@ public:
Window::KeyboardInteractivity keyboardInteractivity = Window::KeyboardInteractivityExclusive;
Window::Layer layer = Window::LayerTop;
QMargins margins;
- QPointer<QScreen> desiredOutput;
+ std::optional<QPointer<QScreen>> desiredOutput;
};
static QMap<QWindow *, Window *> s_map;
@@ -103,7 +104,12 @@ Window::Layer Window::layer() const
QScreen *Window::desiredOutput() const
{
- return d->desiredOutput;
+ // Don't use .value_or here to avoid a temporary QPointer
+ if (d->desiredOutput.has_value()) {
+ return d->desiredOutput.value();
+ }
+
+ return d->parentWindow->screen();
}
void Window::setDesiredOutput(QScreen *output)
--
GitLab

@ -1,6 +1,6 @@
Name: layer-shell-qt
Version: 5.27.1
Release: 1%{?dist}
Release: 2%{?dist}
Summary: Library to easily use clients based on wlr-layer-shell
License: LGPLv3+
@ -14,6 +14,9 @@ URL: https://invent.kde.org/plasma/%{name}
%endif
Source0: http://download.kde.org/%{stable}/plasma/%{version}/%{name}-%{version}.tar.xz
# Upstream PR: https://invent.kde.org/plasma/layer-shell-qt/-/merge_requests/26
Patch0: fix-sddm-multi-screen.patch
BuildRequires: extra-cmake-modules >= 5.82
BuildRequires: qt5-qtbase-devel
@ -43,7 +46,7 @@ Requires: cmake(Qt5Gui) >= 5.15.0
%prep
%autosetup
%autosetup -p1
%build
@ -68,6 +71,9 @@ Requires: cmake(Qt5Gui) >= 5.15.0
%changelog
* Fri Feb 24 2023 Alessandro Astone <ales.astone@gmail.com> - 5.27.1-2
- Backport fix for multi-screen sddm
* Tue Feb 21 2023 Marc Deop i Argemí <marcdeop@fedoraproject.org> - 5.27.1-1
- 5.27.1

Loading…
Cancel
Save