no longer require xcbthread
This commit is contained in:
@@ -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(
|
||||
|
||||
1
util.cpp
1
util.cpp
@@ -5,7 +5,6 @@
|
||||
#include <QLoggingCategory>
|
||||
|
||||
#include "util.h"
|
||||
#include "xcbthread.h"
|
||||
|
||||
#include <QSize>
|
||||
#include <QPixmap>
|
||||
|
||||
3
util.h
3
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<QString> m_currentIds;
|
||||
|
||||
XcbThread *m_xcbThread;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
22
xcbthread.h
22
xcbthread.h
@@ -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;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user