summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Sturmlechner <asturm@gentoo.org>2023-11-10 22:17:46 +0100
committerAndreas Sturmlechner <asturm@gentoo.org>2023-11-11 09:36:20 +0100
commit67f76e16dd6a1e9038fcc22317bf761f1a128140 (patch)
treea9f0d2a66fd42bf40fa94eb6bd7b521271add687 /kde-plasma/kwin
parentkde-plasma/kwin: Depend on dev-qt/qtgui[accessibility] (diff)
downloadgentoo-67f76e16dd6a1e9038fcc22317bf761f1a128140.tar.gz
gentoo-67f76e16dd6a1e9038fcc22317bf761f1a128140.tar.bz2
gentoo-67f76e16dd6a1e9038fcc22317bf761f1a128140.zip
kde-plasma/kwin: xdgshellwindow: enforce a minimum size for clients
KDE-Bug: https://bugs.kde.org/469237 Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
Diffstat (limited to 'kde-plasma/kwin')
-rw-r--r--kde-plasma/kwin/files/kwin-5.27.9-xdgshellwindow-enforce-min-size.patch71
-rw-r--r--kde-plasma/kwin/kwin-5.27.9-r1.ebuild2
2 files changed, 73 insertions, 0 deletions
diff --git a/kde-plasma/kwin/files/kwin-5.27.9-xdgshellwindow-enforce-min-size.patch b/kde-plasma/kwin/files/kwin-5.27.9-xdgshellwindow-enforce-min-size.patch
new file mode 100644
index 000000000000..471a37a3e0bd
--- /dev/null
+++ b/kde-plasma/kwin/files/kwin-5.27.9-xdgshellwindow-enforce-min-size.patch
@@ -0,0 +1,71 @@
+From 0900264e6f538ff915186b1bd9e528e568b28c1d Mon Sep 17 00:00:00 2001
+From: Xaver Hugl <xaver.hugl@gmail.com>
+Date: Wed, 23 Aug 2023 21:51:18 +0200
+Subject: [PATCH] xdgshellwindow: enforce a minimum size for clients
+
+It doesn't make sense for a window to become 1x1 pixels small. When we have
+server side decorations we also know that the decoration takes a lot of
+space, so this commit enforces a bigger minimum size for decorated windows
+
+BUG: 469237
+
+
+(cherry picked from commit 28c27609a4b45cf08b53dcc7dfe90f23c3338797)
+---
+ autotests/integration/xdgshellwindow_test.cpp | 8 ++++----
+ src/xdgshellwindow.cpp | 3 ++-
+ 2 files changed, 6 insertions(+), 5 deletions(-)
+
+diff --git a/autotests/integration/xdgshellwindow_test.cpp b/autotests/integration/xdgshellwindow_test.cpp
+index 70716e49434..53489a27f6b 100644
+--- a/autotests/integration/xdgshellwindow_test.cpp
++++ b/autotests/integration/xdgshellwindow_test.cpp
+@@ -375,12 +375,12 @@ void TestXdgShellWindow::testFullscreen()
+ QVERIFY(surfaceConfigureRequestedSpy.wait());
+
+ shellSurface->xdgSurface()->ack_configure(surfaceConfigureRequestedSpy.last().at(0).value<quint32>());
+- auto window = Test::renderAndWaitForShown(surface.get(), QSize(100, 50), Qt::blue);
++ auto window = Test::renderAndWaitForShown(surface.get(), QSize(500, 250), Qt::blue);
+ QVERIFY(window);
+ QVERIFY(window->isActive());
+ QCOMPARE(window->layer(), NormalLayer);
+ QVERIFY(!window->isFullScreen());
+- QCOMPARE(window->clientSize(), QSize(100, 50));
++ QCOMPARE(window->clientSize(), QSize(500, 250));
+ QCOMPARE(window->isDecorated(), decoMode == Test::XdgToplevelDecorationV1::mode_server_side);
+ QCOMPARE(window->clientSizeToFrameSize(window->clientSize()), window->size());
+
+@@ -417,14 +417,14 @@ void TestXdgShellWindow::testFullscreen()
+ QCOMPARE(surfaceConfigureRequestedSpy.count(), 4);
+ states = toplevelConfigureRequestedSpy.last().at(1).value<Test::XdgToplevel::States>();
+ QVERIFY(!(states & Test::XdgToplevel::State::Fullscreen));
+- QCOMPARE(toplevelConfigureRequestedSpy.last().at(0).value<QSize>(), QSize(100, 50));
++ QCOMPARE(toplevelConfigureRequestedSpy.last().at(0).value<QSize>(), QSize(500, 250));
+
+ shellSurface->xdgSurface()->ack_configure(surfaceConfigureRequestedSpy.last().at(0).value<quint32>());
+ Test::render(surface.get(), toplevelConfigureRequestedSpy.last().at(0).value<QSize>(), Qt::blue);
+
+ QVERIFY(fullScreenChangedSpy.wait());
+ QCOMPARE(fullScreenChangedSpy.count(), 2);
+- QCOMPARE(window->clientSize(), QSize(100, 50));
++ QCOMPARE(window->clientSize(), QSize(500, 250));
+ QVERIFY(!window->isFullScreen());
+ QCOMPARE(window->isDecorated(), decoMode == Test::XdgToplevelDecorationV1::mode_server_side);
+ QCOMPARE(window->layer(), NormalLayer);
+diff --git a/src/xdgshellwindow.cpp b/src/xdgshellwindow.cpp
+index 34201bdd05b..29d8623cac3 100644
+--- a/src/xdgshellwindow.cpp
++++ b/src/xdgshellwindow.cpp
+@@ -600,7 +600,8 @@ MaximizeMode XdgToplevelWindow::requestedMaximizeMode() const
+
+ QSizeF XdgToplevelWindow::minSize() const
+ {
+- return rules()->checkMinSize(m_shellSurface->minimumSize());
++ const int enforcedMinimum = m_nextDecoration ? 150 : 20;
++ return rules()->checkMinSize(QSize(std::max(enforcedMinimum, m_shellSurface->minimumSize().width()), std::max(enforcedMinimum, m_shellSurface->minimumSize().height())));
+ }
+
+ QSizeF XdgToplevelWindow::maxSize() const
+--
+GitLab
+
diff --git a/kde-plasma/kwin/kwin-5.27.9-r1.ebuild b/kde-plasma/kwin/kwin-5.27.9-r1.ebuild
index 8f4aa4f45ebd..348e6879fbc6 100644
--- a/kde-plasma/kwin/kwin-5.27.9-r1.ebuild
+++ b/kde-plasma/kwin/kwin-5.27.9-r1.ebuild
@@ -100,6 +100,8 @@ BDEPEND="
"
PDEPEND=">=kde-plasma/kde-cli-tools-${PVCUT}:5"
+PATCHES=( "${FILESDIR}/${P}-xdgshellwindow-enforce-min-size.patch" ) # KDE-bug 469237
+
src_prepare() {
ecm_src_prepare
use multimedia || eapply "${FILESDIR}/${PN}-5.26.80-gstreamer-optional.patch"