diff --git a/cursor.h b/cursor.h --- a/cursor.h +++ b/cursor.h @@ -141,11 +141,10 @@ * * To enable these signals use @link startCursorTracking. * - * @param serial The serial number of the new selected cursor. * @see startCursorTracking * @see stopCursorTracking */ - void cursorChanged(uint32_t serial); + void cursorChanged(); void themeChanged(); protected: diff --git a/cursor.cpp b/cursor.cpp --- a/cursor.cpp +++ b/cursor.cpp @@ -24,6 +24,7 @@ #include "input.h" #include "keyboard_input.h" #include "main.h" +#include "platform.h" #include "utils.h" #include "xcbutils.h" // KDE @@ -228,11 +229,12 @@ void Cursor::notifyCursorChanged(uint32_t serial) { + Q_UNUSED(serial) if (m_cursorTrackingCounter <= 0) { // cursor change tracking is currently disabled, so don't emit signal return; } - emit cursorChanged(serial); + emit cursorChanged(); } QVector Cursor::cursorAlternativeNames(const QByteArray &name) const @@ -388,13 +390,6 @@ #ifndef KCMRULES connect(input(), &InputRedirection::keyboardModifiersChanged, this, &InputRedirectionCursor::slotModifiersChanged); - connect(kwinApp(), &Application::x11ConnectionChanged, this, - [this] { - if (isCursorTracking()) { - doStartCursorTracking(); - } - }, Qt::QueuedConnection - ); #endif } @@ -434,20 +429,16 @@ void InputRedirectionCursor::doStartCursorTracking() { - if (!kwinApp()->x11Connection()) { - return; - } - xcb_xfixes_select_cursor_input(connection(), rootWindow(), XCB_XFIXES_CURSOR_NOTIFY_MASK_DISPLAY_CURSOR); - // TODO: also track the Wayland cursor +#ifndef KCMRULES + connect(kwinApp()->platform(), &Platform::cursorChanged, this, &Cursor::cursorChanged); +#endif } void InputRedirectionCursor::doStopCursorTracking() { - if (!kwinApp()->x11Connection()) { - return; - } - xcb_xfixes_select_cursor_input(connection(), rootWindow(), 0); - // TODO: also track the Wayland cursor +#ifndef KCMRULES + disconnect(kwinApp()->platform(), &Platform::cursorChanged, this, &Cursor::cursorChanged); +#endif } } // namespace