summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/xcb')
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection.cpp7
-rw-r--r--src/plugins/platforms/xcb/qxcbnativeinterface.cpp16
-rw-r--r--src/plugins/platforms/xcb/qxcbnativeinterface.h8
3 files changed, 2 insertions, 29 deletions
diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp
index b808a74a83..7f197c8ad5 100644
--- a/src/plugins/platforms/xcb/qxcbconnection.cpp
+++ b/src/plugins/platforms/xcb/qxcbconnection.cpp
@@ -270,7 +270,6 @@ QXcbWindow *QXcbConnection::platformWindowFromId(xcb_window_t id)
{ \
event_t *e = (event_t *)event; \
if (QXcbWindow *platformWindow = platformWindowFromId(e->windowMember)) { \
- long result = 0; \
handled = QWindowSystemInterface::handleNativeEvent(platformWindow->window(), m_nativeInterface->genericEventFilterType(), event, &result); \
if (!handled) \
platformWindow->handler(e); \
@@ -282,7 +281,6 @@ break;
{ \
event_t *e = (event_t *)event; \
if (QXcbWindow *platformWindow = platformWindowFromId(e->event)) { \
- long result = 0; \
handled = QWindowSystemInterface::handleNativeEvent(platformWindow->window(), m_nativeInterface->genericEventFilterType(), event, &result); \
if (!handled) \
m_keyboard->handler(platformWindow, e); \
@@ -543,10 +541,9 @@ void QXcbConnection::handleXcbEvent(xcb_generic_event_t *event)
m_callLog.remove(0, i);
}
#endif
- bool handled = false;
- if (QPlatformNativeInterface::EventFilter filter = m_nativeInterface->eventFilter(QXcbNativeInterface::GenericEventFilter))
- handled = filter(event, 0);
+ long result = 0;
+ bool handled = QCoreApplication::instance()->filterNativeEvent(m_nativeInterface->genericEventFilterType(), event, &result);
uint response_type = event->response_type & ~0x80;
diff --git a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp
index a6647da8be..2948ee6aae 100644
--- a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp
+++ b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp
@@ -80,7 +80,6 @@ QXcbNativeInterface::QXcbNativeInterface() :
m_genericEventFilterType(QByteArrayLiteral("xcb_generic_event_t"))
{
- qFill(m_eventFilters, m_eventFilters + EventFilterCount, EventFilter(0));
}
void *QXcbNativeInterface::nativeResourceForContext(const QByteArray &resourceString, QOpenGLContext *context)
@@ -142,21 +141,6 @@ QPlatformNativeInterface::NativeResourceForContextFunction QXcbNativeInterface::
return 0;
}
-QPlatformNativeInterface::EventFilter QXcbNativeInterface::setEventFilter(const QByteArray &eventType, QPlatformNativeInterface::EventFilter filter)
-{
- int type = -1;
- if (eventType == m_genericEventFilterType)
- type = GenericEventFilter;
- if (type == -1) {
- qWarning("QXcbNativeInterface: %s: Attempt to set invalid event filter type '%s'.",
- Q_FUNC_INFO, eventType.constData());
- return 0;
- }
- const EventFilter oldFilter = m_eventFilters[type];
- m_eventFilters[type] = filter;
- return oldFilter;
-}
-
QXcbScreen *QXcbNativeInterface::qPlatformScreenForWindow(QWindow *window)
{
QXcbScreen *screen;
diff --git a/src/plugins/platforms/xcb/qxcbnativeinterface.h b/src/plugins/platforms/xcb/qxcbnativeinterface.h
index 8221d9a36b..c91b4d7e88 100644
--- a/src/plugins/platforms/xcb/qxcbnativeinterface.h
+++ b/src/plugins/platforms/xcb/qxcbnativeinterface.h
@@ -61,11 +61,6 @@ public:
EglContext
};
- enum EventFilterType {
- GenericEventFilter,
- EventFilterCount
- };
-
QXcbNativeInterface();
void *nativeResourceForContext(const QByteArray &resourceString, QOpenGLContext *context);
@@ -74,8 +69,6 @@ public:
NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource);
inline const QByteArray &genericEventFilterType() const { return m_genericEventFilterType; }
- EventFilter setEventFilter(const QByteArray &eventType, EventFilter filter);
- EventFilter eventFilter(EventFilterType type) const { return m_eventFilters[type]; }
void *displayForWindow(QWindow *window);
void *eglDisplayForWindow(QWindow *window);
@@ -86,7 +79,6 @@ public:
private:
const QByteArray m_genericEventFilterType;
- EventFilter m_eventFilters[EventFilterCount];
static QXcbScreen *qPlatformScreenForWindow(QWindow *window);
};