Changeset 122 for trunk/src/gui


Ignore:
Timestamp:
Aug 20, 2009, 12:19:08 AM (16 years ago)
Author:
Dmitry A. Kuminov
Message:

gui: Don't change top level window size/position in Qt when it gets minimized (makes it similar to other platforms like Windows).

Location:
trunk/src/gui/kernel
Files:
2 edited

Legend:

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

    r121 r122  
    16261626//      return true;
    16271627
     1628
     1629
     1630
     1631
     1632
    16281633    setAttribute(Qt::WA_WState_ConfigPending); // set config flag
    16291634
     
    16371642    if (qmsg.msg == WM_SIZE) { // resize event
    16381643        QSize oldSize = data->crect.size();
    1639         QSize newSize;
    1640         if (isWindow()) {
    1641             // the frame strut may have changed (e.g. after minimize)
    1642             d_func()->updateFrameStrut();
    1643             newSize = data->crect.size();
    1644         } else {
    1645             newSize = QSize(SHORT1FROMMP(qmsg.mp2), SHORT2FROMMP(qmsg.mp2));
    1646             data->crect.setSize(newSize);
    1647         }
     1644        QSize newSize = QSize(SHORT1FROMMP(qmsg.mp2), SHORT2FROMMP(qmsg.mp2));
     1645        data->crect.setSize(newSize);
    16481646        if (isWindow()) {                        // update title/icon text
    16491647            d_func()->createTLExtra();
  • trunk/src/gui/kernel/qwidget_pm.cpp

    r121 r122  
    14111411                    }
    14121412                } else {
    1413                     d->updateFrameStrut();
     1413                    // @todo most likely, we don't need this as in PM the frame
     1414                    // strut seems to never change during window lifetime
     1415//                  d->updateFrameStrut();
    14141416                }
    14151417            }
     
    18211823                if (!q->isVisible())
    18221824                    WinInvalidateRect(q->internalWinId(), NULL, FALSE);
    1823 
    1824                 // If the layout has heightForWidth, the WinSetWindowPos() above can
    1825                 // change the size/position, so refresh them.
    1826                 WinQueryWindowPos(fId, &swp);
    1827                 // flip y coordinate
    1828                 swp.y = sh - (swp.y + swp.cy);
    1829                 QRect fs(frameStrut());
    1830                 data.crect.setRect(swp.x + fs.left(),
    1831                                    swp.y + fs.top(),
    1832                                    swp.cx - fs.left() - fs.right(),
    1833                                    swp.cy - fs.top() - fs.bottom());
    1834                 isResize = data.crect.size() != oldSize;
     1825                if (!(swp.fl & SWP_MINIMIZE)) {
     1826                    // If the layout has heightForWidth, the WinSetWindowPos() above can
     1827                    // change the size/position, so refresh them. Note that if the
     1828                    // widget is minimized, we don't update its size in Qt (see
     1829                    // QApplication::translateConfigEvent()).
     1830                    WinQueryWindowPos(fId, &swp);
     1831                    // flip y coordinate
     1832                    swp.y = sh - (swp.y + swp.cy);
     1833                    QRect fs(frameStrut());
     1834                    data.crect.setRect(swp.x + fs.left(),
     1835                                       swp.y + fs.top(),
     1836                                       swp.cx - fs.left() - fs.right(),
     1837                                       swp.cy - fs.top() - fs.bottom());
     1838                    isResize = data.crect.size() != oldSize;
     1839                }
    18351840            } else {
    18361841                q->setAttribute(Qt::WA_OutsideWSRange, false);
Note: See TracChangeset for help on using the changeset viewer.