diff options
author | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-04-22 16:35:41 +0200 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-04-22 16:35:43 +0200 |
commit | 4c231d5df3040dbf4545a9a77145ee0e1f9c380c (patch) | |
tree | 2cc5b71a5d2b464214cf5372776913fbe4622e1e /src/plugins/platforms/xcb | |
parent | 7df16fb4ccbe0476bc34274a77e98eec4e8d2d93 (diff) | |
parent | d672ef07681a959d9559dd1e11e70db1f448a7f1 (diff) |
Merge remote-tracking branch 'origin/stable' into dev
Change-Id: I059725e3b7d7ffd5a16a0931e6c17200917172b5
Diffstat (limited to 'src/plugins/platforms/xcb')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbnativeinterface.cpp | 14 | ||||
-rw-r--r-- | src/plugins/platforms/xcb/qxcbnativeinterface.h | 3 | ||||
-rw-r--r-- | src/plugins/platforms/xcb/qxcbwindow.cpp | 14 | ||||
-rw-r--r-- | src/plugins/platforms/xcb/qxcbwindow.h | 5 |
4 files changed, 35 insertions, 1 deletions
diff --git a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp index 08e72ed5ce..6241898462 100644 --- a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp +++ b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp @@ -57,6 +57,10 @@ #include "qglxintegration.h" #endif +#ifndef XCB_USE_XLIB +# include <stdio.h> +#endif + QT_BEGIN_NAMESPACE class QXcbResourceMap : public QMap<QByteArray, QXcbNativeInterface::ResourceType> @@ -84,6 +88,16 @@ QXcbNativeInterface::QXcbNativeInterface() : { } +void QXcbNativeInterface::beep() // For QApplication::beep() +{ +#ifdef XCB_USE_XLIB + ::Display *display = (::Display *)nativeResourceForScreen(QByteArrayLiteral("display"), QGuiApplication::primaryScreen()); + XBell(display, 0); +#else + fputc(7, stdout); +#endif +} + void *QXcbNativeInterface::nativeResourceForContext(const QByteArray &resourceString, QOpenGLContext *context) { QByteArray lowerCaseResource = resourceString.toLower(); diff --git a/src/plugins/platforms/xcb/qxcbnativeinterface.h b/src/plugins/platforms/xcb/qxcbnativeinterface.h index 75d42ac6b0..db0fa3e2ca 100644 --- a/src/plugins/platforms/xcb/qxcbnativeinterface.h +++ b/src/plugins/platforms/xcb/qxcbnativeinterface.h @@ -53,6 +53,7 @@ class QXcbConnection; class QXcbNativeInterface : public QPlatformNativeInterface { + Q_OBJECT public: enum ResourceType { Display, @@ -89,6 +90,8 @@ public: static void *eglContextForContext(QOpenGLContext *context); static void *glxContextForContext(QOpenGLContext *context); + Q_INVOKABLE void beep(); + private: const QByteArray m_genericEventFilterType; diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp index 5af6a9ec9d..68ccbfb8c0 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.cpp +++ b/src/plugins/platforms/xcb/qxcbwindow.cpp @@ -189,6 +189,7 @@ QXcbWindow::QXcbWindow(QWindow *window) , m_usingSyncProtocol(false) , m_deferredActivation(false) , m_embedded(false) + , m_alertState(false) , m_netWmUserTimeWindow(XCB_NONE) , m_dirtyFrameMargins(false) #if defined(XCB_USE_EGL) @@ -2047,4 +2048,17 @@ void QXcbWindow::setMask(const QRegion ®ion) #endif // !QT_NO_SHAPE +void QXcbWindow::setAlertState(bool enabled) +{ + if (m_alertState == enabled) + return; + const NetWmStates oldState = netWmStates(); + m_alertState = enabled; + if (enabled) { + setNetWmStates(oldState | NetWmStateDemandsAttention); + } else { + setNetWmStates(oldState & ~NetWmStateDemandsAttention); + } +} + QT_END_NAMESPACE diff --git a/src/plugins/platforms/xcb/qxcbwindow.h b/src/plugins/platforms/xcb/qxcbwindow.h index f4bd2d96ff..300596845e 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.h +++ b/src/plugins/platforms/xcb/qxcbwindow.h @@ -56,7 +56,6 @@ QT_BEGIN_NAMESPACE class QXcbScreen; class QXcbEGLSurface; class QIcon; - class QXcbWindow : public QXcbObject, public QPlatformWindow { public: @@ -120,6 +119,9 @@ public: void setMask(const QRegion ®ion); #endif // !QT_NO_SHAPE + void setAlertState(bool enabled); + bool isAlertState() const { 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; } @@ -194,6 +196,7 @@ private: bool m_deferredExpose; bool m_configureNotifyPending; bool m_embedded; + bool m_alertState; xcb_window_t m_netWmUserTimeWindow; QSurfaceFormat m_format; |