VirtualBox

Changeset 12017 in vbox


Ignore:
Timestamp:
Sep 3, 2008 8:30:05 AM (16 years ago)
Author:
vboxsync
Message:

Fe/Qt4: Fixed restoring of console maximize state. Newly created machine initially placed at the center of screen.

File:
1 edited

Legend:

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

    r12010 r12017  
    680680        if (ok)
    681681            max = str.section (',', 4, 4) == VBoxDefs::GUI_LastWindowPosition_Max;
     682
     683        QRect ar = QApplication::desktop()->availableGeometry (QPoint (x, y));
    682684        if (ok)
    683685        {
    684             QRect ar = QApplication::desktop()->availableGeometry (QPoint (x, y));
    685 
    686686            /* Do some position checks */
    687687            if (x < ar.left() || x > ar.right())
     
    691691
    692692            mNormalGeo = QRect (x, y, w, h);
    693 
    694             setGeometry (x, y, w, h);
     693            setGeometry (mNormalGeo);
     694
     695            /* Normalize to the optimal size */
     696            console->normalizeGeometry (true /* adjustPosition */);
    695697        }
    696698        else
    697             mNormalGeo = QRect();
    698 
    699         /* Normalize to the optimal size */
    700         console->normalizeGeometry (true /* adjustPosition */);
     699        {
     700            /* Normalize to the optimal size */
     701            console->normalizeGeometry (true /* adjustPosition */);
     702
     703            /* Move newly created window to the screen center. */
     704            mNormalGeo = geometry();
     705            mNormalGeo.moveCenter (ar.center());
     706            setGeometry (mNormalGeo);
     707        }
    701708
    702709        /* Maximize if needed */
     
    704711            setWindowState (windowState() | Qt::WindowMaximized);
    705712        was_max = max;
    706 
    707713        show();
     714
     715        /* Process show & possible maximize events */
     716        qApp->processEvents();
    708717
    709718        vmSeamlessAction->setEnabled (false);
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