summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJan-Arve Saether <jan-arve.saether@nokia.com>2011-10-27 11:42:51 (GMT)
committerJan-Arve Saether <jan-arve.saether@nokia.com>2011-10-27 11:42:51 (GMT)
commit287c150aac9e4892801b6117fb6fa11a616b05a1 (patch)
treeefcb754eb1cf343d7f6f4ca35b0f296ad9abc174 /src
parent54b2bbc8f4c97dbcbbaedc4fa2c57a939094a6fe (diff)
downloadQt-287c150aac9e4892801b6117fb6fa11a616b05a1.zip
Qt-287c150aac9e4892801b6117fb6fa11a616b05a1.tar.gz
Qt-287c150aac9e4892801b6117fb6fa11a616b05a1.tar.bz2
Notify X11 of its resizable state through MWM Hints.
We only updated the MWM_FUNC_RESIZE when the window was shown. The consequence was that if the widget was initially shown in fixed size it would clear the MWM_FUNC_RESIZE flag, and we would never set it again if the widget became resizable later. Some window managers still support this (apparently it seems that compiz tried to adhere to this) Task-number: QTBUG-21914 Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/gui/kernel/qwidget_x11.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/gui/kernel/qwidget_x11.cpp b/src/gui/kernel/qwidget_x11.cpp
index f99cc2c..98c33da 100644
--- a/src/gui/kernel/qwidget_x11.cpp
+++ b/src/gui/kernel/qwidget_x11.cpp
@@ -2694,8 +2694,17 @@ void QWidgetPrivate::setConstraints_sys()
#ifdef ALIEN_DEBUG
qDebug() << "QWidgetPrivate::setConstraints_sys START" << q;
#endif
- if (q->testAttribute(Qt::WA_WState_Created))
+ if (q->testAttribute(Qt::WA_WState_Created)) {
do_size_hints(q, extra);
+ QtMWMHints mwmHints = GetMWMHints(X11->display, q->internalWinId());
+ const bool wasFuncResize = mwmHints.functions & MWM_FUNC_RESIZE;
+ if (q->minimumSize() == q->maximumSize())
+ mwmHints.functions &= ~MWM_FUNC_RESIZE;
+ else
+ mwmHints.functions |= MWM_FUNC_RESIZE;
+ if (wasFuncResize != (mwmHints.functions & MWM_FUNC_RESIZE))
+ SetMWMHints(X11->display, q->internalWinId(), mwmHints);
+ }
#ifdef ALIEN_DEBUG
qDebug() << "QWidgetPrivate::setConstraints_sys END" << q;
#endif