Changeset 289


Ignore:
Timestamp:
Nov 5, 2009, 8:49:08 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

gui: Fixed two sizing-related bugs:

  • Fixed size top-level widgets could not be moved due to maximum size (as reported to PM) being smaller than the minimum size;
  • An attempt to unexpectedly change the internal widget size data in WM_SIZE in response to Qt initiated resize could cause an application crash in some styles (e.g. Windows classic style). This slipped in from Qt3 but is apparently not necessary in Qt4.
Location:
trunk/src/gui/kernel
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/src/gui/kernel/qapplication_pm.cpp

    r288 r289  
    120120    QWExtra    *xtra() { return d_func()->extraData(); }
    121121    QTLWExtra  *topData() { return d_func()->topData(); }
     122    QTLWExtra  *maybeTopData() { return d_func()->maybeTopData(); }
    122123// @todo later
    123 //  QTLWExtra  *maybeTopData() { return d_func()->maybeTopData(); }
    124124//  void syncBackingStore(const QRegion &rgn) { d_func()->syncBackingStore(rgn); }
    125125//  void syncBackingStore() { d_func()->syncBackingStore(); }
     
    11291129                    minh = x->minh + fs.top() + fs.bottom();
    11301130                if (x->maxw < QWIDGETSIZE_MAX)
    1131                     maxw = x->maxw >= x->minw ? x->maxw : x->minw + fs.left() + fs.right();
     1131                    maxw = x->maxw > x->minw ? x->maxw + fs.left() + fs.right() : minw;
    11321132                if (x->maxh < QWIDGETSIZE_MAX)
    1133                     maxh = x->maxh >= x->minh ? x->maxh : x->minh + fs.top() + fs.bottom();
     1133                    maxh = x->maxh > x->minh ? x->maxh + fs.top() + fs.bottom() : minh;
    11341134                // obey system recommended minimum size (to emulate Qt/Win32)
    11351135                pti->ptlMinTrackSize.x = qMax<LONG>(minw, pti->ptlMinTrackSize.x);
     
    20422042    if (!testAttribute(Qt::WA_WState_Created)) // in QWidget::create()
    20432043        return true;
    2044 
    2045     if (testAttribute(Qt::WA_WState_ConfigPending)) {
    2046         // it's possible that we're trying to set the frame size smaller
    2047         // than it possible for WC_FRAME in QWidget::setGeometry_sys().
    2048         // here we correct this (crect there is set before WinSetWindowPos()
    2049         // that sends WM_SIZE).
    2050         QSize newSize(SHORT1FROMMP(qmsg.mp2), SHORT2FROMMP(qmsg.mp2));
    2051         if (qmsg.msg == WM_SIZE && size() != newSize)
    2052             data->crect.setSize(newSize);
     2044    if (testAttribute(Qt::WA_WState_ConfigPending))
    20532045        return true;
    2054     }
    2055 
    20562046    if (testAttribute(Qt::WA_DontShowOnScreen))
    20572047        return true;
    2058     // @todo check if this is actually called for !isWindow() widget
    2059 //  if (!isWindow())
    2060 //      return true;
     2048
     2049    // @todo there are other isWindow() checks below (same in Windows code).
     2050    // Either they or this return statement are leftovers. The assertion may
     2051    // tell the truth.
     2052    Q_ASSERT(isWindow());
     2053    if (!isWindow())
     2054        return true;
    20612055
    20622056    // When the window is minimized, PM moves it to -32000,-32000 and resizes
  • TabularUnified trunk/src/gui/kernel/qwidget_pm.cpp

    r187 r289  
    24042404void QWidgetPrivate::setModal_sys()
    24052405{
    2406     // @todo implement
    24072406}
    24082407
Note: See TracChangeset for help on using the changeset viewer.