VirtualBox

Changeset 10148 in vbox


Ignore:
Timestamp:
Jul 3, 2008 9:27:02 AM (17 years ago)
Author:
vboxsync
Message:

FE/Qt: Backported 32672 (FE/Qt4: Do checking of the inital position (Fixes: #2965).)

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

Legend:

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

    r9054 r10148  
    705705        QString str = cmachine.GetExtraData (VBoxDefs::GUI_LastWindowPosition);
    706706
    707         QRect ar = QApplication::desktop()->availableGeometry (this);
    708707        bool ok = false, max = false;
    709708        int x = 0, y = 0, w = 0, h = 0;
     
    719718        if (ok)
    720719        {
     720            QRect ar = QApplication::desktop()->availableGeometry (QPoint (x, y));
     721            /* Do some position checks */
     722            if (x < ar.left() || x > ar.right())
     723                x = ar.left();
     724            if (y < ar.top() || y > ar.bottom())
     725                y = ar.top();
     726
    721727            normal_pos = QPoint (x, y);
    722728            normal_size = QSize (w, h);
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxSelectorWnd.cpp

    r8296 r10148  
    579579        QString winPos = vbox.GetExtraData (VBoxDefs::GUI_LastWindowPosition);
    580580
    581         QRect ar = QApplication::desktop()->availableGeometry (pos());
    582581        bool ok = false, max = false;
    583582        int x = 0, y = 0, w = 0, h = 0;
     
    593592        if (ok)
    594593        {
     594            QRect ar = QApplication::desktop()->availableGeometry (QPoint (x, y));
     595            /* Do some position checks */
     596            if (x < ar.left() || x > ar.right())
     597                x = ar.left();
     598            if (y < ar.top() || y > ar.bottom())
     599                y = ar.top();
    595600            move (x, y);
    596601            resize (QSize (w, h).expandedTo (minimumSizeHint())
     
    602607        else
    603608        {
     609            QRect ar = QApplication::desktop()->availableGeometry (this);
    604610            resize (QSize (770, 550).expandedTo (minimumSizeHint())
    605611                .boundedTo (ar.size()));
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