summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@theqtcompany.com>2015-11-25 11:07:51 +0100
committerUlf Hermann <ulf.hermann@theqtcompany.com>2015-11-25 16:15:47 +0000
commit5645dc9f8a5264bde855d5b14c619198cfedf3a5 (patch)
tree08b7bdc2187677805f5423148d16e9e867a598b0
parent1e761c80cf2d670a4c0ded6d18ab0f526560c239 (diff)
Xcb: propagate stays-on-top or -below hints from window flags
Before, you had to first hide a window, then set the flags, then show it again as the flags were only applied when showing the window. This is unintuitive. Task-number: QTBUG-49628 Change-Id: I240e633ac2581c0ff0e4f35dead1b79e15e15350 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.cpp10
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.h1
2 files changed, 11 insertions, 0 deletions
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp
index d76f1245e8..5d052a7ca1 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.cpp
+++ b/src/plugins/platforms/xcb/qxcbwindow.cpp
@@ -1098,6 +1098,7 @@ void QXcbWindow::setWindowFlags(Qt::WindowFlags flags)
}
setWmWindowType(wmWindowTypes, flags);
+ setNetWmStateWindowFlags(flags);
setMotifWindowFlags(flags);
setTransparentForMouseEvents(flags & Qt::WindowTransparentForInput);
@@ -1333,6 +1334,15 @@ void QXcbWindow::updateNetWmStateBeforeMap()
setNetWmStates(states);
}
+void QXcbWindow::setNetWmStateWindowFlags(Qt::WindowFlags flags)
+{
+ changeNetWmState(flags & Qt::WindowStaysOnTopHint,
+ atom(QXcbAtom::_NET_WM_STATE_ABOVE),
+ atom(QXcbAtom::_NET_WM_STATE_STAYS_ON_TOP));
+ changeNetWmState(flags & Qt::WindowStaysOnBottomHint,
+ atom(QXcbAtom::_NET_WM_STATE_BELOW));
+}
+
void QXcbWindow::updateNetWmUserTime(xcb_timestamp_t timestamp)
{
xcb_window_t wid = m_window;
diff --git a/src/plugins/platforms/xcb/qxcbwindow.h b/src/plugins/platforms/xcb/qxcbwindow.h
index 41c4b4443d..1a8e031779 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.h
+++ b/src/plugins/platforms/xcb/qxcbwindow.h
@@ -184,6 +184,7 @@ protected:
void setNetWmStates(NetWmStates);
void setMotifWindowFlags(Qt::WindowFlags flags);
+ void setNetWmStateWindowFlags(Qt::WindowFlags flags);
void updateMotifWmHintsBeforeMap();
void updateNetWmStateBeforeMap();