summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSamuel Rødal <samuel.rodal@nokia.com>2011-02-10 17:42:51 (GMT)
committerSamuel Rødal <samuel.rodal@nokia.com>2011-02-10 17:53:29 (GMT)
commit6257adcdd693ac5c4c258fd81b0e6b2dcfbf8750 (patch)
tree0745291b0971dac22df01c4a51797d58bff276dd /src
parent03b79ca3fda15df214c68ee945ac56000a404d99 (diff)
downloadQt-6257adcdd693ac5c4c258fd81b0e6b2dcfbf8750.zip
Qt-6257adcdd693ac5c4c258fd81b0e6b2dcfbf8750.tar.gz
Qt-6257adcdd693ac5c4c258fd81b0e6b2dcfbf8750.tar.bz2
Added WM_TRANSIENT_FOR property to XCB backend.
Diffstat (limited to 'src')
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp
index e9ff5df..824a967 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.cpp
+++ b/src/plugins/platforms/xcb/qxcbwindow.cpp
@@ -57,6 +57,19 @@
#include "qglxintegration.h"
#endif
+// Returns true if we should set WM_TRANSIENT_FOR on \a w
+static inline bool isTransient(const QWidget *w)
+{
+ return ((w->windowType() == Qt::Dialog
+ || w->windowType() == Qt::Sheet
+ || w->windowType() == Qt::Tool
+ || w->windowType() == Qt::SplashScreen
+ || w->windowType() == Qt::ToolTip
+ || w->windowType() == Qt::Drawer
+ || w->windowType() == Qt::Popup)
+ && !w->testAttribute(Qt::WA_X11BypassTransientForHint));
+}
+
QXcbWindow::QXcbWindow(QWidget *tlw)
: QPlatformWindow(tlw)
#ifdef XCB_USE_XLIB_FOR_GLX
@@ -141,6 +154,16 @@ QXcbWindow::QXcbWindow(QWidget *tlw)
32,
propertyCount,
properties);
+
+ if (isTransient(tlw) && tlw->parentWidget()) {
+ // ICCCM 4.1.2.6
+ QWidget *p = tlw->parentWidget()->window();
+ xcb_window_t parentWindow = p->winId();
+ xcb_change_property(xcb_connection(), XCB_PROP_MODE_REPLACE, m_window,
+ XCB_ATOM_WM_TRANSIENT_FOR, XCB_ATOM_WINDOW, 32,
+ 1, &parentWindow);
+
+ }
}
QXcbWindow::~QXcbWindow()