public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Jan Grulich <jgrulich@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/kwin-x11] rawhide: Fix build against Plasma 6.8
Date: Sun, 25 Oct 2026 08:05:42 GMT	[thread overview]
Message-ID: <179291554290.1.12802138245317573895.rpms-kwin-x11-f10c6d87b7d8@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/kwin-x11
Branch : rawhide
Commit : f10c6d87b7d8739e4ac81e26c4c838b51baeba28
Author : Jan Grulich <jgrulich@redhat.com>
Date   : 2026-10-25T09:05:31+01:00
Stats  : +373/-1 in 3 file(s)
URL    : https://src.fedoraproject.org/rpms/kwin-x11/c/f10c6d87b7d8739e4ac81e26c4c838b51baeba28?branch=rawhide

Log:
Fix build against Plasma 6.8

---
diff --git a/kwin-adapt-to-kglobalaccel-removal.patch b/kwin-adapt-to-kglobalaccel-removal.patch
new file mode 100644
index 0000000..ed1cba6
--- /dev/null
+++ b/kwin-adapt-to-kglobalaccel-removal.patch
@@ -0,0 +1,292 @@
+diff --git a/autotests/integration/CMakeLists.txt b/autotests/integration/CMakeLists.txt
+index 76b388f..2ee1294 100644
+--- a/autotests/integration/CMakeLists.txt
++++ b/autotests/integration/CMakeLists.txt
+@@ -54,10 +54,9 @@ target_link_libraries(KWinIntegrationTestFramework
+ if(KWIN_BUILD_X11)
+     target_link_libraries(KWinIntegrationTestFramework PRIVATE KWinXwaylandServerModule)
+ endif()
+-if(TARGET KF6GlobalAccelKWinPlugin)
+-    target_link_libraries(KWinIntegrationTestFramework PUBLIC KF6GlobalAccelKWinPlugin)
++if (KWIN_BUILD_GLOBALSHORTCUTS)
++    target_link_libraries(KWinIntegrationTestFramework PUBLIC KF6::GlobalAccel)
+ endif()
+-
+ if(TARGET PW::KScreenLocker)
+     target_link_libraries(KWinIntegrationTestFramework PUBLIC PW::KScreenLocker)
+ endif()
+diff --git a/autotests/integration/kwin_wayland_test.cpp b/autotests/integration/kwin_wayland_test.cpp
+index c48c321..7a2565d 100644
+--- a/autotests/integration/kwin_wayland_test.cpp
++++ b/autotests/integration/kwin_wayland_test.cpp
+@@ -39,9 +39,6 @@
+ #include <unistd.h>
+ 
+ Q_IMPORT_PLUGIN(KWinIntegrationPlugin)
+-#if KWIN_BUILD_GLOBALSHORTCUTS
+-Q_IMPORT_PLUGIN(KGlobalAccelImpl)
+-#endif
+ Q_IMPORT_PLUGIN(KWindowSystemKWinPlugin)
+ Q_IMPORT_PLUGIN(KWinIdleTimePoller)
+ 
+diff --git a/src/globalshortcuts.cpp b/src/globalshortcuts.cpp
+index b42fc0d..ffaf647 100644
+--- a/src/globalshortcuts.cpp
++++ b/src/globalshortcuts.cpp
+@@ -17,7 +17,6 @@
+ #include "utils/common.h"
+ // KDE
+ #if KWIN_BUILD_GLOBALSHORTCUTS
+-#include <kglobalaccel_interface.h>
+ #include <kglobalacceld.h>
+ #endif
+ // Qt
+@@ -100,14 +99,10 @@ void GlobalShortcutsManager::init()
+ {
+ #if KWIN_BUILD_GLOBALSHORTCUTS
+     if (kwinApp()->shouldUseWaylandForCompositing()) {
+-        qputenv("KGLOBALACCELD_PLATFORM", QByteArrayLiteral("org.kde.kwin"));
+         m_kglobalAccel = std::make_unique<KGlobalAccelD>();
+         if (!m_kglobalAccel->init()) {
+             qCDebug(KWIN_CORE) << "Init of kglobalaccel failed";
+             m_kglobalAccel.reset();
+-        } else {
+-            m_kglobalAccelInterface = m_kglobalAccel->interface();
+-            qCDebug(KWIN_CORE) << "KGlobalAcceld inited";
+         }
+     }
+ #endif
+@@ -195,34 +190,17 @@ void GlobalShortcutsManager::forceRegisterTouchscreenSwipe(SwipeDirection direct
+ bool GlobalShortcutsManager::processKey(Qt::KeyboardModifiers mods, int keyQt, KeyboardKeyState state)
+ {
+ #if KWIN_BUILD_GLOBALSHORTCUTS
+-    if (m_kglobalAccelInterface) {
+-        auto check = [this](Qt::KeyboardModifiers mods, int keyQt, KeyboardKeyState keyState) {
+-            bool retVal = false;
+-            QMetaObject::invokeMethod(m_kglobalAccelInterface,
+-                                      "checkKeyPressed",
+-                                      Qt::DirectConnection,
+-                                      Q_RETURN_ARG(bool, retVal),
+-                                      Q_ARG(int, int(mods) | keyQt),
+-                                      Q_ARG(KeyboardKeyState, keyState));
+-            return retVal;
+-        };
+-        if (check(mods, keyQt, state)) {
+-            return true;
+-        } else if (keyQt == Qt::Key_Backtab) {
+-            // KGlobalAccel on X11 has some workaround for Backtab
+-            // see kglobalaccel/src/runtime/plugins/xcb/kglobalccel_x11.cpp method x11KeyPress
+-            // Apparently KKeySequenceWidget captures Shift+Tab instead of Backtab
+-            // thus if the key is backtab we should adjust to add shift again and use tab
+-            // in addition KWin registers the shortcut incorrectly as Alt+Shift+Backtab
+-            // this should be changed to either Alt+Backtab or Alt+Shift+Tab to match KKeySequenceWidget
+-            // trying the variants
+-            if (check(mods | Qt::ShiftModifier, keyQt, state)) {
+-                return true;
+-            }
+-            if (check(mods | Qt::ShiftModifier, Qt::Key_Tab, state)) {
+-                return true;
+-            }
+-        }
++    if (!m_kglobalAccel) {
++        return false;
++    }
++
++    switch (state) {
++    case KWin::KeyboardKeyState::Pressed:
++        return m_kglobalAccel->keyEvent(int(mods) | keyQt, ShortcutKeyState::Pressed);
++    case KWin::KeyboardKeyState::Repeated:
++        return m_kglobalAccel->keyEvent(int(mods) | keyQt, ShortcutKeyState::Repeated);
++    case KWin::KeyboardKeyState::Released:
++        return m_kglobalAccel->keyEvent(int(mods) | keyQt, ShortcutKeyState::Released);
+     }
+ #endif
+     return false;
+@@ -248,11 +226,8 @@ bool GlobalShortcutsManager::processPointerPressed(Qt::KeyboardModifiers mods, Q
+ #if KWIN_BUILD_GLOBALSHORTCUTS
+     // currently only used to better support modifier only shortcuts
+     // modifier-only shortcuts are not triggered if a pointer button is pressed
+-    if (m_kglobalAccelInterface) {
+-        QMetaObject::invokeMethod(m_kglobalAccelInterface,
+-                                  "checkPointerPressed",
+-                                  Qt::DirectConnection,
+-                                  Q_ARG(Qt::MouseButtons, pointerButtons));
++    if (m_kglobalAccel) {
++        m_kglobalAccel->pointerPressed(pointerButtons);
+     }
+ #endif
+     return match<PointerButtonShortcut>(m_shortcuts, mods, pointerButtons);
+@@ -263,11 +238,8 @@ bool GlobalShortcutsManager::processAxis(Qt::KeyboardModifiers mods, PointerAxis
+ #if KWIN_BUILD_GLOBALSHORTCUTS
+     // currently only used to better support modifier only shortcuts
+     // modifier-only shortcuts are not triggered if a pointer axis is used
+-    if (m_kglobalAccelInterface) {
+-        QMetaObject::invokeMethod(m_kglobalAccelInterface,
+-                                  "checkAxisTriggered",
+-                                  Qt::DirectConnection,
+-                                  Q_ARG(int, axis));
++    if (m_kglobalAccel) {
++        m_kglobalAccel->axisTriggered(axis);
+     }
+ #endif
+     return match<PointerAxisShortcut>(m_shortcuts, mods, axis);
+diff --git a/src/globalshortcuts.h b/src/globalshortcuts.h
+index b577ed5..bf23e50 100644
+--- a/src/globalshortcuts.h
++++ b/src/globalshortcuts.h
+@@ -19,7 +19,6 @@
+ class QAction;
+ #if KWIN_BUILD_GLOBALSHORTCUTS
+ class KGlobalAccelD;
+-class KGlobalAccelInterface;
+ #endif
+ namespace KWin
+ {
+@@ -119,7 +118,6 @@ private:
+ 
+ #if KWIN_BUILD_GLOBALSHORTCUTS
+     std::unique_ptr<KGlobalAccelD> m_kglobalAccel;
+-    KGlobalAccelInterface *m_kglobalAccelInterface = nullptr;
+ #endif
+     std::unique_ptr<GestureRecognizer> m_touchpadGestureRecognizer;
+     std::unique_ptr<GestureRecognizer> m_touchscreenGestureRecognizer;
+diff --git a/src/input.h b/src/input.h
+index d3ea887..960c96e 100644
+--- a/src/input.h
++++ b/src/input.h
+@@ -22,7 +22,6 @@
+ 
+ #include <functional>
+ 
+-class KGlobalAccelInterface;
+ class QAction;
+ class QKeySequence;
+ class QMouseEvent;
+diff --git a/src/plugins/CMakeLists.txt b/src/plugins/CMakeLists.txt
+index 1213f72..ec51a25 100644
+--- a/src/plugins/CMakeLists.txt
++++ b/src/plugins/CMakeLists.txt
+@@ -108,9 +108,6 @@ add_subdirectory(zoom)
+ if (KWIN_BUILD_RUNNERS)
+     add_subdirectory(krunner-integration)
+ endif()
+-if(TARGET K::KGlobalAccelD)
+-    add_subdirectory(kglobalaccel)
+-endif()
+ if (KWIN_BUILD_NIGHTLIGHT)
+     add_subdirectory(nightlight)
+ endif()
+diff --git a/src/plugins/kglobalaccel/CMakeLists.txt b/src/plugins/kglobalaccel/CMakeLists.txt
+deleted file mode 100644
+index 6b1e53a..0000000
+--- a/src/plugins/kglobalaccel/CMakeLists.txt
++++ /dev/null
+@@ -1,3 +0,0 @@
+-add_library(KF6GlobalAccelKWinPlugin OBJECT kglobalaccel_plugin.cpp)
+-target_compile_definitions(KF6GlobalAccelKWinPlugin PRIVATE QT_STATICPLUGIN)
+-target_link_libraries(KF6GlobalAccelKWinPlugin K::KGlobalAccelD kwin)
+diff --git a/src/plugins/kglobalaccel/kglobalaccel_plugin.cpp b/src/plugins/kglobalaccel/kglobalaccel_plugin.cpp
+deleted file mode 100644
+index 8fa2c79..0000000
+--- a/src/plugins/kglobalaccel/kglobalaccel_plugin.cpp
++++ /dev/null
+@@ -1,51 +0,0 @@
+-/*
+-    KWin - the KDE window manager
+-    This file is part of the KDE project.
+-
+-    SPDX-FileCopyrightText: 2015 Martin Gräßlin <mgraesslin@kde.org>
+-
+-    SPDX-License-Identifier: GPL-2.0-or-later
+-*/
+-#include "kglobalaccel_plugin.h"
+-
+-#include "input.h"
+-
+-#include <QDebug>
+-
+-KGlobalAccelImpl::KGlobalAccelImpl(QObject *parent)
+-    : KGlobalAccelInterface(parent)
+-{
+-}
+-
+-KGlobalAccelImpl::~KGlobalAccelImpl() = default;
+-
+-bool KGlobalAccelImpl::grabKey(int key, bool grab)
+-{
+-    return true;
+-}
+-
+-bool KGlobalAccelImpl::checkKeyPressed(int keyQt, KWin::KeyboardKeyState state)
+-{
+-    switch (state) {
+-    case KWin::KeyboardKeyState::Pressed:
+-        return keyEvent(keyQt, ShortcutKeyState::Pressed);
+-    case KWin::KeyboardKeyState::Repeated:
+-        return keyEvent(keyQt, ShortcutKeyState::Repeated);
+-    case KWin::KeyboardKeyState::Released:
+-        return keyEvent(keyQt, ShortcutKeyState::Released);
+-    }
+-
+-    return false;
+-}
+-
+-bool KGlobalAccelImpl::checkPointerPressed(Qt::MouseButtons buttons)
+-{
+-    return pointerPressed(buttons);
+-}
+-
+-bool KGlobalAccelImpl::checkAxisTriggered(int axis)
+-{
+-    return axisTriggered(axis);
+-}
+-
+-#include "moc_kglobalaccel_plugin.cpp"
+diff --git a/src/plugins/kglobalaccel/kglobalaccel_plugin.h b/src/plugins/kglobalaccel/kglobalaccel_plugin.h
+deleted file mode 100644
+index 64d2df2..0000000
+--- a/src/plugins/kglobalaccel/kglobalaccel_plugin.h
++++ /dev/null
+@@ -1,33 +0,0 @@
+-/*
+-    KWin - the KDE window manager
+-    This file is part of the KDE project.
+-
+-    SPDX-FileCopyrightText: 2015 Martin Gräßlin <mgraesslin@kde.org>
+-
+-    SPDX-License-Identifier: GPL-2.0-or-later
+-*/
+-#pragma once
+-
+-#include "core/inputdevice.h"
+-
+-#include <kglobalaccel_interface.h>
+-
+-#include <QObject>
+-
+-class KGlobalAccelImpl : public KGlobalAccelInterface
+-{
+-    Q_OBJECT
+-    Q_PLUGIN_METADATA(IID KGlobalAccelInterface_iid FILE "kwin.json")
+-    Q_INTERFACES(KGlobalAccelInterface)
+-
+-public:
+-    KGlobalAccelImpl(QObject *parent = nullptr);
+-    ~KGlobalAccelImpl() override;
+-
+-    bool grabKey(int key, bool grab) override;
+-
+-public Q_SLOTS:
+-    bool checkKeyPressed(int keyQt, KWin::KeyboardKeyState state);
+-    bool checkPointerPressed(Qt::MouseButtons buttons);
+-    bool checkAxisTriggered(int axis);
+-};
+diff --git a/src/plugins/kglobalaccel/kwin.json b/src/plugins/kglobalaccel/kwin.json
+deleted file mode 100644
+index 0a2fc35..0000000
+--- a/src/plugins/kglobalaccel/kwin.json
++++ /dev/null
+@@ -1,3 +0,0 @@
+-{
+-    "platforms": ["org.kde.kwin"]
+-}

diff --git a/kwin-fix-lockscreen.patch b/kwin-fix-lockscreen.patch
new file mode 100644
index 0000000..f27946d
--- /dev/null
+++ b/kwin-fix-lockscreen.patch
@@ -0,0 +1,78 @@
+diff --git a/src/wayland_server.cpp b/src/wayland_server.cpp
+index 432f21e..7c2d9be 100644
+--- a/src/wayland_server.cpp
++++ b/src/wayland_server.cpp
+@@ -618,10 +618,6 @@ void WaylandServer::initScreenLocker()
+ 
+     ScreenLocker::KSldApp::self()->setGreeterEnvironment(kwinApp()->processStartupEnvironment());
+ 
+-    connect(ScreenLocker::KSldApp::self(), &ScreenLocker::KSldApp::aboutToLock, this, [this]() {
+-        new LockScreenPresentationWatcher(this);
+-    });
+-
+     connect(ScreenLocker::KSldApp::self(), &ScreenLocker::KSldApp::aboutToStartGreeter, this, [this]() {
+         if (m_screenLockerClientConnection) {
+             m_screenLockerClientConnection->destroy();
+@@ -773,7 +769,7 @@ bool WaylandServer::isScreenLocked() const
+     if (!kwinApp()->supportsLockScreen()) {
+         return false;
+     }
+-    return ScreenLocker::KSldApp::self()->lockState() == ScreenLocker::KSldApp::Locked || ScreenLocker::KSldApp::self()->lockState() == ScreenLocker::KSldApp::AcquiringLock;
++    return ScreenLocker::KSldApp::self()->lockState() == ScreenLocker::KSldApp::Locked;
+ #else
+     return false;
+ #endif
+@@ -836,33 +832,6 @@ void WaylandServer::setRenderBackend(RenderBackend *backend)
+     }
+ }
+ 
+-#if KWIN_BUILD_SCREENLOCKER
+-WaylandServer::LockScreenPresentationWatcher::LockScreenPresentationWatcher(WaylandServer *server)
+-{
+-    connect(ScreenLocker::KSldApp::self(), &ScreenLocker::KSldApp::unlocked, this, [this] {
+-        delete this;
+-    });
+-    connect(server, &WaylandServer::windowAdded, this, [this](Window *window) {
+-        if (window->isLockScreen()) {
+-            // only signal lockScreenShown once all outputs have been presented at least once
+-            connect(window->output()->renderLoop(), &RenderLoop::framePresented, this, [this, windowGuard = QPointer(window)]() {
+-                // window might be destroyed before a frame is presented, so it's wrapped in QPointer
+-                if (windowGuard) {
+-                    m_signaledOutputs << windowGuard->output();
+-                    if (m_signaledOutputs.size() == workspace()->outputs().size()) {
+-                        ScreenLocker::KSldApp::self()->lockScreenShown();
+-                        delete this;
+-                    }
+-                }
+-            });
+-        }
+-    });
+-    QTimer::singleShot(1000, this, [this]() {
+-        ScreenLocker::KSldApp::self()->lockScreenShown();
+-        delete this;
+-    });
+-}
+-#endif
+ }
+ 
+ #include "moc_wayland_server.cpp"
+diff --git a/src/wayland_server.h b/src/wayland_server.h
+index 4d35719..40df752 100644
+--- a/src/wayland_server.h
++++ b/src/wayland_server.h
+@@ -242,15 +242,6 @@ private:
+     void handleOutputEnabled(Output *output);
+     void handleOutputDisabled(Output *output);
+ 
+-    class LockScreenPresentationWatcher : public QObject
+-    {
+-    public:
+-        LockScreenPresentationWatcher(WaylandServer *server);
+-
+-    private:
+-        QSet<Output *> m_signaledOutputs;
+-    };
+-
+     Display *m_display = nullptr;
+     CompositorInterface *m_compositor = nullptr;
+     SeatInterface *m_seat = nullptr;

diff --git a/kwin-x11.spec b/kwin-x11.spec
index e6ff716..49ae61e 100644
--- a/kwin-x11.spec
+++ b/kwin-x11.spec
@@ -17,6 +17,8 @@ Source0: https://download.kde.org/%{stable}/plasma/%{plasma_version}/%{name}-%{v
 Source1: https://download.kde.org/%{stable}/plasma/%{plasma_version}/%{name}-%{version}.tar.xz.sig
 
 ## upstream patches
+Patch:   kwin-adapt-to-kglobalaccel-removal.patch
+Patch:   kwin-fix-lockscreen.patch
 
 ## proposed patches
 
@@ -177,7 +179,7 @@ developing applications that use %{name}.
 
 
 %prep
-%setup -q
+%autosetup -p1
 
 
 %build

                 reply	other threads:[~2026-10-25  8:05 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179291554290.1.12802138245317573895.rpms-kwin-x11-f10c6d87b7d8@fedoraproject.org \
    --to=jgrulich@redhat.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox