VirtualBox

Changeset 8219 in vbox


Ignore:
Timestamp:
Apr 21, 2008 11:47:41 AM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
29938
Message:

Frontends/VirtualBox3/4: removed responsibility for remembering the last guest resolution from the GUI again

Location:
trunk/src/VBox/Frontends
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxConsoleView.h

    r8155 r8219  
    198198
    199199    void setDesktopGeometry(int minWidth, int minHeight);
    200     void sendInitialSizeHint(void);
    201200    void maybeRestrictMinimumSize();
    202201
     
    285284    CGImageRef mVirtualBoxLogo;
    286285#endif
    287     QSize mLastSizeHint;
    288286    QRect mDesktopGeometry;
    289287};
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxDefs.h

    r8155 r8219  
    169169    static const char* GUI_LastVMSelected;
    170170    static const char* GUI_InfoDlgState;
    171     static const char* GUI_LastSizeHint;
    172171};
    173172
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleView.cpp

    r8155 r8219  
    10751075                    updateGeometry();
    10761076
    1077                 /* Remember the new size for sending an initial size hint
    1078                    on next power up. */
    1079                 if (mConsole.GetGuest().GetSupportsGraphics())
    1080                     mLastSizeHint = QSize(re->width(), re->height());
    1081 
    10821077                /* make sure that all posted signals are processed */
    10831078                qApp->processEvents();
     
    28562851                }
    28572852            }
    2858             else if (mLastState == KMachineState_Starting)
    2859             {
    2860                 /* Suggest an initial size. */
    2861                 sendInitialSizeHint ();
    2862             }
    28632853            /* reuse the focus event handler to capture input */
    28642854            if (hasFocus())
    28652855                focusEvent (true /* aHasFocus */);
    28662856            break;
    2867         }
    2868         case KMachineState_Stopping:
    2869         {
    2870             if (mLastSizeHint.isValid())
    2871             {
    2872                 CMachine cmachine = mConsole.GetMachine();
    2873                 QString str = QString ("%1,%2")
    2874                                       .arg (mLastSizeHint.width())
    2875                                       .arg (mLastSizeHint.height());
    2876                 cmachine.SetExtraData (VBoxDefs::GUI_LastSizeHint, str);
    2877             }
    28782857        }
    28792858        default:
     
    35583537
    35593538/**
    3560  * We send an initial size hint to the VM on startup, based on the last
    3561  * resize event in the last session (if any).
    3562  */
    3563 void VBoxConsoleView::sendInitialSizeHint(void)
    3564 {
    3565     CMachine cmachine = mConsole.GetMachine();
    3566     QString str = cmachine.GetExtraData (VBoxDefs::GUI_LastSizeHint);
    3567     int w = 0, h = 0;
    3568     bool ok = true;
    3569     w = str.section (',', 0, 0).toInt (&ok);
    3570     if (ok)
    3571         h = str.section (',', 1, 1).toInt (&ok);
    3572     QRect screen = QApplication::desktop()->screenGeometry (this);
    3573     if (ok && w <= screen.width() && h <= screen.height())
    3574     {
    3575         LogFlowFunc (("Will suggest %d x %d\n", w, h));
    3576         mConsole.GetDisplay().SetVideoModeHint (w, h, 0, 0);
    3577     }
    3578 }
    3579 
    3580 /**
    35813539 *  Sets the the minimum size restriction depending on the auto-resize feature
    35823540 *  state and the current rendering mode.
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxDefs.cpp

    r8155 r8219  
    4040const char* VBoxDefs::GUI_LastVMSelected = "GUI/LastVMSelected";
    4141const char* VBoxDefs::GUI_InfoDlgState = "GUI/InfoDlgState";
    42 const char* VBoxDefs::GUI_LastSizeHint = "GUI/LastSizeHint";
  • trunk/src/VBox/Frontends/VirtualBox4/include/VBoxConsoleView.h

    r8155 r8219  
    216216
    217217    void setDesktopGeometry(int minWidth, int minHeight);
    218     void sendInitialSizeHint(void);
    219218    void maybeRestrictMinimumSize();
    220219
     
    302301    CGImageRef mVirtualBoxLogo;
    303302#endif
    304     QSize mLastSizeHint;
    305303    QRect mDesktopGeometry;
    306304};
  • trunk/src/VBox/Frontends/VirtualBox4/include/VBoxDefs.h

    r8159 r8219  
    169169    static const char* GUI_LastVMSelected;
    170170    static const char* GUI_InfoDlgState;
    171     static const char* GUI_LastSizeHint;
    172171};
    173172
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxDefs.cpp

    r8155 r8219  
    4040const char* VBoxDefs::GUI_LastVMSelected = "GUI/LastVMSelected";
    4141const char* VBoxDefs::GUI_InfoDlgState = "GUI/InfoDlgState";
    42 const char* VBoxDefs::GUI_LastSizeHint = "GUI/LastSizeHint";
Note: See TracChangeset for help on using the changeset viewer.

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