kde-plasma/kwin: 6.0.0 version bump

KDE-bug: https://bugs.kde.org/show_bug.cgi?id=481456
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
This commit is contained in:
Andreas Sturmlechner
2024-02-28 14:52:28 +01:00
parent f23a769295
commit e0d7c41fb2
3 changed files with 404 additions and 0 deletions
+1
View File
@@ -1,2 +1,3 @@
DIST kwin-5.27.10.tar.xz 7634568 BLAKE2B 13da6f83e55236d7060c3f1fcf4f8e2ff5ca0351ae8c5fe6f313a4a4872430a5c049c582993d8c7817b493477f918060220b6b2ccda2baea0d44eb34767e2fc9 SHA512 f9cfbad8eb97c26417e430424bd496bfa31f9e3c6953ab68a7cff467de8ad43bc10a764f47bd0ce3afe4d27d2cd981ba949d09ab3090dfcef9e7a77b5a918f71
DIST kwin-5.93.0.tar.xz 8823136 BLAKE2B 39ed7b8159c69b3b9da217b62536c63f8a81a6e193938cedf51d1bf196a3987d4be8f0ad42a8110511d13c222d65f2ea6819ffd70a304b1c78603b8011887cca SHA512 075c252bb50ecb7aaa72e386e29f423967b9b3ccf7e763b0fb07bdab745c48cff3f09f7029daa14d83cf576b8fb7f0064f2c9cb046f339c25f141781c30216b9
DIST kwin-6.0.0.tar.xz 8830980 BLAKE2B 5dd438bebdf8940c892ac0ca4fde77fe241f9905430a4906cebd8fe6187f3da05137fa98d6504a10cb175a12df89b8a2bd19d3b8e203db91d01b23a65968a1b5 SHA512 94fcb6b1e40a8dd17a21a123ea5ae9c058b8fc5f640baba4a3c1190d69e810a36e70cecd44e2602ab04cc5a850679eb55dd6841cc2bdf84df55ce527be26940e
@@ -0,0 +1,272 @@
From ebce0e3c3371fbc5a59955c91873edca1b6e4e79 Mon Sep 17 00:00:00 2001
From: David Edmundson <kde@davidedmundson.co.uk>
Date: Mon, 26 Feb 2024 10:32:49 +0000
Subject: [PATCH] x11window: Disable strict geometry placement by default in
wayland
Strict geometry disables certain user activites; full screen requests
and only sending configure events at sizes the client claims to support.
This was added as a workaround for xterm in 19 years ago. It's a client
side bug as applications can still choose to ignore the configure event,
so kwin shouldn't have to sanitise them in advance. xterm seems to have
fixed it's bug, and pragmatically we know not all window managers
perform these checks so most clients should not be relying on it.
On Wayland this additional check is proving problematic, the handling of
scaling especially fractional scaling is hitting cases where it's better
to always ask the client to do what kwin wants.
Tests that refer to sizeIncrements are dropped as they are only used in
the strict geometry passes which is being obsoleted. Resizing in general
is still tested.
BUG: 481456
(cherry picked from commit 32be54b19d24e3fafc3a50492b1ca48047a64103)
---
autotests/integration/x11_window_test.cpp | 171 ----------------------
src/x11window.cpp | 14 +-
2 files changed, 11 insertions(+), 174 deletions(-)
diff --git a/autotests/integration/x11_window_test.cpp b/autotests/integration/x11_window_test.cpp
index aa48b26d8d2..588b01e8141 100644
--- a/autotests/integration/x11_window_test.cpp
+++ b/autotests/integration/x11_window_test.cpp
@@ -35,8 +35,6 @@ private Q_SLOTS:
void testMinimumSize();
void testMaximumSize();
- void testResizeIncrements();
- void testResizeIncrementsNoBaseSize();
void testTrimCaption_data();
void testTrimCaption();
void testFullscreenLayerWithActiveWaylandWindow();
@@ -291,175 +289,6 @@ void X11WindowTest::testMaximumSize()
c.reset();
}
-void X11WindowTest::testResizeIncrements()
-{
- // This test verifies that the resize increments constraint is correctly applied.
- QFETCH_GLOBAL(qreal, scale);
- kwinApp()->setXwaylandScale(scale);
-
- // Create an xcb window.
- Test::XcbConnectionPtr c = Test::createX11Connection();
- QVERIFY(!xcb_connection_has_error(c.get()));
- const QRect windowGeometry(0, 0, 100, 200);
- xcb_window_t windowId = xcb_generate_id(c.get());
- xcb_create_window(c.get(), XCB_COPY_FROM_PARENT, windowId, rootWindow(),
- windowGeometry.x(),
- windowGeometry.y(),
- windowGeometry.width(),
- windowGeometry.height(),
- 0, XCB_WINDOW_CLASS_INPUT_OUTPUT, XCB_COPY_FROM_PARENT, 0, nullptr);
- xcb_size_hints_t hints;
- memset(&hints, 0, sizeof(hints));
- xcb_icccm_size_hints_set_position(&hints, 1, windowGeometry.x(), windowGeometry.y());
- xcb_icccm_size_hints_set_size(&hints, 1, windowGeometry.width(), windowGeometry.height());
- xcb_icccm_size_hints_set_base_size(&hints, windowGeometry.width(), windowGeometry.height());
- xcb_icccm_size_hints_set_resize_inc(&hints, 3, 5);
- xcb_icccm_set_wm_normal_hints(c.get(), windowId, &hints);
- xcb_map_window(c.get(), windowId);
- xcb_flush(c.get());
-
- QSignalSpy windowCreatedSpy(workspace(), &Workspace::windowAdded);
- QVERIFY(windowCreatedSpy.wait());
- X11Window *window = windowCreatedSpy.last().first().value<X11Window *>();
- QVERIFY(window);
- QVERIFY(window->isDecorated());
-
- QSignalSpy interactiveMoveResizeStartedSpy(window, &Window::interactiveMoveResizeStarted);
- QSignalSpy interactiveMoveResizeSteppedSpy(window, &Window::interactiveMoveResizeStepped);
- QSignalSpy interactiveMoveResizeFinishedSpy(window, &Window::interactiveMoveResizeFinished);
- QSignalSpy frameGeometryChangedSpy(window, &Window::frameGeometryChanged);
-
- // Begin resize.
- QCOMPARE(workspace()->moveResizeWindow(), nullptr);
- QVERIFY(!window->isInteractiveResize());
- workspace()->slotWindowResize();
- QCOMPARE(workspace()->moveResizeWindow(), window);
- QCOMPARE(interactiveMoveResizeStartedSpy.count(), 1);
- QVERIFY(window->isInteractiveResize());
-
- const QPointF cursorPos = KWin::Cursors::self()->mouse()->pos();
-
- window->keyPressEvent(Qt::Key_Right);
- window->updateInteractiveMoveResize(KWin::Cursors::self()->mouse()->pos());
- QCOMPARE(KWin::Cursors::self()->mouse()->pos(), cursorPos + QPoint(8, 0));
- QCOMPARE(interactiveMoveResizeSteppedSpy.count(), 1);
- QVERIFY(frameGeometryChangedSpy.wait());
-
- // 100 + 8 logical pixels, rounded to resize increments. This will differ on scale
- const qreal horizontalResizeInc = 3 / scale;
- const qreal verticalResizeInc = 5 / scale;
- const qreal expectedHorizontalResizeInc = std::floor(8. / horizontalResizeInc) * horizontalResizeInc;
- const qreal expectedVerticalResizeInc = std::floor(8. / verticalResizeInc) * verticalResizeInc;
-
- QCOMPARE(window->clientSize(), QSizeF(100, 200) / scale + QSizeF(expectedHorizontalResizeInc, 0));
-
- window->keyPressEvent(Qt::Key_Down);
- window->updateInteractiveMoveResize(KWin::Cursors::self()->mouse()->pos());
- QCOMPARE(KWin::Cursors::self()->mouse()->pos(), cursorPos + QPoint(8, 8));
- QCOMPARE(interactiveMoveResizeSteppedSpy.count(), 2);
- QVERIFY(frameGeometryChangedSpy.wait());
- QCOMPARE(window->clientSize(), QSize(100, 200) / scale + QSizeF(expectedHorizontalResizeInc, expectedVerticalResizeInc));
-
- // Finish the resize operation.
- QCOMPARE(interactiveMoveResizeFinishedSpy.count(), 0);
- window->keyPressEvent(Qt::Key_Enter);
- QCOMPARE(interactiveMoveResizeFinishedSpy.count(), 1);
- QCOMPARE(workspace()->moveResizeWindow(), nullptr);
- QVERIFY(!window->isInteractiveResize());
-
- // Destroy the window.
- QSignalSpy windowClosedSpy(window, &X11Window::closed);
- xcb_unmap_window(c.get(), windowId);
- xcb_destroy_window(c.get(), windowId);
- xcb_flush(c.get());
- QVERIFY(windowClosedSpy.wait());
- c.reset();
-}
-
-void X11WindowTest::testResizeIncrementsNoBaseSize()
-{
- QFETCH_GLOBAL(qreal, scale);
- kwinApp()->setXwaylandScale(scale);
-
- // Create an xcb window.
- Test::XcbConnectionPtr c = Test::createX11Connection();
- QVERIFY(!xcb_connection_has_error(c.get()));
- const QRect windowGeometry(0, 0, 100, 200);
- xcb_window_t windowId = xcb_generate_id(c.get());
- xcb_create_window(c.get(), XCB_COPY_FROM_PARENT, windowId, rootWindow(),
- windowGeometry.x(),
- windowGeometry.y(),
- windowGeometry.width(),
- windowGeometry.height(),
- 0, XCB_WINDOW_CLASS_INPUT_OUTPUT, XCB_COPY_FROM_PARENT, 0, nullptr);
- xcb_size_hints_t hints;
- memset(&hints, 0, sizeof(hints));
- xcb_icccm_size_hints_set_position(&hints, 1, windowGeometry.x(), windowGeometry.y());
- xcb_icccm_size_hints_set_size(&hints, 1, windowGeometry.width(), windowGeometry.height());
- xcb_icccm_size_hints_set_min_size(&hints, windowGeometry.width(), windowGeometry.height());
- xcb_icccm_size_hints_set_resize_inc(&hints, 3, 5);
- xcb_icccm_set_wm_normal_hints(c.get(), windowId, &hints);
- xcb_map_window(c.get(), windowId);
- xcb_flush(c.get());
-
- QSignalSpy windowCreatedSpy(workspace(), &Workspace::windowAdded);
- QVERIFY(windowCreatedSpy.wait());
- X11Window *window = windowCreatedSpy.last().first().value<X11Window *>();
- QVERIFY(window);
- QVERIFY(window->isDecorated());
-
- QSignalSpy interactiveMoveResizeStartedSpy(window, &Window::interactiveMoveResizeStarted);
- QSignalSpy interactiveMoveResizeSteppedSpy(window, &Window::interactiveMoveResizeStepped);
- QSignalSpy interactiveMoveResizeFinishedSpy(window, &Window::interactiveMoveResizeFinished);
- QSignalSpy frameGeometryChangedSpy(window, &Window::frameGeometryChanged);
-
- // Begin resize.
- QCOMPARE(workspace()->moveResizeWindow(), nullptr);
- QVERIFY(!window->isInteractiveResize());
- workspace()->slotWindowResize();
- QCOMPARE(workspace()->moveResizeWindow(), window);
- QCOMPARE(interactiveMoveResizeStartedSpy.count(), 1);
- QVERIFY(window->isInteractiveResize());
-
- const QPointF cursorPos = KWin::Cursors::self()->mouse()->pos();
-
- window->keyPressEvent(Qt::Key_Right);
- window->updateInteractiveMoveResize(KWin::Cursors::self()->mouse()->pos());
- QCOMPARE(KWin::Cursors::self()->mouse()->pos(), cursorPos + QPoint(8, 0));
- QCOMPARE(interactiveMoveResizeSteppedSpy.count(), 1);
- QVERIFY(frameGeometryChangedSpy.wait());
-
- // 100 + 8 pixels, rounded to resize increments. This will differ on scale
- const qreal horizontalResizeInc = 3 / scale;
- const qreal verticalResizeInc = 5 / scale;
- const qreal expectedHorizontalResizeInc = std::floor(8. / horizontalResizeInc) * horizontalResizeInc;
- const qreal expectedVerticalResizeInc = std::floor(8. / verticalResizeInc) * verticalResizeInc;
-
- QCOMPARE(window->clientSize(), QSizeF(100, 200) / scale + QSizeF(expectedHorizontalResizeInc, 0));
-
- window->keyPressEvent(Qt::Key_Down);
- window->updateInteractiveMoveResize(KWin::Cursors::self()->mouse()->pos());
- QCOMPARE(KWin::Cursors::self()->mouse()->pos(), cursorPos + QPoint(8, 8));
- QCOMPARE(interactiveMoveResizeSteppedSpy.count(), 2);
- QVERIFY(frameGeometryChangedSpy.wait());
- QCOMPARE(window->clientSize(), QSizeF(100, 200) / scale + QSizeF(expectedHorizontalResizeInc, expectedVerticalResizeInc));
-
- // Finish the resize operation.
- QCOMPARE(interactiveMoveResizeFinishedSpy.count(), 0);
- window->keyPressEvent(Qt::Key_Enter);
- QCOMPARE(interactiveMoveResizeFinishedSpy.count(), 1);
- QCOMPARE(workspace()->moveResizeWindow(), nullptr);
- QVERIFY(!window->isInteractiveResize());
-
- // Destroy the window.
- QSignalSpy windowClosedSpy(window, &X11Window::closed);
- xcb_unmap_window(c.get(), windowId);
- xcb_destroy_window(c.get(), windowId);
- xcb_flush(c.get());
- QVERIFY(windowClosedSpy.wait());
- c.reset();
-}
-
void X11WindowTest::testTrimCaption_data()
{
QFETCH_GLOBAL(qreal, scale);
diff --git a/src/x11window.cpp b/src/x11window.cpp
index e4ab708f472..9aa2056b1d0 100644
--- a/src/x11window.cpp
+++ b/src/x11window.cpp
@@ -1492,7 +1492,8 @@ bool X11Window::isFullScreenable() const
if (!rules()->checkFullScreen(true)) {
return false;
}
- if (rules()->checkStrictGeometry(true)) {
+ const bool isX11Mode = kwinApp()->operationMode() == Application::OperationModeX11;
+ if (rules()->checkStrictGeometry(isX11Mode)) {
// check geometry constraints (rule to obey is set)
const QRectF fullScreenArea = workspace()->clientArea(FullScreenArea, this);
const QSizeF constrainedClientSize = constrainClientSize(fullScreenArea.size());
@@ -3705,7 +3706,8 @@ QSizeF X11Window::constrainClientSize(const QSizeF &size, SizeMode mode) const
w = std::max(min_size.width(), w);
h = std::max(min_size.height(), h);
- if (!rules()->checkStrictGeometry(!isFullScreen())) {
+ const bool isX11Mode = kwinApp()->operationMode() == Application::OperationModeX11;
+ if (!rules()->checkStrictGeometry(!isFullScreen() && isX11Mode)) {
// Disobey increments and aspect by explicit rule.
return QSizeF(w, h);
}
@@ -3890,6 +3892,10 @@ QSizeF X11Window::maxSize() const
QSizeF X11Window::basicUnit() const
{
+ const bool isX11Mode = kwinApp()->operationMode() == Application::OperationModeX11;
+ if (!isX11Mode) {
+ return QSize(1, 1);
+ }
return m_geometryHints.resizeIncrements();
}
@@ -4457,9 +4463,11 @@ void X11Window::maximize(MaximizeMode mode)
// if the client insist on a fix aspect ratio, we check whether the maximizing will get us
// out of screen bounds and take that as a "full maximization with aspect check" then
+ const bool isX11Mode = kwinApp()->operationMode() == Application::OperationModeX11;
+
if (m_geometryHints.hasAspect() && // fixed aspect
(mode == MaximizeVertical || mode == MaximizeHorizontal) && // ondimensional maximization
- rules()->checkStrictGeometry(true)) { // obey aspect
+ rules()->checkStrictGeometry(isX11Mode)) { // obey aspect
const QSize minAspect = m_geometryHints.minAspect();
const QSize maxAspect = m_geometryHints.maxAspect();
if (mode == MaximizeVertical || (old_mode & MaximizeVertical)) {
--
GitLab
+131
View File
@@ -0,0 +1,131 @@
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
ECM_HANDBOOK="optional"
ECM_TEST="optional"
KFMIN=6.0
PVCUT=$(ver_cut 1-3)
QTMIN=6.6.2
inherit ecm plasma.kde.org
DESCRIPTION="Flexible, composited Window Manager for windowing systems on Linux"
LICENSE="GPL-2+"
SLOT="6"
KEYWORDS="~amd64"
IUSE="accessibility caps gles2-only lock multimedia screencast +shortcuts"
RESTRICT="test"
# qtbase slot up: GuiPrivate use in tabbox
COMMON_DEPEND="
>=dev-libs/libinput-1.19:=
>=dev-libs/wayland-1.22.0
>=dev-qt/qt5compat-${QTMIN}:6[qml]
>=dev-qt/qtbase-${QTMIN}:6=[accessibility,dbus,gles2-only=,gui,libinput,opengl,widgets]
>=dev-qt/qtdeclarative-${QTMIN}:6
>=dev-qt/qtsensors-${QTMIN}:6
>=dev-qt/qtshadertools-${QTMIN}:6
>=kde-frameworks/kauth-${KFMIN}:6
>=kde-frameworks/kcmutils-${KFMIN}:6
>=kde-frameworks/kconfig-${KFMIN}:6[qml]
>=kde-frameworks/kconfigwidgets-${KFMIN}:6
>=kde-frameworks/kcoreaddons-${KFMIN}:6
>=kde-frameworks/kcrash-${KFMIN}:6
>=kde-frameworks/kdbusaddons-${KFMIN}:6
>=kde-frameworks/kdeclarative-${KFMIN}:6
>=kde-frameworks/kglobalaccel-${KFMIN}:6=[X(+)]
>=kde-frameworks/kguiaddons-${KFMIN}:6[wayland]
>=kde-frameworks/ki18n-${KFMIN}:6
>=kde-frameworks/kidletime-${KFMIN}:6=[wayland]
>=kde-frameworks/knewstuff-${KFMIN}:6
>=kde-frameworks/knotifications-${KFMIN}:6
>=kde-frameworks/kpackage-${KFMIN}:6
>=kde-frameworks/kservice-${KFMIN}:6
>=kde-frameworks/ksvg-${KFMIN}:6
>=kde-frameworks/kwidgetsaddons-${KFMIN}:6
>=kde-frameworks/kwindowsystem-${KFMIN}:6=[wayland,X]
>=kde-frameworks/kxmlgui-${KFMIN}:6
>=kde-plasma/breeze-${PVCUT}:6
>=kde-plasma/kdecoration-${PVCUT}:6
>=kde-plasma/kwayland-${PVCUT}:6
>=kde-plasma/plasma-activities-${PVCUT}:6
media-libs/fontconfig
media-libs/freetype
media-libs/lcms:2
media-libs/libdisplay-info
media-libs/libepoxy
media-libs/libglvnd
>=media-libs/mesa-21.3[egl(+),gbm(+),wayland,X]
virtual/libudev:=
x11-libs/libX11
x11-libs/libXi
>=x11-libs/libdrm-2.4.112
>=x11-libs/libxcb-1.10:=
>=x11-libs/libxcvt-0.1.1
>=x11-libs/libxkbcommon-1.5.0
x11-libs/xcb-util-cursor
x11-libs/xcb-util-keysyms
x11-libs/xcb-util-wm
accessibility? ( media-libs/libqaccessibilityclient:6 )
gles2-only? ( media-libs/mesa[gles2] )
lock? ( >=kde-plasma/kscreenlocker-${PVCUT}:6 )
screencast? ( >=media-video/pipewire-0.3:= )
shortcuts? ( >=kde-plasma/kglobalacceld-${PVCUT}:6 )
"
RDEPEND="${COMMON_DEPEND}
!kde-plasma/kdeplasma-addons:5
!kde-plasma/kwayland-server
>=kde-frameworks/kirigami-${KFMIN}:6
>=kde-frameworks/kitemmodels-${KFMIN}:6
>=kde-plasma/libplasma-${PVCUT}:6[wayland]
sys-apps/hwdata
x11-base/xwayland
multimedia? (
>=dev-qt/qtmultimedia-${QTMIN}:6[gstreamer,qml]
media-plugins/gst-plugins-soup:1.0
)
"
DEPEND="${COMMON_DEPEND}
>=dev-libs/plasma-wayland-protocols-1.11.1
>=dev-libs/wayland-protocols-1.32
>=dev-qt/qttools-${QTMIN}:6[designer]
>=dev-qt/qtbase-${QTMIN}:6[concurrent]
>=dev-qt/qtwayland-${QTMIN}:6
x11-base/xorg-proto
x11-libs/xcb-util-image
caps? ( sys-libs/libcap )
test? ( screencast? ( >=kde-plasma/kpipewire-${PVCUT}:6 ) )
"
BDEPEND="
>=dev-qt/qtwayland-${QTMIN}:6
dev-util/wayland-scanner
>=kde-frameworks/kcmutils-${KFMIN}:6
"
PDEPEND=">=kde-plasma/kde-cli-tools-${PVCUT}:*"
PATCHES=( "${FILESDIR}/${P}-kdebug-481456.patch" ) # KDE-bug 481456
src_prepare() {
ecm_src_prepare
use multimedia || eapply "${FILESDIR}/${PN}-5.90.90-gstreamer-optional.patch"
# TODO: try to get a build switch upstreamed
if ! use screencast; then
sed -e "s/^pkg_check_modules.*PipeWire/#&/" -i CMakeLists.txt || die
fi
}
src_configure() {
local mycmakeargs=(
# KWIN_BUILD_NOTIFICATIONS exists, but kdeclarative still hard-depends on it
$(cmake_use_find_package accessibility QAccessibilityClient6)
$(cmake_use_find_package caps Libcap)
-DKWIN_BUILD_SCREENLOCKER=$(usex lock)
-DKWIN_BUILD_GLOBALSHORTCUTS=$(usex shortcuts)
)
ecm_src_configure
}