VirtualBox

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


Ignore:
Timestamp:
Aug 5, 2008 2:47:00 PM (16 years ago)
Author:
vboxsync
Message:

Fe/Qt4: Fixed bug of saving/restoring window position of VM Console under KDE/GNOME.

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

Legend:

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

    r10439 r11135  
    297297    QMap <QAction *, CHostFloppyDrive> hostFloppyMap;
    298298
    299     QPoint normal_pos;
    300     QSize normal_size;
     299    QRect mNormalGeometry;
    301300    QSize prev_min_size;
    302301
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxConsoleWnd.cpp

    r11130 r11135  
    708708#endif
    709709
    710     /* restore the position of the window and some options */
     710    /* Restore the position of the window and some options */
    711711    {
    712712        QString str = cmachine.GetExtraData (VBoxDefs::GUI_LastWindowPosition);
     
    726726        {
    727727            QRect ar = QApplication::desktop()->availableGeometry (QPoint (x, y));
     728
    728729            /* Do some position checks */
    729730            if (x < ar.left() || x > ar.right())
     
    732733                y = ar.top();
    733734
    734             normal_pos = QPoint (x, y);
    735             normal_size = QSize (w, h);
    736 
    737             move (normal_pos);
    738             resize (normal_size);
     735            mNormalGeometry = QRect (x, y, w, h);
     736
     737            setGeometry (x, y, w, h);
    739738        }
    740739        else
    741         {
    742             normal_pos = QPoint();
    743             normal_size = QSize();
    744         }
    745         /* normalize to the optimal size */
     740            mNormalGeometry = QRect();
     741
     742        /* Normalize to the optimal size */
    746743        console->normalizeGeometry (true /* adjustPosition */);
    747         /* maximize if needed */
     744
     745        /* Maximize if needed */
    748746        if (max)
    749747            setWindowState (windowState() | Qt::WindowMaximized);
     
    10111009        CMachine machine = csession.GetMachine();
    10121010        QString winPos = QString ("%1,%2,%3,%4")
    1013                                  .arg (normal_pos.x()).arg (normal_pos.y())
    1014                                  .arg (normal_size.width())
    1015                                  .arg (normal_size.height());
     1011            .arg (mNormalGeometry.x()).arg (mNormalGeometry.y())
     1012            .arg (mNormalGeometry.width()).arg (mNormalGeometry.height());
    10161013        if (isMaximized() || (mIsFullscreen && was_max)
    10171014                          || (mIsSeamless && was_max))
     
    11351132                !isTrueFullscreen() && !isTrueSeamless())
    11361133            {
    1137                 normal_size = re->size();
     1134                mNormalGeometry.setSize (re->size());
    11381135#ifdef VBOX_WITH_DEBUGGER_GUI
    11391136                dbgAdjustRelativePos();
     
    11551152            if (!isMaximized() && !isTrueFullscreen() && !isTrueSeamless())
    11561153            {
    1157                 normal_pos = pos();
     1154                mNormalGeometry.moveTo (geometry().x(), geometry().y());
    11581155#ifdef VBOX_WITH_DEBUGGER_GUI
    11591156                dbgAdjustRelativePos();
Note: See TracChangeset for help on using the changeset viewer.

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