VirtualBox

Changeset 53313 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Nov 12, 2014 1:58:47 PM (10 years ago)
Author:
vboxsync
Message:

VBoxTray: keep monitor layout when resizing with WDDM driver, logging.

Location:
trunk/src/VBox/Additions/WINNT/VBoxTray
Files:
2 edited

Legend:

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

    r52143 r53313  
    5353
    5454DWORD EnableAndResizeDispDev(DEVMODE *paDeviceModes, DISPLAY_DEVICE *paDisplayDevices, DWORD totalDispNum, UINT Id, DWORD aWidth, DWORD aHeight,
    55                                     DWORD aBitsPerPixel, DWORD aPosX, DWORD aPosY, BOOL fEnabled, BOOL fExtDispSup);
     55                                    DWORD aBitsPerPixel, LONG aPosX, LONG aPosY, BOOL fEnabled, BOOL fExtDispSup);
    5656
    5757static DWORD vboxDispIfWddmResizeDisplay(PCVBOXDISPIF const pIf, UINT Id, BOOL fEnable, DISPLAY_DEVICE * paDisplayDevices, DEVMODE *paDeviceMode, UINT devModes);
     
    320320        if (pDeviceMode->dmFields & DM_POSITION)
    321321        {
     322            LogFlowFunc(("DM_POSITION %d,%d -> %d,%d\n",
     323                         pCfg->pModeInfoArray[iSrcMode].sourceMode.position.x,
     324                         pCfg->pModeInfoArray[iSrcMode].sourceMode.position.y,
     325                         pDeviceMode->dmPosition.x, pDeviceMode->dmPosition.y));
    322326            pCfg->pModeInfoArray[iSrcMode].sourceMode.position.x = pDeviceMode->dmPosition.x;
    323327            pCfg->pModeInfoArray[iSrcMode].sourceMode.position.y = pDeviceMode->dmPosition.y;
     
    13931397    DWORD winEr = NO_ERROR;
    13941398
    1395     Log(("VBoxTray: vboxDispIfResizeModesWDDM\n"));
     1399    Log(("VBoxTray: vboxDispIfResizeModesWDDM iChanged %d cDevModes %d\n", iChangedMode, cDevModes));
    13961400    VBoxRrRetryStop();
    13971401
  • trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxDisplay.cpp

    r51469 r53313  
    225225
    226226DWORD EnableAndResizeDispDev(DEVMODE *paDeviceModes, DISPLAY_DEVICE *paDisplayDevices, DWORD totalDispNum, UINT Id, DWORD aWidth, DWORD aHeight,
    227                                     DWORD aBitsPerPixel, DWORD aPosX, DWORD aPosY, BOOL fEnabled, BOOL fExtDispSup)
     227                                    DWORD aBitsPerPixel, LONG aPosX, LONG aPosY, BOOL fEnabled, BOOL fExtDispSup)
    228228{
    229229    DISPLAY_DEVICE displayDeviceTmp;
     
    442442/* Returns TRUE to try again. */
    443443static BOOL ResizeDisplayDevice(UINT Id, DWORD Width, DWORD Height, DWORD BitsPerPixel,
    444                                 BOOL fEnabled, DWORD dwNewPosX, DWORD dwNewPosY,
     444                                BOOL fEnabled, LONG dwNewPosX, LONG dwNewPosY, bool fChangeOrigin,
    445445                                VBOXDISPLAYCONTEXT *pCtx, BOOL fExtDispSup)
    446446{
    447447    BOOL fDispAlreadyEnabled = false; /* check whether the monitor with ID is already enabled. */
    448448    BOOL fModeReset = (Width == 0 && Height == 0 && BitsPerPixel == 0 &&
    449                        dwNewPosX == 0 && dwNewPosY == 0);
     449                       dwNewPosX == 0 && dwNewPosY == 0 && !fChangeOrigin);
    450450    DWORD dmFields = 0;
    451451
    452     LogFlowFunc(("ResizeDisplayDevice Width= %d, Height=%d , PosX=%d and PosY=%d \
    453          fEnabled = %d, fExtDisSup = %d\n",
    454           Width, Height, dwNewPosX, dwNewPosY, fEnabled, fExtDispSup));
     452    LogFlowFunc(("[%d] %dx%d at %d,%d fChangeOrigin %d fEnabled %d fExtDisSup %d\n",
     453          Id, Width, Height, dwNewPosX, dwNewPosY, fChangeOrigin, fEnabled, fExtDispSup));
    455454
    456455    if (!gCtx.fAnyX)
     
    491490        {
    492491            LogRel(("Extended Display Support.\n"));
    493             LogFlowFunc(("ResizeDisplayDevice1: %dx%dx%d at %d,%d . Id = %d and DevNum=%d, fEnabled=%d\n",
    494                   paDeviceModes[Id].dmPelsWidth,
    495                   paDeviceModes[Id].dmPelsHeight,
    496                   paDeviceModes[Id].dmBitsPerPel,
    497                   paDeviceModes[Id].dmPosition.x,
    498                   paDeviceModes[Id].dmPosition.y,
    499                   Id, DevNum, fEnabled));
     492            LogFlowFunc(("[%d] %dx%dx%d at %d,%d, dmFields 0x%x\n",
     493                  i,
     494                  paDeviceModes[i].dmPelsWidth,
     495                  paDeviceModes[i].dmPelsHeight,
     496                  paDeviceModes[i].dmBitsPerPel,
     497                  paDeviceModes[i].dmPosition.x,
     498                  paDeviceModes[i].dmPosition.y,
     499                  paDeviceModes[i].dmFields));
    500500        }
    501501        else
     
    537537        dmFields |= DM_BITSPERPEL;
    538538
    539     if (!dwNewPosX && !dwNewPosY)
    540     {
    541         /* @fixme: zero position is a valid state, so another values should be used as a special case !!! */
     539    if (!fChangeOrigin)
     540    {
     541        /* Use existing position. */
    542542        dwNewPosX = paRects[Id].left;
    543543        dwNewPosY = paRects[Id].top;
    544     }
    545     else
    546         dmFields |= DM_POSITION;
     544        LogFlowFunc(("existing dwNewPosX %d, dwNewPosY %d\n", dwNewPosX, dwNewPosY));
     545    }
     546
     547    /* Always update the position.
     548     * It is either explicitly requested or must be set to the existing position.
     549     */
     550    dmFields |= DM_POSITION;
    547551
    548552    /* Check whether a mode reset or a change is requested.
     
    612616            }
    613617
    614             LogFlowFunc(("ResizeDisplayDevice: pfnChangeDisplaySettingsEx %x: %dx%dx%d at %d,%d\n",
     618            LogFlowFunc(("ResizeDisplayDevice: pfnChangeDisplaySettingsEx %x: %dx%dx%d at %d,%d fields 0x%X\n",
    615619                  gCtx.pfnChangeDisplaySettingsEx,
    616620                  paDeviceModes[i].dmPelsWidth,
     
    618622                  paDeviceModes[i].dmBitsPerPel,
    619623                  paDeviceModes[i].dmPosition.x,
    620                   paDeviceModes[i].dmPosition.y));
     624                  paDeviceModes[i].dmPosition.y,
     625                  paDeviceModes[i].dmFields));
    621626        }
    622627
     
    849854                                                         displayChangeRequest.cxOrigin,
    850855                                                         displayChangeRequest.cyOrigin,
     856                                                         displayChangeRequest.fChangeOrigin,
    851857                                                         pCtx,
    852858                                                         fExtDispSup
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