VirtualBox

Changeset 3774 in vbox


Ignore:
Timestamp:
Jul 23, 2007 9:01:49 AM (17 years ago)
Author:
vboxsync
Message:

Updates for changing seamless mode

Location:
trunk/src/VBox/Devices/VMMDev
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/VMMDev/VBoxDev.cpp

    r3772 r3774  
    2626#include <string.h>
    2727
     28#define LOG_GROUP LOG_GROUP_DEV_VMM
     29#include <VBox/log.h>
     30
    2831#include <VBox/VBoxDev.h>
    2932#include <VBox/VBoxGuest.h>
     
    3437#include <VBox/vm.h> /* for VM_IS_EMT */
    3538
    36 #define LOG_GROUP LOG_GROUP_DEV_VMM
    37 #include <VBox/log.h>
    3839#include <iprt/assert.h>
    3940#include <iprt/time.h>
     
    11551156        }
    11561157
     1158        case VMMDevReq_GetSeamlessChangeRequest:
     1159        {
     1160            if (requestHeader->size != sizeof(VMMDevSeamlessChangeRequest))
     1161            {
     1162                requestHeader->rc = VERR_INVALID_PARAMETER;
     1163            }
     1164            else
     1165            {
     1166                VMMDevSeamlessChangeRequest *seamlessChangeRequest = (VMMDevSeamlessChangeRequest*)requestHeader;
     1167                /* just pass on the information */
     1168                Log(("VMMDev: returning seamless change request mode=%d\n", pData->SeamlessMode));
     1169                seamlessChangeRequest->mode    = pData->SeamlessMode;
     1170
     1171                if (seamlessChangeRequest->eventAck == VMMDEV_EVENT_SEAMLESS_MODE_CHANGE_REQUEST)
     1172                {
     1173                    /* Remember which mode the client has queried. */
     1174                    pData->lastSeamlessMode = pData->SeamlessMode;
     1175                }
     1176
     1177                requestHeader->rc = VINF_SUCCESS;
     1178            }
     1179            break;
     1180        }
     1181
     1182
    11571183        case VMMDevReq_QueryCredentials:
    11581184        {
     
    15631589}
    15641590
     1591static DECLCALLBACK(int) vmmdevRequestSeamlessChange(PPDMIVMMDEVPORT pInterface, PDMISEAMLESSMODE mode)
     1592{
     1593    VMMDevState *pData = IVMMDEVPORT_2_VMMDEVSTATE(pInterface);
     1594
     1595    /* Verify that the new resolution is different and that guest does not yet know about it. */
     1596    bool fSameMode = (pData->lastSeamlessMode == mode);
     1597
     1598    Log(("vmmdevRequestSeamlessChange: same=%d. new=%d\n", fSameMode, mode));
     1599
     1600    if (!fSameMode)
     1601    {
     1602        /* we could validate the information here but hey, the guest can do that as well! */
     1603        pData->SeamlessMode = mode;
     1604
     1605        /* IRQ so the guest knows what's going on */
     1606        VMMDevNotifyGuest (pData, VMMDEV_EVENT_SEAMLESS_MODE_CHANGE_REQUEST);
     1607    }
     1608
     1609    return VINF_SUCCESS;
     1610}
     1611
    15651612static DECLCALLBACK(int) vmmdevSetCredentials(PPDMIVMMDEVPORT pInterface, const char *pszUsername,
    15661613                                              const char *pszPassword, const char *pszDomain,
     
    16221669
    16231670
    1624 #define VMMDEV_SSM_VERSION  4
     1671#define VMMDEV_SSM_VERSION  5
    16251672
    16261673/**
     
    18451892    pData->Port.pfnSetCredentials         = vmmdevSetCredentials;
    18461893    pData->Port.pfnVBVAChange             = vmmdevVBVAChange;
     1894    pData->Port.pfnRequestSeamlessChange  = vmmdevRequestSeamlessChange;
    18471895
    18481896
     
    19532001
    19542002    memset (&pData->lastReadDisplayChangeRequest, 0, sizeof (pData->lastReadDisplayChangeRequest));
     2003
     2004    /* disable seamless mode */
     2005
     2006    pData->lastSeamlessMode = PDM_SEAMLESS_MODE_DISABLED;
    19552007
    19562008    /* Clear the event variables.
  • trunk/src/VBox/Devices/VMMDev/VMMDevState.h

    r3586 r3774  
    136136    } credentialsJudge;
    137137
     138    /* seamless mode change request */
     139    PDMISEAMLESSMODE lastSeamlessMode, SeamlessMode;
     140
    138141#ifdef TIMESYNC_BACKDOOR
    139142    bool fTimesyncBackdoorLo;
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