Changeset 14907 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Dec 2, 2008 2:49:19 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 40252
- Location:
- trunk/src/VBox/Frontends/VirtualBox4
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxSelectorWnd.h
r14652 r14907 175 175 VBoxVMDescriptionPage *mVmDescriptionPage; 176 176 177 QPoint mNormalPos; 178 QSize mNormalSize; 177 QRect mNormalGeo; 179 178 180 179 bool mDoneInaccessibleWarningOnce : 1; -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxSelectorWnd.cpp
r14706 r14907 591 591 if (ok) 592 592 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 */) 594 594 { 595 595 QRect ar = QApplication::desktop()->availableGeometry (QPoint (x, y)); … … 601 601 y = ar.top(); 602 602 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 611 608 if (max) 612 609 /* maximize if needed */ … … 616 613 { 617 614 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); 620 619 } 621 620 } … … 698 697 { 699 698 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()); 704 701 if (isMaximized()) 705 702 winPos += QString (",%1").arg (VBoxDefs::GUI_LastWindowPosition_Max); … … 1170 1167 if ((windowState() & (Qt::WindowMaximized | Qt::WindowMinimized | 1171 1168 Qt::WindowFullScreen)) == 0) 1172 mNormal Size = re->size();1169 mNormalGeo.setSize (re->size()); 1173 1170 break; 1174 1171 } … … 1177 1174 if ((windowState() & (Qt::WindowMaximized | Qt::WindowMinimized | 1178 1175 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()); 1191 1177 break; 1192 1178 }
Note:
See TracChangeset
for help on using the changeset viewer.