From 15b0b3db29636a94f98f5c7cd6d7a33c15bd6421 Mon Sep 17 00:00:00 2001 From: Alexander Volkov Date: Wed, 30 Nov 2016 13:15:38 +0300 Subject: xcb: Replace Q_DECL_OVERRIDE by override We can use 'override' directly since Qt 5.7. Also remove redundant 'virtual' keywords. Change-Id: Ia40be0e1e60e51f9d043ab575fd6b9305ea620b0 Reviewed-by: Shawn Rutledge --- src/plugins/platforms/xcb/qxcbwindow.h | 90 +++++++++++++++++----------------- 1 file changed, 45 insertions(+), 45 deletions(-) (limited to 'src/plugins/platforms/xcb/qxcbwindow.h') diff --git a/src/plugins/platforms/xcb/qxcbwindow.h b/src/plugins/platforms/xcb/qxcbwindow.h index 92f3f7a67c..3d8d21be6b 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.h +++ b/src/plugins/platforms/xcb/qxcbwindow.h @@ -76,75 +76,75 @@ public: QXcbWindow(QWindow *window); ~QXcbWindow(); - void setGeometry(const QRect &rect) Q_DECL_OVERRIDE; + void setGeometry(const QRect &rect) override; - QMargins frameMargins() const Q_DECL_OVERRIDE; + QMargins frameMargins() const override; - void setVisible(bool visible) Q_DECL_OVERRIDE; - void setWindowFlags(Qt::WindowFlags flags) Q_DECL_OVERRIDE; - void setWindowState(Qt::WindowState state) Q_DECL_OVERRIDE; - WId winId() const Q_DECL_OVERRIDE; - void setParent(const QPlatformWindow *window) Q_DECL_OVERRIDE; + void setVisible(bool visible) override; + void setWindowFlags(Qt::WindowFlags flags) override; + void setWindowState(Qt::WindowState state) override; + WId winId() const override; + void setParent(const QPlatformWindow *window) override; - bool isExposed() const Q_DECL_OVERRIDE; - bool isEmbedded(const QPlatformWindow *parentWindow = 0) const Q_DECL_OVERRIDE; - QPoint mapToGlobal(const QPoint &pos) const Q_DECL_OVERRIDE; - QPoint mapFromGlobal(const QPoint &pos) const Q_DECL_OVERRIDE; + bool isExposed() const override; + bool isEmbedded(const QPlatformWindow *parentWindow = 0) const override; + QPoint mapToGlobal(const QPoint &pos) const override; + QPoint mapFromGlobal(const QPoint &pos) const override; - void setWindowTitle(const QString &title) Q_DECL_OVERRIDE; + void setWindowTitle(const QString &title) override; void setWindowIconText(const QString &title); - void setWindowIcon(const QIcon &icon) Q_DECL_OVERRIDE; - void raise() Q_DECL_OVERRIDE; - void lower() Q_DECL_OVERRIDE; - void propagateSizeHints() Q_DECL_OVERRIDE; + void setWindowIcon(const QIcon &icon) override; + void raise() override; + void lower() override; + void propagateSizeHints() override; - void requestActivateWindow() Q_DECL_OVERRIDE; + void requestActivateWindow() override; - bool setKeyboardGrabEnabled(bool grab) Q_DECL_OVERRIDE; - bool setMouseGrabEnabled(bool grab) Q_DECL_OVERRIDE; + bool setKeyboardGrabEnabled(bool grab) override; + bool setMouseGrabEnabled(bool grab) override; void setCursor(xcb_cursor_t cursor, bool isBitmapCursor); - QSurfaceFormat format() const Q_DECL_OVERRIDE; + QSurfaceFormat format() const override; - void windowEvent(QEvent *event) Q_DECL_OVERRIDE; + void windowEvent(QEvent *event) override; - bool startSystemResize(const QPoint &pos, Qt::Corner corner) Q_DECL_OVERRIDE; + bool startSystemResize(const QPoint &pos, Qt::Corner corner) override; - void setOpacity(qreal level) Q_DECL_OVERRIDE; - void setMask(const QRegion ®ion) Q_DECL_OVERRIDE; + void setOpacity(qreal level) override; + void setMask(const QRegion ®ion) override; - void setAlertState(bool enabled) Q_DECL_OVERRIDE; - bool isAlertState() const Q_DECL_OVERRIDE { return m_alertState; } + void setAlertState(bool enabled) override; + bool isAlertState() const override { return m_alertState; } xcb_window_t xcb_window() const { return m_window; } uint depth() const { return m_depth; } QImage::Format imageFormat() const { return m_imageFormat; } bool imageNeedsRgbSwap() const { return m_imageRgbSwap; } - bool handleGenericEvent(xcb_generic_event_t *event, long *result) Q_DECL_OVERRIDE; - - void handleExposeEvent(const xcb_expose_event_t *event) Q_DECL_OVERRIDE; - void handleClientMessageEvent(const xcb_client_message_event_t *event) Q_DECL_OVERRIDE; - void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *event) Q_DECL_OVERRIDE; - void handleMapNotifyEvent(const xcb_map_notify_event_t *event) Q_DECL_OVERRIDE; - void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *event) Q_DECL_OVERRIDE; - void handleButtonPressEvent(const xcb_button_press_event_t *event) Q_DECL_OVERRIDE; - void handleButtonReleaseEvent(const xcb_button_release_event_t *event) Q_DECL_OVERRIDE; - void handleMotionNotifyEvent(const xcb_motion_notify_event_t *event) Q_DECL_OVERRIDE; - - void handleEnterNotifyEvent(const xcb_enter_notify_event_t *event) Q_DECL_OVERRIDE; - void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *event) Q_DECL_OVERRIDE; - void handleFocusInEvent(const xcb_focus_in_event_t *event) Q_DECL_OVERRIDE; - void handleFocusOutEvent(const xcb_focus_out_event_t *event) Q_DECL_OVERRIDE; - void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) Q_DECL_OVERRIDE; + bool handleGenericEvent(xcb_generic_event_t *event, long *result) override; + + void handleExposeEvent(const xcb_expose_event_t *event) override; + void handleClientMessageEvent(const xcb_client_message_event_t *event) override; + void handleConfigureNotifyEvent(const xcb_configure_notify_event_t *event) override; + void handleMapNotifyEvent(const xcb_map_notify_event_t *event) override; + void handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *event) override; + void handleButtonPressEvent(const xcb_button_press_event_t *event) override; + void handleButtonReleaseEvent(const xcb_button_release_event_t *event) override; + void handleMotionNotifyEvent(const xcb_motion_notify_event_t *event) override; + + void handleEnterNotifyEvent(const xcb_enter_notify_event_t *event) override; + void handleLeaveNotifyEvent(const xcb_leave_notify_event_t *event) override; + void handleFocusInEvent(const xcb_focus_in_event_t *event) override; + void handleFocusOutEvent(const xcb_focus_out_event_t *event) override; + void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; #ifdef XCB_USE_XINPUT22 void handleXIMouseButtonState(const xcb_ge_event_t *); - void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized) Q_DECL_OVERRIDE; - void handleXIEnterLeave(xcb_ge_event_t *) Q_DECL_OVERRIDE; + void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized) override; + void handleXIEnterLeave(xcb_ge_event_t *) override; #endif - QXcbWindow *toWindow() Q_DECL_OVERRIDE; + QXcbWindow *toWindow() override; void handleMouseEvent(xcb_timestamp_t time, const QPoint &local, const QPoint &global, Qt::KeyboardModifiers modifiers, Qt::MouseEventSource source); -- cgit v1.2.3 From 2488f34ecfd68702b5508c50cca3fb8e967ac8ea Mon Sep 17 00:00:00 2001 From: Alexander Volkov Date: Thu, 25 Feb 2016 14:39:51 +0300 Subject: xcb: Adapt QXcbWindow::startSystemResize() for touch events Window managers typically grab the pointer after receiving the _NET_WM_MOVERESIZE event. But they fail to do it for touch sequences which have a receiver. So we should reject the touch sequence before sending _NET_WM_MOVERESIZE event. QSizeGrip calls startSystemResize() on MouseButtonPress event which is synthesized by Qt on TouchBegin. We can find the id of the touch point by comparing coordinates of the synthesized MouseButtonPress event with coordinates of all TouchBegin events. Then we use this id to reject the touch sequence (it's possible only after receiving XI_TouchUpdate). Change-Id: I26519840cd221e28b0be7854e4617c9aba4b0817 Task-number: QTBUG-51385 Reviewed-by: Shawn Rutledge --- src/plugins/platforms/xcb/qxcbwindow.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/plugins/platforms/xcb/qxcbwindow.h') diff --git a/src/plugins/platforms/xcb/qxcbwindow.h b/src/plugins/platforms/xcb/qxcbwindow.h index 3d8d21be6b..089df8f3f6 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.h +++ b/src/plugins/platforms/xcb/qxcbwindow.h @@ -178,6 +178,8 @@ public: QXcbScreen *xcbScreen() const; + bool doStartSystemResize(const QPoint &globalPos, Qt::Corner corner); + virtual void create(); virtual void destroy(); -- cgit v1.2.3