From 93daa1af0f4a768cfdf113a824d10abb7e014128 Mon Sep 17 00:00:00 2001 From: Wang Zichong Date: Thu, 25 Dec 2025 15:17:13 +0800 Subject: [PATCH] no longer require xcbthread --- CMakeLists.txt | 1 - util.cpp | 1 - util.h | 3 --- xcbthread.cpp | 42 ------------------------------------------ xcbthread.h | 22 ---------------------- 5 files changed, 69 deletions(-) delete mode 100644 xcbthread.cpp delete mode 100644 xcbthread.h diff --git a/CMakeLists.txt b/CMakeLists.txt index da3ff84..81199a5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,7 +23,6 @@ set(XEMBED_SNI_PROXY_SOURCES fdoselectionmanager.cpp fdoselectionmanager.h traymanager1.cpp traymanager1.h util.cpp util.h - xcbthread.cpp xcbthread.h ) set_source_files_properties( diff --git a/util.cpp b/util.cpp index fe8b0ed..6ca2bf6 100644 --- a/util.cpp +++ b/util.cpp @@ -5,7 +5,6 @@ #include #include "util.h" -#include "xcbthread.h" #include #include diff --git a/util.h b/util.h index b40cf58..8b0c159 100644 --- a/util.h +++ b/util.h @@ -21,7 +21,6 @@ struct _XDisplay; namespace tray { #define UTIL Util::instance() -class XcbThread; class Util : public QObject { @@ -79,8 +78,6 @@ private: _XDisplay *m_display; QSet m_currentIds; - - XcbThread *m_xcbThread; }; } diff --git a/xcbthread.cpp b/xcbthread.cpp deleted file mode 100644 index 538107d..0000000 --- a/xcbthread.cpp +++ /dev/null @@ -1,42 +0,0 @@ -// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: GPL-3.0-or-later - -#include "xcbthread.h" -#include "util.h" - -namespace tray { -XcbThread::XcbThread(xcb_connection_t *connection, QObject *parent) - : QThread(parent) - , m_connection(connection) -{ -} - -XcbThread::~XcbThread() -{ -} - -void XcbThread::run() -{ - if (!m_connection) { - return; - } - // The Xembed type tray needs to reset the xwindow state of the receiving event to the state of not receiving events after the mouse - // leaves. This thread is used to receive the leave event and apply the operation. - QScopedPointer event; - while (!isInterruptionRequested()) { - event.reset(xcb_wait_for_event(m_connection)); - if (event) { - uint8_t responseType = event->response_type & ~0x80; - switch (responseType) { - case XCB_LEAVE_NOTIFY: { - xcb_leave_notify_event_t *lE = (xcb_leave_notify_event_t *)event.data(); - UTIL->setX11WindowInputShape(lE->event, QSize(0, 0)); - break; - } - } - } - } -} -} - diff --git a/xcbthread.h b/xcbthread.h deleted file mode 100644 index 2157107..0000000 --- a/xcbthread.h +++ /dev/null @@ -1,22 +0,0 @@ -// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd. -// -// SPDX-License-Identifier: GPL-3.0-or-later - -#pragma once - -#include -#include - -namespace tray { -class XcbThread : public QThread { - Q_OBJECT -public: - XcbThread(xcb_connection_t *connection, QObject *parent = nullptr); - ~XcbThread(); - - void run() override; - -private: - xcb_connection_t *m_connection; -}; -}