VirtualBox

Changeset 14907 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Dec 2, 2008 2:49:19 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
40252
Message:

FE/Qt4: 3253: Selector window doesn't save position - fixed. Checked on win, kde, compiz win managers.

Location:
trunk/src/VBox/Frontends/VirtualBox4
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox4/include/VBoxSelectorWnd.h

    r14652 r14907  
    175175    VBoxVMDescriptionPage *mVmDescriptionPage;
    176176
    177     QPoint mNormalPos;
    178     QSize mNormalSize;
     177    QRect mNormalGeo;
    179178
    180179    bool mDoneInaccessibleWarningOnce : 1;
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxSelectorWnd.cpp

    r14706 r14907  
    591591        if (ok)
    592592            max = winPos.section (',', 4, 4) == VBoxDefs::GUI_LastWindowPosition_Max;
    593         if (ok)
     593        if (ok && x > 0 && y > 0 /* to be sure it is not loaded out of the screen */)
    594594        {
    595595            QRect ar = QApplication::desktop()->availableGeometry (QPoint (x, y));
     
    601601                y = ar.top();
    602602
    603             /* Composing normal parameters */
    604             mNormalSize = QSize (w, h).expandedTo (minimumSizeHint())
    605                           .boundedTo (ar.size());
    606             mNormalPos = QPoint (x, y);
    607 
    608             /* Applying normal parameters */
    609             resize (mNormalSize);
    610             move (mNormalPos);
     603            mNormalGeo.moveTo (x, y);
     604            mNormalGeo.setSize (QSize (w, h).expandedTo (minimumSizeHint())
     605                                            .boundedTo (ar.size()));
     606            setGeometry (mNormalGeo);
     607
    611608            if (max)
    612609                /* maximize if needed */
     
    616613        {
    617614            QRect ar = QApplication::desktop()->availableGeometry (this);
    618             resize (QSize (770, 550).expandedTo (minimumSizeHint())
    619                 .boundedTo (ar.size()));
     615            mNormalGeo.setSize (QSize (770, 550).expandedTo (minimumSizeHint())
     616                                                .boundedTo (ar.size()));
     617            mNormalGeo.moveCenter (ar.center());
     618            setGeometry (mNormalGeo);
    620619        }
    621620    }
     
    698697    {
    699698        QString winPos = QString ("%1,%2,%3,%4")
    700                                  .arg (mNormalPos.x())
    701                                  .arg (mNormalPos.y())
    702                                  .arg (mNormalSize.width())
    703                                  .arg (mNormalSize.height());
     699            .arg (mNormalGeo.x()).arg (mNormalGeo.y())
     700            .arg (mNormalGeo.width()).arg (mNormalGeo.height());
    704701        if (isMaximized())
    705702            winPos += QString (",%1").arg (VBoxDefs::GUI_LastWindowPosition_Max);
     
    11701167            if ((windowState() & (Qt::WindowMaximized | Qt::WindowMinimized |
    11711168                                  Qt::WindowFullScreen)) == 0)
    1172                 mNormalSize = re->size();
     1169                mNormalGeo.setSize (re->size());
    11731170            break;
    11741171        }
     
    11771174            if ((windowState() & (Qt::WindowMaximized | Qt::WindowMinimized |
    11781175                                  Qt::WindowFullScreen)) == 0)
    1179             {
    1180                 /* On X11 systems window remains un-framed before it
    1181                  * shown and painted for the first time. In this case
    1182                  * qt returns similar values for window's position either
    1183                  * including or excluding window's frame. We no need to
    1184                  * memorize window's position in this case as this is
    1185                  * not normal situation, so just ignoring such events.
    1186                  * Do not trust frameGeometry() in this situation. */
    1187 
    1188                 if (!(pos().x() == geometry().x() && pos().y() == geometry().y()))
    1189                     mNormalPos = pos();
    1190             }
     1176                mNormalGeo.moveTo (geometry().x(), geometry().y());
    11911177            break;
    11921178        }
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette