From ae5ff03230b7bda779f82b79793780be099475c9 Mon Sep 17 00:00:00 2001 From: Filippo Gentile Date: Wed, 3 Apr 2024 22:50:47 +0200 Subject: [PATCH] Revert "SNIProxy: use Qt Private headers to get Xcb timestamp" This reverts commit 82bcd4be413f76482c675dacf8971f81fad03e4a. --- plugin-tray/CMakeLists.txt | 1 - plugin-tray/sniproxy.cpp | 9 ++------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/plugin-tray/CMakeLists.txt b/plugin-tray/CMakeLists.txt index fc51b1b50..a0541e226 100644 --- a/plugin-tray/CMakeLists.txt +++ b/plugin-tray/CMakeLists.txt @@ -38,7 +38,6 @@ qt_add_dbus_adaptor(SOURCES org.kde.StatusNotifierItem.xml sniproxy.h SNIProxy) qt_add_dbus_interface(SOURCES org.kde.StatusNotifierWatcher.xml statusnotifierwatcher_interface) set(LIBRARIES - Qt6::GuiPrivate ${XCB_LIBRARIES} ${xtst_LDFLAGS} ) diff --git a/plugin-tray/sniproxy.cpp b/plugin-tray/sniproxy.cpp index 4cb05ce97..9fbe924b4 100644 --- a/plugin-tray/sniproxy.cpp +++ b/plugin-tray/sniproxy.cpp @@ -38,7 +38,6 @@ #include #include -#include //For "gettimestamp" Xcb integration resource #include "kwindowinfo.h" #include "statusnotifieritemadaptor.h" @@ -591,17 +590,13 @@ void SNIProxy::sendClick(uint8_t mouseButton, int x, int y) auto *x11Application = qGuiApp->nativeInterface(); WId appRootWindow = XDefaultRootWindow(x11Application->display()); - // Qt private access - void *ptr = qGuiApp->platformNativeInterface()->nativeResourceForScreen("gettimestamp", qGuiApp->primaryScreen()); - xcb_timestamp_t timeStamp = reinterpret_cast(ptr); - // mouse down if (m_injectMode == Direct) { xcb_button_press_event_t *event = new xcb_button_press_event_t; memset(event, 0x00, sizeof(xcb_button_press_event_t)); event->response_type = XCB_BUTTON_PRESS; event->event = m_windowId; - event->time = timeStamp; + event->time = XCB_CURRENT_TIME; //NOTE: to get proper timestamp we would need Qt Private APIs event->same_screen = 1; event->root = appRootWindow; event->root_x = x; @@ -624,7 +619,7 @@ void SNIProxy::sendClick(uint8_t mouseButton, int x, int y) memset(event, 0x00, sizeof(xcb_button_release_event_t)); event->response_type = XCB_BUTTON_RELEASE; event->event = m_windowId; - event->time = timeStamp; + event->time = XCB_CURRENT_TIME; //NOTE: to get proper timestamp we would need Qt Private APIs event->same_screen = 1; event->root = appRootWindow; event->root_x = x;