no longer require xcbthread

This commit is contained in:
2025-12-25 15:17:13 +08:00
parent 866b81a3dc
commit 93daa1af0f
5 changed files with 0 additions and 69 deletions

View File

@@ -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(

View File

@@ -5,7 +5,6 @@
#include <QLoggingCategory>
#include "util.h"
#include "xcbthread.h"
#include <QSize>
#include <QPixmap>

3
util.h
View File

@@ -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<QString> m_currentIds;
XcbThread *m_xcbThread;
};
}

View File

@@ -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<xcb_generic_event_t> 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;
}
}
}
}
}
}

View File

@@ -1,22 +0,0 @@
// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-or-later
#pragma once
#include <QThread>
#include <xcb/xcb.h>
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;
};
}