Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package kguiaddons for openSUSE:Factory checked in at 2022-10-11 17:59:56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/kguiaddons (Old) and /work/SRC/openSUSE:Factory/.kguiaddons.new.2275 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "kguiaddons" Tue Oct 11 17:59:56 2022 rev:107 rq:1008996 version:5.99.0 Changes: -------- --- /work/SRC/openSUSE:Factory/kguiaddons/kguiaddons.changes 2022-09-13 15:10:13.660784256 +0200 +++ /work/SRC/openSUSE:Factory/.kguiaddons.new.2275/kguiaddons.changes 2022-10-11 18:01:46.785719136 +0200 @@ -1,0 +2,17 @@ +Sat Oct 1 15:55:46 UTC 2022 - Christophe Giboudeaux <christo...@krop.fr> + +- Update to 5.99.0 + * New feature release + * For more details please see: + * https://kde.org/announcements/frameworks/5/5.99.0 +- Changes since 5.98.0: + * Show all headers in qtc6 + * KeySequenceRecorder: Do not emit gotKeySequence when cancelling + * Add Qt6 windows CI support + * .gitlab-ci.yml: enable static builds + * recorder: Allow setting the initial value of currentKeySequence + * recorder: Fix workaround in KDeclarative + * recorder: Do not keep two sequences at the same time (kde#458795) + * recorder: Never request inhibition twice for the same surface or seat + +------------------------------------------------------------------- Old: ---- kguiaddons-5.98.0.tar.xz kguiaddons-5.98.0.tar.xz.sig New: ---- kguiaddons-5.99.0.tar.xz kguiaddons-5.99.0.tar.xz.sig ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ kguiaddons.spec ++++++ --- /var/tmp/diff_new_pack.XkwQSb/_old 2022-10-11 18:01:47.241719873 +0200 +++ /var/tmp/diff_new_pack.XkwQSb/_new 2022-10-11 18:01:47.245719880 +0200 @@ -17,7 +17,7 @@ %define lname libKF5GuiAddons5 -%define _tar_path 5.98 +%define _tar_path 5.99 # Full KF5 version (e.g. 5.33.0) %{!?_kf5_version: %global _kf5_version %{version}} # Last major and minor KF5 version (e.g. 5.33) @@ -25,7 +25,7 @@ # Only needed for the package signature condition %bcond_without released Name: kguiaddons -Version: 5.98.0 +Version: 5.99.0 Release: 0 Summary: Utilities for graphical user interfaces License: LGPL-2.1-or-later ++++++ kguiaddons-5.98.0.tar.xz -> kguiaddons-5.99.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kguiaddons-5.98.0/.gitlab-ci.yml new/kguiaddons-5.99.0/.gitlab-ci.yml --- old/kguiaddons-5.98.0/.gitlab-ci.yml 2022-09-05 11:26:16.000000000 +0200 +++ new/kguiaddons-5.99.0/.gitlab-ci.yml 2022-10-01 15:16:36.000000000 +0200 @@ -3,10 +3,13 @@ include: - https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/linux.yml + - https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/linux-static.yml - https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/android.yml - https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/freebsd.yml - https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/linux-qt6.yml - https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/android-qt6.yml - https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/windows.yml + - https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/windows-static.yml - https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/freebsd-qt6.yml - https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/freebsd-qt6.yml + - https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/windows-qt6.yml diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kguiaddons-5.98.0/CMakeLists.txt new/kguiaddons-5.99.0/CMakeLists.txt --- old/kguiaddons-5.98.0/CMakeLists.txt 2022-09-05 11:26:16.000000000 +0200 +++ new/kguiaddons-5.99.0/CMakeLists.txt 2022-10-01 15:16:36.000000000 +0200 @@ -1,10 +1,10 @@ cmake_minimum_required(VERSION 3.16) -set(KF_VERSION "5.98.0") # handled by release scripts +set(KF_VERSION "5.99.0") # handled by release scripts project(KGuiAddons VERSION ${KF_VERSION}) include(FeatureSummary) -find_package(ECM 5.98.0 NO_MODULE) +find_package(ECM 5.99.0 NO_MODULE) set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake Modules." URL "https://commits.kde.org/extra-cmake-modules") feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kguiaddons-5.98.0/autotests/keysequencerecordertest.cpp new/kguiaddons-5.99.0/autotests/keysequencerecordertest.cpp --- old/kguiaddons-5.98.0/autotests/keysequencerecordertest.cpp 2022-09-05 11:26:16.000000000 +0200 +++ new/kguiaddons-5.99.0/autotests/keysequencerecordertest.cpp 2022-10-01 15:16:36.000000000 +0200 @@ -34,7 +34,7 @@ recorder.setWindow(m_window); recorder.startRecording(); - QCOMPARE(recordingSpy.count(), 1); + QCOMPARE(recordingSpy.count(), 2); QVERIFY(recorder.isRecording()); } @@ -159,11 +159,11 @@ recorder.setMultiKeyShortcutsAllowed(false); recorder.startRecording(); QVERIFY(recorder.isRecording()); - QCOMPARE(recordingSpy.count(), 3); + QCOMPARE(recordingSpy.count(), 4); QTest::keyPress(m_window, Qt::Key_A, Qt::ControlModifier); QCOMPARE(recorder.currentKeySequence(), QKeySequence(Qt::Key_A | Qt::ControlModifier)); QVERIFY(!recorder.isRecording()); - QCOMPARE(recordingSpy.count(), 4); + QCOMPARE(recordingSpy.count(), 5); QCOMPARE(resultSpy.count(), 1); QCOMPARE(resultSpy.takeAt(0).at(0).value<QKeySequence>(), QKeySequence(Qt::Key_A | Qt::ControlModifier)); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kguiaddons-5.98.0/src/CMakeLists.txt new/kguiaddons-5.99.0/src/CMakeLists.txt --- old/kguiaddons-5.98.0/src/CMakeLists.txt 2022-09-05 11:26:16.000000000 +0200 +++ new/kguiaddons-5.99.0/src/CMakeLists.txt 2022-10-01 15:16:36.000000000 +0200 @@ -27,6 +27,24 @@ recorder/keysequencerecorder.cpp systemclipboard/qtclipboard.cpp systemclipboard/ksystemclipboard.cpp + + colors/kcolorspaces_p.h + colors/kcolorutils.h + colors/kcolorcollection.h + colors/kcolormimedata.h + text/kdatevalidator.h + text/kwordwrap.h + fonts/kfontutils.h + util/kiconutils.h + util/klocalimagecacheimpl.h + util/kmodifierkeyinfo.h + util/kmodifierkeyinfoprovider_p.h + util/kurlhandler_p.h + util/kcursorsaver.h + recorder/keyboardgrabber_p.h + recorder/keysequencerecorder.h + systemclipboard/qtclipboard_p.h + systemclipboard/ksystemclipboard.h ) ecm_qt_declare_logging_category(KF5GuiAddons @@ -67,13 +85,16 @@ recorder/waylandinhibition.cpp systemclipboard/waylandclipboard.cpp util/kmodifierkeyinfoprovider_wayland.cpp + recorder/waylandinhibition_p.h + systemclipboard/waylandclipboard_p.h + util/kmodifierkeyinfoprovider_wayland.h ) target_compile_definitions(KF5GuiAddons PRIVATE WITH_WAYLAND) target_link_libraries(KF5GuiAddons PRIVATE Qt${QT_MAJOR_VERSION}::GuiPrivate Qt${QT_MAJOR_VERSION}::WaylandClient Wayland::Client) endif() if(WITH_X11) - target_sources(KF5GuiAddons PRIVATE util/kmodifierkeyinfoprovider_xcb.cpp) + target_sources(KF5GuiAddons PRIVATE util/kmodifierkeyinfoprovider_xcb.cpp util/kmodifierkeyinfoprovider_xcb.h) if (TARGET Qt5::X11Extras) target_link_libraries(KF5GuiAddons PRIVATE Qt5::X11Extras) endif() @@ -148,7 +169,7 @@ REQUIRED_HEADERS KGuiAddons_HEADERS ) -install(TARGETS KF5GuiAddons EXPORT KF5GuiAddonsTargets ${KF5_INSTALL_TARGETS_DEFAULT_ARGS}) +install(TARGETS KF5GuiAddons EXPORT KF5GuiAddonsTargets ${KF_INSTALL_TARGETS_DEFAULT_ARGS}) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/kguiaddons_export.h util/kmodifierkeyinfoprovider_p.h diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kguiaddons-5.98.0/src/geo-scheme-handler/CMakeLists.txt new/kguiaddons-5.99.0/src/geo-scheme-handler/CMakeLists.txt --- old/kguiaddons-5.98.0/src/geo-scheme-handler/CMakeLists.txt 2022-09-05 11:26:16.000000000 +0200 +++ new/kguiaddons-5.99.0/src/geo-scheme-handler/CMakeLists.txt 2022-10-01 15:16:36.000000000 +0200 @@ -3,12 +3,13 @@ add_executable(kde-geo-uri-handler kgeourihandler.cpp + kgeourihandler_p.h main.cpp ) target_include_directories(kde-geo-uri-handler PRIVATE ${CMAKE_BINARY_DIR}) # for kguiaddons_version.h target_link_libraries(kde-geo-uri-handler PRIVATE Qt${QT_MAJOR_VERSION}::Gui) -install(TARGETS kde-geo-uri-handler ${INSTALL_TARGETS_DEFAULT_ARGS}) +install(TARGETS kde-geo-uri-handler ${KF_INSTALL_TARGETS_DEFAULT_ARGS}) install( FILES google-maps-geo-handler.desktop diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kguiaddons-5.98.0/src/geo-scheme-handler/google-maps-geo-handler.desktop new/kguiaddons-5.99.0/src/geo-scheme-handler/google-maps-geo-handler.desktop --- old/kguiaddons-5.98.0/src/geo-scheme-handler/google-maps-geo-handler.desktop 2022-09-05 11:26:16.000000000 +0200 +++ new/kguiaddons-5.99.0/src/geo-scheme-handler/google-maps-geo-handler.desktop 2022-10-01 15:16:36.000000000 +0200 @@ -2,6 +2,7 @@ Type=Application Exec=kde-geo-uri-handler --coordinate-template "https://www.google.com/maps/@<LAT>,<LON>,<Z>" --query-template "https://www.google.com/maps/search/<Q>" --fallback "https://www.google.com/maps/" %u Name=Google Maps +Name[ar]=?????????? ???????? Name[ca]=Google Maps Name[ca@valencia]=Google Maps Name[cs]=Mapy Google diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kguiaddons-5.98.0/src/geo-scheme-handler/openstreetmap-geo-handler.desktop new/kguiaddons-5.99.0/src/geo-scheme-handler/openstreetmap-geo-handler.desktop --- old/kguiaddons-5.98.0/src/geo-scheme-handler/openstreetmap-geo-handler.desktop 2022-09-05 11:26:16.000000000 +0200 +++ new/kguiaddons-5.99.0/src/geo-scheme-handler/openstreetmap-geo-handler.desktop 2022-10-01 15:16:36.000000000 +0200 @@ -2,6 +2,7 @@ Type=Application Exec=kde-geo-uri-handler --coordinate-template "https://www.openstreetmap.org/#map=<Z>/<LAT>/<LON>" --query-template "https://www.openstreetmap.org/search?query=<Q>" --fallback "https://www.openstreetmap.org" %u Name=OpenStreetMap +Name[ar]=?????????? ???????????????? ???????????????? Name[ca]=OpenStreetMap Name[ca@valencia]=OpenStreetMap Name[cs]=OpenStreetMap diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kguiaddons-5.98.0/src/geo-scheme-handler/qwant-maps-geo-handler.desktop new/kguiaddons-5.99.0/src/geo-scheme-handler/qwant-maps-geo-handler.desktop --- old/kguiaddons-5.98.0/src/geo-scheme-handler/qwant-maps-geo-handler.desktop 2022-09-05 11:26:16.000000000 +0200 +++ new/kguiaddons-5.99.0/src/geo-scheme-handler/qwant-maps-geo-handler.desktop 2022-10-01 15:16:36.000000000 +0200 @@ -2,6 +2,7 @@ Type=Application Exec=kde-geo-uri-handler --coordinate-template "https://www.qwant.com/maps/#map=<Z>/<LAT>/<LON>" --query-template "https://www.qwant.com/maps/?q=<Q>&client=opensearch" --fallback "https://www.qwant.com/maps/" %u Name=Qwant Maps +Name[ar]=?????????? ?????????? Name[ca]=Qwant Maps Name[ca@valencia]=Qwant Maps Name[cs]=Mapy Qwant diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kguiaddons-5.98.0/src/geo-scheme-handler/wheelmap-geo-handler.desktop new/kguiaddons-5.99.0/src/geo-scheme-handler/wheelmap-geo-handler.desktop --- old/kguiaddons-5.98.0/src/geo-scheme-handler/wheelmap-geo-handler.desktop 2022-09-05 11:26:16.000000000 +0200 +++ new/kguiaddons-5.99.0/src/geo-scheme-handler/wheelmap-geo-handler.desktop 2022-10-01 15:16:36.000000000 +0200 @@ -2,6 +2,7 @@ Type=Application Exec=kde-geo-uri-handler --coordinate-template "https://wheelmap.org/?lat=<LAT>&lon=<LON>" --query-template "https://wheelmap.org/search?q=<Q>" --fallback "https://wheelmap.org" %u Name=wheelmap.org +Name[ar]=wheelmap.org Name[ca]=wheelmap.org Name[ca@valencia]=wheelmap.org Name[cs]=wheelmap.org diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kguiaddons-5.98.0/src/recorder/keysequencerecorder.cpp new/kguiaddons-5.99.0/src/recorder/keysequencerecorder.cpp --- old/kguiaddons-5.98.0/src/recorder/keysequencerecorder.cpp 2022-09-05 11:26:16.000000000 +0200 +++ new/kguiaddons-5.99.0/src/recorder/keysequencerecorder.cpp 2022-10-01 15:16:36.000000000 +0200 @@ -22,6 +22,21 @@ #include <array> +/// Singleton whose only purpose is to tell us about other sequence recorders getting started +class KeySequenceRecorderGlobal : public QObject +{ + Q_OBJECT +public: + static KeySequenceRecorderGlobal *self() + { + static KeySequenceRecorderGlobal s_self; + return &s_self; + } + +Q_SIGNALS: + void sequenceRecordingStarted(); +}; + class KeySequenceRecorderPrivate : public QObject { Q_OBJECT @@ -36,9 +51,11 @@ void handleKeyPress(QKeyEvent *event); void handleKeyRelease(QKeyEvent *event); void finishRecording(); + void receivedRecording(); KeySequenceRecorder *q; QKeySequence m_currentKeySequence; + QKeySequence m_previousKeySequence; QPointer<QWindow> m_window; bool m_isRecording; bool m_multiKeyShortcutsAllowed; @@ -385,7 +402,7 @@ } } -void KeySequenceRecorderPrivate::finishRecording() +void KeySequenceRecorderPrivate::receivedRecording() { m_modifierlessTimer.stop(); m_isRecording = false; @@ -394,6 +411,11 @@ m_inhibition->disableInhibition(); } Q_EMIT q->recordingChanged(); +} + +void KeySequenceRecorderPrivate::finishRecording() +{ + receivedRecording(); Q_EMIT q->gotKeySequence(m_currentKeySequence); } @@ -411,10 +433,22 @@ KeySequenceRecorder::~KeySequenceRecorder() noexcept { + if (d->m_inhibition && d->m_inhibition->shortcutsAreInhibited()) { + d->m_inhibition->disableInhibition(); + } } void KeySequenceRecorder::startRecording() { + d->m_previousKeySequence = d->m_currentKeySequence; + + KeySequenceRecorderGlobal::self()->sequenceRecordingStarted(); + connect(KeySequenceRecorderGlobal::self(), + &KeySequenceRecorderGlobal::sequenceRecordingStarted, + this, + &KeySequenceRecorder::cancelRecording, + Qt::UniqueConnection); + if (!d->m_window) { qCWarning(KGUIADDONS_LOG) << "Cannot record without a window"; return; @@ -428,6 +462,13 @@ Q_EMIT currentKeySequenceChanged(); } +void KeySequenceRecorder::cancelRecording() +{ + setCurrentKeySequence(d->m_previousKeySequence); + d->receivedRecording(); + Q_ASSERT(!isRecording()); +} + bool KeySequenceRecorder::isRecording() const { return d->m_isRecording; @@ -444,6 +485,15 @@ } } +void KeySequenceRecorder::setCurrentKeySequence(const QKeySequence &sequence) +{ + if (d->m_currentKeySequence == sequence) { + return; + } + d->m_currentKeySequence = sequence; + Q_EMIT currentKeySequenceChanged(); +} + QWindow *KeySequenceRecorder::window() const { return d->m_window; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kguiaddons-5.98.0/src/recorder/keysequencerecorder.h new/kguiaddons-5.99.0/src/recorder/keysequencerecorder.h --- old/kguiaddons-5.98.0/src/recorder/keysequencerecorder.h 2022-09-05 11:26:16.000000000 +0200 +++ new/kguiaddons-5.99.0/src/recorder/keysequencerecorder.h 2022-10-01 15:16:36.000000000 +0200 @@ -54,7 +54,7 @@ * * After recording it contains the last recorded QKeySequence */ - Q_PROPERTY(QKeySequence currentKeySequence READ currentKeySequence NOTIFY currentKeySequenceChanged) + Q_PROPERTY(QKeySequence currentKeySequence READ currentKeySequence WRITE setCurrentKeySequence NOTIFY currentKeySequenceChanged) /** * The window in which the key events are happening that should be recorded */ @@ -93,11 +93,12 @@ * Start recording. * Calling startRecording when window() is `nullptr` has no effect. */ - void Q_INVOKABLE startRecording(); + Q_INVOKABLE void startRecording(); bool isRecording() const; QKeySequence currentKeySequence() const; + void setCurrentKeySequence(const QKeySequence &sequence); QWindow *window() const; void setWindow(QWindow *window); @@ -108,6 +109,12 @@ void setModifierlessAllowed(bool allowed); bool modifierlessAllowed() const; +public Q_SLOTS: + /** + * Stops the recording session + */ + void cancelRecording(); + Q_SIGNALS: /** * This signal is emitted when a key sequence has been recorded. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kguiaddons-5.98.0/src/recorder/waylandinhibition.cpp new/kguiaddons-5.99.0/src/recorder/waylandinhibition.cpp --- old/kguiaddons-5.98.0/src/recorder/waylandinhibition.cpp 2022-09-05 11:26:16.000000000 +0200 +++ new/kguiaddons-5.99.0/src/recorder/waylandinhibition.cpp 2022-10-01 15:16:36.000000000 +0200 @@ -5,13 +5,47 @@ #include "waylandinhibition_p.h" +#include <QDebug> #include <QGuiApplication> +#include <QSharedPointer> #include <QtWaylandClient/QWaylandClientExtensionTemplate> #include <QtWaylandClient/QtWaylandClientVersion> #include <qpa/qplatformnativeinterface.h> #include "qwayland-keyboard-shortcuts-inhibit-unstable-v1.h" +class ShortcutsInhibitor : public QtWayland::zwp_keyboard_shortcuts_inhibitor_v1 +{ +public: + ShortcutsInhibitor(::zwp_keyboard_shortcuts_inhibitor_v1 *id) + : QtWayland::zwp_keyboard_shortcuts_inhibitor_v1(id) + { + } + + ~ShortcutsInhibitor() override + { + destroy(); + } + + void zwp_keyboard_shortcuts_inhibitor_v1_active() override + { + m_active = true; + } + + void zwp_keyboard_shortcuts_inhibitor_v1_inactive() override + { + m_active = false; + } + + bool isActive() const + { + return m_active; + } + +private: + bool m_active = false; +}; + class ShortcutsInhibitManager : public QWaylandClientExtensionTemplate<ShortcutsInhibitManager>, public QtWayland::zwp_keyboard_shortcuts_inhibit_manager_v1 { public: @@ -32,44 +66,52 @@ destroy(); } } -}; -class ShortcutsInhibitor : public QtWayland::zwp_keyboard_shortcuts_inhibitor_v1 -{ -public: - ShortcutsInhibitor(::zwp_keyboard_shortcuts_inhibitor_v1 *id) - : QtWayland::zwp_keyboard_shortcuts_inhibitor_v1(id) + void startInhibition(QWindow *window) { + if (m_inhibitions.contains(window)) { + return; + } + QPlatformNativeInterface *nativeInterface = qGuiApp->platformNativeInterface(); + if (!nativeInterface) { + return; + } + auto seat = static_cast<wl_seat *>(nativeInterface->nativeResourceForIntegration("wl_seat")); + auto surface = static_cast<wl_surface *>(nativeInterface->nativeResourceForWindow("surface", window)); + if (!seat || !surface) { + return; + } + m_inhibitions[window].reset(new ShortcutsInhibitor(inhibit_shortcuts(surface, seat))); } - ~ShortcutsInhibitor() override + bool isInhibited(QWindow *window) const { - destroy(); + return m_inhibitions.contains(window); } - void zwp_keyboard_shortcuts_inhibitor_v1_active() override + void stopInhibition(QWindow *window) { - m_active = true; + m_inhibitions.remove(window); } - void zwp_keyboard_shortcuts_inhibitor_v1_inactive() override - { - m_active = false; - } + QHash<QWindow *, QSharedPointer<ShortcutsInhibitor>> m_inhibitions; +}; - bool isActive() const - { - return m_active; +static std::shared_ptr<ShortcutsInhibitManager> theManager() +{ + static std::weak_ptr<ShortcutsInhibitManager> manager; + std::shared_ptr<ShortcutsInhibitManager> ret; + if (!ret) { + ret = std::make_shared<ShortcutsInhibitManager>(); + manager = ret; } - -private: - bool m_active = false; -}; + return ret; +} WaylandInhibition::WaylandInhibition(QWindow *window) : ShortcutInhibition() - , m_manager(new ShortcutsInhibitManager) , m_window(window) + , m_manager(theManager()) { } @@ -77,30 +119,15 @@ bool WaylandInhibition::shortcutsAreInhibited() const { - return m_inhibitor && m_inhibitor->isActive(); + return m_manager->isInhibited(m_window); } void WaylandInhibition::enableInhibition() { - if (m_inhibitor || !m_manager->isActive()) { - return; - } - QPlatformNativeInterface *nativeInterface = qGuiApp->platformNativeInterface(); - if (!nativeInterface) { - return; - } - auto seat = static_cast<wl_seat *>(nativeInterface->nativeResourceForIntegration("wl_seat")); - auto surface = static_cast<wl_surface *>(nativeInterface->nativeResourceForWindow("surface", m_window)); - if (!seat || !surface) { - return; - } - m_inhibitor.reset(new ShortcutsInhibitor(m_manager->inhibit_shortcuts(surface, seat))); + m_manager->startInhibition(m_window); } void WaylandInhibition::disableInhibition() { - if (!m_inhibitor) { - return; - } - m_inhibitor.reset(); + m_manager->stopInhibition(m_window); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kguiaddons-5.98.0/src/recorder/waylandinhibition_p.h new/kguiaddons-5.99.0/src/recorder/waylandinhibition_p.h --- old/kguiaddons-5.98.0/src/recorder/waylandinhibition_p.h 2022-09-05 11:26:16.000000000 +0200 +++ new/kguiaddons-5.99.0/src/recorder/waylandinhibition_p.h 2022-10-01 15:16:36.000000000 +0200 @@ -23,9 +23,8 @@ void disableInhibition() override; private: - std::unique_ptr<ShortcutsInhibitManager> m_manager; - std::unique_ptr<ShortcutsInhibitor> m_inhibitor; - QWindow *m_window; + QWindow *const m_window; + std::shared_ptr<ShortcutsInhibitManager> m_manager; }; #endif