summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qwidget_x11.cpp
diff options
context:
space:
mode:
authorDominik Holland <dominik.holland@nokia.com>2010-09-30 08:04:50 (GMT)
committerDominik Holland <dominik.holland@nokia.com>2010-10-01 11:16:33 (GMT)
commit8a895dbcc9aacab3b0059119650a74bbaff1a27b (patch)
tree8a952f2b61619653d762f98841a59a40321134e4 /src/gui/kernel/qwidget_x11.cpp
parent19085117bfece0709c996ed445a476add4f6815b (diff)
downloadQt-8a895dbcc9aacab3b0059119650a74bbaff1a27b.zip
Qt-8a895dbcc9aacab3b0059119650a74bbaff1a27b.tar.gz
Qt-8a895dbcc9aacab3b0059119650a74bbaff1a27b.tar.bz2
Setting the _NET_WM_STATE Atom only when its not already set
Task: QT-3918 Reviewed By: Bradley T. Hughes
Diffstat (limited to 'src/gui/kernel/qwidget_x11.cpp')
-rw-r--r--src/gui/kernel/qwidget_x11.cpp21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/gui/kernel/qwidget_x11.cpp b/src/gui/kernel/qwidget_x11.cpp
index 8d80e10..9085e98 100644
--- a/src/gui/kernel/qwidget_x11.cpp
+++ b/src/gui/kernel/qwidget_x11.cpp
@@ -1933,20 +1933,27 @@ void QWidgetPrivate::show_sys()
if (flags & Qt::WindowStaysOnTopHint) {
if (flags & Qt::WindowStaysOnBottomHint)
qWarning() << "QWidget: Incompatible window flags: the window can't be on top and on bottom at the same time";
- netWmState.append(ATOM(_NET_WM_STATE_ABOVE));
- netWmState.append(ATOM(_NET_WM_STATE_STAYS_ON_TOP));
+ if (!netWmState.contains(ATOM(_NET_WM_STATE_ABOVE)))
+ netWmState.append(ATOM(_NET_WM_STATE_ABOVE));
+ if (!netWmState.contains(ATOM(_NET_WM_STATE_STAYS_ON_TOP)))
+ netWmState.append(ATOM(_NET_WM_STATE_STAYS_ON_TOP));
} else if (flags & Qt::WindowStaysOnBottomHint) {
- netWmState.append(ATOM(_NET_WM_STATE_BELOW));
+ if (!netWmState.contains(ATOM(_NET_WM_STATE_BELOW)))
+ netWmState.append(ATOM(_NET_WM_STATE_BELOW));
}
if (q->isFullScreen()) {
- netWmState.append(ATOM(_NET_WM_STATE_FULLSCREEN));
+ if (!netWmState.contains(ATOM(_NET_WM_STATE_FULLSCREEN)))
+ netWmState.append(ATOM(_NET_WM_STATE_FULLSCREEN));
}
if (q->isMaximized()) {
- netWmState.append(ATOM(_NET_WM_STATE_MAXIMIZED_HORZ));
- netWmState.append(ATOM(_NET_WM_STATE_MAXIMIZED_VERT));
+ if (!netWmState.contains(ATOM(_NET_WM_STATE_MAXIMIZED_HORZ)))
+ netWmState.append(ATOM(_NET_WM_STATE_MAXIMIZED_HORZ));
+ if (!netWmState.contains(ATOM(_NET_WM_STATE_MAXIMIZED_VERT)))
+ netWmState.append(ATOM(_NET_WM_STATE_MAXIMIZED_VERT));
}
if (data.window_modality != Qt::NonModal) {
- netWmState.append(ATOM(_NET_WM_STATE_MODAL));
+ if (!netWmState.contains(ATOM(_NET_WM_STATE_MODAL)))
+ netWmState.append(ATOM(_NET_WM_STATE_MODAL));
}
if (!netWmState.isEmpty()) {