From 287c150aac9e4892801b6117fb6fa11a616b05a1 Mon Sep 17 00:00:00 2001 From: Jan-Arve Saether Date: Thu, 27 Oct 2011 13:42:51 +0200 Subject: 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 --- src/gui/kernel/qwidget_x11.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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 -- cgit v0.12