summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb/qxcbconnection.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbconnection.h')
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection.h56
1 files changed, 30 insertions, 26 deletions
diff --git a/src/plugins/platforms/xcb/qxcbconnection.h b/src/plugins/platforms/xcb/qxcbconnection.h
index 60a4efff4e..01dd048ea3 100644
--- a/src/plugins/platforms/xcb/qxcbconnection.h
+++ b/src/plugins/platforms/xcb/qxcbconnection.h
@@ -52,6 +52,7 @@
#include <QVector>
#include <QVarLengthArray>
#include <qpa/qwindowsysteminterface.h>
+#include <QtCore/QLoggingCategory>
// This is needed to make Qt compile together with XKB. xkb.h is using a variable
// which is called 'explicit', this is a reserved keyword in c++
@@ -65,9 +66,7 @@
#include <QTabletEvent>
#endif
-#ifdef XCB_USE_XINPUT2_MAEMO
-struct XInput2MaemoData;
-#elif XCB_USE_XINPUT2
+#if XCB_USE_XINPUT2
#include <X11/extensions/XI2.h>
#ifdef XIScrollClass
#define XCB_USE_XINPUT21 // XI 2.1 adds smooth scrolling support
@@ -75,7 +74,7 @@ struct XInput2MaemoData;
#define XCB_USE_XINPUT22 // XI 2.2 adds multi-point touch support
#endif
#endif
-struct XInput2DeviceData;
+struct XInput2TouchDeviceData;
#endif
struct xcb_randr_get_output_info_reply_t;
@@ -83,6 +82,9 @@ struct xcb_randr_get_output_info_reply_t;
QT_BEGIN_NAMESPACE
+Q_DECLARE_LOGGING_CATEGORY(lcQpaXInput)
+Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputDevices)
+
class QXcbScreen;
class QXcbWindow;
class QXcbDrag;
@@ -279,9 +281,6 @@ namespace QXcbAtom {
RelHorizScroll,
RelVertScroll,
-#if XCB_USE_MAEMO_WINDOW_PROPERTIES
- MeegoTouchOrientationAngle,
-#endif
_XSETTINGS_SETTINGS,
_COMPIZ_DECOR_PENDING,
@@ -355,6 +354,18 @@ public:
typedef QHash<xcb_window_t, QXcbWindowEventListener *> WindowMapper;
+class QXcbSyncWindowRequest : public QEvent
+{
+public:
+ QXcbSyncWindowRequest(QXcbWindow *w) : QEvent(QEvent::Type(QEvent::User + 1)), m_window(w) { }
+
+ QXcbWindow *window() const { return m_window; }
+ void invalidate();
+
+private:
+ QXcbWindow *m_window;
+};
+
class QAbstractEventDispatcher;
class QXcbConnection : public QObject
{
@@ -399,9 +410,7 @@ public:
#if defined(XCB_USE_EGL)
void *egl_display() const { return m_egl_display; }
#endif
-#ifdef XCB_USE_XINPUT2_MAEMO
- bool isUsingXInput2Maemo();
-#elif defined(XCB_USE_XINPUT2)
+#if defined(XCB_USE_XINPUT2)
void xi2Select(xcb_window_t window);
#endif
#ifdef XCB_USE_XINPUT21
@@ -452,6 +461,7 @@ public:
void setFocusWindow(QXcbWindow *);
QByteArray startupId() const { return m_startupId; }
+ void setStartupId(const QByteArray &nextId) { m_startupId = nextId; }
void clearStartupId() { m_startupId.clear(); }
void grabServer();
@@ -467,8 +477,10 @@ public:
QXcbEventReader *eventReader() const { return m_reader; }
+protected:
+ bool event(QEvent *e) Q_DECL_OVERRIDE;
+
public slots:
- void syncWindow(QXcbWindow *window);
void flush() { xcb_flush(m_connection); }
private slots:
@@ -483,11 +495,6 @@ private:
void initializeXRandr();
void initializeXShape();
void initializeXKB();
-#ifdef XCB_USE_XINPUT2_MAEMO
- void initializeXInput2Maemo();
- void finalizeXInput2Maemo();
- void handleGenericEventMaemo(xcb_ge_event_t *event);
-#endif
void handleClientMessageEvent(const xcb_client_message_event_t *event);
QXcbScreen* findOrCreateScreen(QList<QXcbScreen *>& newScreens, int screenNumber,
xcb_screen_t* xcbScreen, xcb_randr_get_output_info_reply_t *output = NULL);
@@ -501,18 +508,18 @@ private:
void initializeXInput2();
void finalizeXInput2();
void xi2SetupDevices();
- XInput2DeviceData *deviceForId(int id);
+ XInput2TouchDeviceData *touchDeviceForId(int id);
void xi2HandleEvent(xcb_ge_event_t *event);
void xi2HandleHierachyEvent(void *event);
int m_xiOpCode, m_xiEventBase, m_xiErrorBase;
#ifndef QT_NO_TABLETEVENT
struct TabletData {
TabletData() : deviceId(0), pointerType(QTabletEvent::UnknownPointer),
- tool(QTabletEvent::Stylus), down(false), serialId(0), inProximity(false) { }
+ tool(QTabletEvent::Stylus), buttons(0), serialId(0), inProximity(false) { }
int deviceId;
QTabletEvent::PointerType pointerType;
QTabletEvent::TabletDevice tool;
- bool down;
+ Qt::MouseButtons buttons;
qint64 serialId;
bool inProximity;
struct ValuatorClassInfo {
@@ -541,7 +548,7 @@ private:
QHash<int, ScrollingDevice> m_scrollingDevices;
#endif // XCB_USE_XINPUT2
-#if defined(XCB_USE_XINPUT2) || defined(XCB_USE_XINPUT2_MAEMO)
+#if defined(XCB_USE_XINPUT2)
static bool xi2GetValuatorValueIfSet(void *event, int valuatorNum, double *value);
static bool xi2PrepareXIGenericDeviceEvent(xcb_ge_event_t *event, int opCode);
#endif
@@ -574,11 +581,9 @@ private:
void *m_xlib_display;
#endif
QXcbEventReader *m_reader;
-#ifdef XCB_USE_XINPUT2_MAEMO
- XInput2MaemoData *m_xinputData;
-#elif defined(XCB_USE_XINPUT2)
+#if defined(XCB_USE_XINPUT2)
QHash<int, QWindowSystemInterface::TouchPoint> m_touchPoints;
- QHash<int, XInput2DeviceData*> m_touchDevices;
+ QHash<int, XInput2TouchDeviceData*> m_touchDevices;
#endif
#if defined(XCB_USE_EGL)
void *m_egl_display;
@@ -604,6 +609,7 @@ private:
uint32_t xfixes_first_event;
uint32_t xrandr_first_event;
uint32_t xkb_first_event;
+ uint32_t glx_first_event;
bool has_glx_extension;
bool has_shape_extension;
@@ -611,8 +617,6 @@ private:
bool has_input_shape;
bool has_touch_without_mouse_emulation;
bool has_xkb;
- bool debug_xinput_devices;
- bool debug_xinput;
Qt::MouseButtons m_buttons;