VirtualBox

Changeset 44305 in vbox


Ignore:
Timestamp:
Jan 16, 2013 12:01:19 PM (12 years ago)
Author:
vboxsync
Message:

VboxTray/VideoMode: Dynamic configuration of secondary monitor for windows guest. (Enabling/disabling/Change of resolution/position).

Fix for the error reported on #6118 comment 46, "setvideomodehint 1024*768 32 1 yes" not working.
If the previous resolution of the disabled secondary screen is 1024*768*32 and command is issued"setvideomodehint 1024*768 32 1 yes", then there is a conditional block in the code returns TRUE assuming that it is already at desired resolution and no further action is required.

To fix the issue, now I am checking that if the monitor, for which the request is being made, is disabled then conditional block will return FALSE and code will proceed further to enable the monitor.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxDisplay.cpp

    r44297 r44305  
    360360                                VBOXDISPLAYCONTEXT *pCtx, BOOL fExtDispSup)
    361361{
     362    BOOL fDispAlreadyEnabled = false; /* check whether the monitor with ID is already enabled. */
    362363    BOOL fModeReset = (Width == 0 && Height == 0 && BitsPerPixel == 0 &&
    363364                       dwNewPosX == 0 && dwNewPosY == 0);
     
    448449
    449450            paDisplayDevices[DevNum] = DisplayDevice;
     451            /* Keep a record if the display with ID is already active or not. */
     452            if (paDisplayDevices[Id].StateFlags & DISPLAY_DEVICE_ACTIVE)
     453            {
     454                LogFlow(("VBoxTray: Display with ID=%d already enabled\n", Id));
     455                fDispAlreadyEnabled = TRUE;
     456            }
    450457
    451458            /* First try to get the video mode stored in registry (ENUM_REGISTRY_SETTINGS).
     
    546553     * is always 1.
    547554     */
    548     if (   !fModeReset && fEnabled
     555    /* Handled the case where previouseresolution of secondary monitor
     556     * was for eg. 1024*768*32 and monitor was in disabled state.
     557     * User gives the command
     558     * setvideomode 1024 768 32 1 yes.
     559     * Now in this case the resolution request is same as previous one but
     560     * monitor is going from disabled to enabled state so the below condition
     561     * shour return false
     562     * The below condition will only return true , if no mode reset has
     563     * been requested AND fEnabled is 1 and fDispAlreadyEnabled is also 1 AND
     564     * all rect conditions are true. Thus in this case nothing has to be done.
     565     */
     566    if ( !fModeReset && fEnabled && fDispAlreadyEnabled
    549567        && paRects[Id].right - paRects[Id].left == Width
    550568        && paRects[Id].bottom - paRects[Id].top == Height
Note: See TracChangeset for help on using the changeset viewer.

© 2023 Oracle
ContactPrivacy policyTerms of Use