Changeset 11109 in vbox for trunk/src/VBox/Frontends/VirtualBox4
- Timestamp:
- Aug 4, 2008 3:42:17 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxSelectorWnd.cpp
r10890 r11109 590 590 retranslateUi(); 591 591 592 /* restore the position of the window */592 /* Restore the position of the window */ 593 593 { 594 594 CVirtualBox vbox = vboxGlobal().virtualBox(); … … 609 609 { 610 610 QRect ar = QApplication::desktop()->availableGeometry (QPoint (x, y)); 611 611 612 /* Do some position checks */ 612 613 if (x < ar.left() || x > ar.right()) … … 614 615 if (y < ar.top() || y > ar.bottom()) 615 616 y = ar.top(); 616 move (x, y); 617 resize (QSize (w, h).expandedTo (minimumSizeHint()) 618 .boundedTo (ar.size())); 617 618 /* Composing normal parameters */ 619 normal_size = QSize (w, h).expandedTo (minimumSizeHint()) 620 .boundedTo (ar.size()); 621 normal_pos = QPoint (x, y); 622 623 /* Applying normal parameters */ 624 resize (normal_size); 625 move (normal_pos); 619 626 if (max) 620 627 /* maximize if needed */ … … 707 714 CVirtualBox vbox = vboxGlobal().virtualBox(); 708 715 709 /* save the position of the window */716 /* Save the position of the window */ 710 717 { 711 718 QString winPos = QString ("%1,%2,%3,%4") 712 .arg (normal_pos.x()).arg (normal_pos.y()) 719 .arg (normal_pos.x()) 720 .arg (normal_pos.y()) 713 721 .arg (normal_size.width()) 714 722 .arg (normal_size.height()); … … 718 726 vbox.SetExtraData (VBoxDefs::GUI_LastWindowPosition, winPos); 719 727 } 720 /* save vm selector position */ 728 729 /* Save vm selector position */ 721 730 { 722 731 VBoxVMItem *item = mVMListView->selectedItem(); … … 1117 1126 if ((windowState() & (Qt::WindowMaximized | Qt::WindowMinimized | 1118 1127 Qt::WindowFullScreen)) == 0) 1119 normal_pos = pos(); 1128 { 1129 /* On X11 systems window remains un-framed before it 1130 * shown and painted for the first time. In this case 1131 * qt returns similar values for window's position either 1132 * including or excluding window's frame. We no need to 1133 * memorize window's position in this case as this is 1134 * not normal situation, so just ignoring such events. 1135 * Do not trust frameGeometry() in this situation. */ 1136 1137 if (!(pos().x() == geometry().x() && pos().y() == geometry().y())) 1138 normal_pos = pos(); 1139 } 1120 1140 break; 1121 1141 }
Note:
See TracChangeset
for help on using the changeset viewer.