Changeset 69180 in vbox for trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxDisplay.cpp
- Timestamp:
- Oct 23, 2017 6:08:32 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxDisplay.cpp
r68664 r69180 546 546 && dwNewPosX == 0 && dwNewPosY == 0 && !fChangeOrigin); 547 547 DWORD dmFields = 0; 548 VBOXDISPLAY_DRIVER_TYPE enmDriverType = getVBoxDisplayDriverType(pCtx); 548 549 549 550 LogFlowFunc(("[%d] %dx%d at %d,%d fChangeOrigin %d fEnabled %d fExtDisSup %d\n", … … 676 677 hlpResizeRect(paRects, NumDevices, DevPrimaryNum, Id, 677 678 fEnabled ? Width : 0, fEnabled ? Height : 0, dwNewPosX, dwNewPosY); 678 #ifdef Log 679 679 680 for (i = 0; i < NumDevices; i++) 680 681 { … … 684 685 paRects[i].bottom - paRects[i].top)); 685 686 } 686 #endif /* Log */ 687 688 #ifdef VBOX_WITH_WDDM 689 VBOXDISPLAY_DRIVER_TYPE enmDriverType = getVBoxDisplayDriverType (pCtx); 690 if (enmDriverType == VBOXDISPLAY_DRIVER_TYPE_WDDM) 691 { 692 /* Assign the new rectangles to displays. */ 693 for (i = 0; i < NumDevices; i++) 694 { 695 paDeviceModes[i].dmPosition.x = paRects[i].left; 696 paDeviceModes[i].dmPosition.y = paRects[i].top; 697 paDeviceModes[i].dmPelsWidth = paRects[i].right - paRects[i].left; 698 paDeviceModes[i].dmPelsHeight = paRects[i].bottom - paRects[i].top; 699 700 if (i == Id) 701 paDeviceModes[i].dmBitsPerPel = BitsPerPixel; 702 687 688 /* Assign the new rectangles to displays. */ 689 for (i = 0; i < NumDevices; i++) 690 { 691 paDeviceModes[i].dmPosition.x = paRects[i].left; 692 paDeviceModes[i].dmPosition.y = paRects[i].top; 693 paDeviceModes[i].dmPelsWidth = paRects[i].right - paRects[i].left; 694 paDeviceModes[i].dmPelsHeight = paRects[i].bottom - paRects[i].top; 695 696 if (i == Id) 697 paDeviceModes[i].dmBitsPerPel = BitsPerPixel; 698 699 if (enmDriverType >= VBOXDISPLAY_DRIVER_TYPE_WDDM) 700 { 703 701 paDeviceModes[i].dmFields |= dmFields; 704 702 705 703 /* On Vista one must specify DM_BITSPERPEL. 706 707 704 * Note that the current mode dmBitsPerPel is already in the DEVMODE structure. 705 */ 708 706 if (!(paDeviceModes[i].dmFields & DM_BITSPERPEL)) 709 707 { … … 712 710 paDeviceModes[i].dmBitsPerPel = 32; 713 711 } 714 715 LogFlowFunc(("ResizeDisplayDevice: pfnChangeDisplaySettingsEx %x: %dx%dx%d at %d,%d fields 0x%X\n", 716 pCtx->pfnChangeDisplaySettingsEx, 717 paDeviceModes[i].dmPelsWidth, 718 paDeviceModes[i].dmPelsHeight, 719 paDeviceModes[i].dmBitsPerPel, 720 paDeviceModes[i].dmPosition.x, 721 paDeviceModes[i].dmPosition.y, 722 paDeviceModes[i].dmFields)); 723 } 724 712 } 713 else 714 { 715 paDeviceModes[i].dmFields = DM_POSITION | DM_PELSHEIGHT | DM_PELSWIDTH | DM_BITSPERPEL; 716 } 717 718 LogFlowFunc(("ResizeDisplayDevice: Going to resize display %d to %dx%dx%d at %d,%d fields 0x%X\n", 719 i, 720 paDeviceModes[i].dmPelsWidth, 721 paDeviceModes[i].dmPelsHeight, 722 paDeviceModes[i].dmBitsPerPel, 723 paDeviceModes[i].dmPosition.x, 724 paDeviceModes[i].dmPosition.y, 725 paDeviceModes[i].dmFields)); 726 } 727 728 #ifdef VBOX_WITH_WDDM 729 if (enmDriverType == VBOXDISPLAY_DRIVER_TYPE_WDDM) 730 { 725 731 LogFlowFunc(("Request to resize the displa\n")); 726 732 DWORD err = VBoxDispIfResizeModes(&pCtx->pEnv->dispIf, Id, fEnabled, fExtDispSup, paDisplayDevices, paDeviceModes, DevNum); … … 753 759 for (i = 0; i < NumDevices; i++) 754 760 { 755 paDeviceModes[i].dmPosition.x = paRects[i].left;756 paDeviceModes[i].dmPosition.y = paRects[i].top;757 paDeviceModes[i].dmPelsWidth = paRects[i].right - paRects[i].left;758 paDeviceModes[i].dmPelsHeight = paRects[i].bottom - paRects[i].top;759 760 /* On Vista one must specify DM_BITSPERPEL.761 * Note that the current mode dmBitsPerPel is already in the DEVMODE structure.762 */763 paDeviceModes[i].dmFields = DM_POSITION | DM_PELSHEIGHT | DM_PELSWIDTH | DM_BITSPERPEL;764 765 if ( i == Id766 && BitsPerPixel != 0)767 {768 /* Change dmBitsPerPel if requested. */769 paDeviceModes[i].dmBitsPerPel = BitsPerPixel;770 }771 772 LogFlowFunc(("ResizeDisplayDevice: pfnChangeDisplaySettingsEx Current MonitorId=%d: %dx%dx%d at %d,%d\n",773 i,774 paDeviceModes[i].dmPelsWidth,775 paDeviceModes[i].dmPelsHeight,776 paDeviceModes[i].dmBitsPerPel,777 paDeviceModes[i].dmPosition.x,778 paDeviceModes[i].dmPosition.y));779 780 761 LONG status = pCtx->pfnChangeDisplaySettingsEx((LPSTR)paDisplayDevices[i].DeviceName, 781 762 &paDeviceModes[i], NULL, CDS_NORESET | CDS_UPDATEREGISTRY, NULL);
Note:
See TracChangeset
for help on using the changeset viewer.