From dd477a6a18815c8b29bebed591f24fa6b4215799 Mon Sep 17 00:00:00 2001 From: C-o-r-E Date: Thu, 1 Nov 2012 17:12:05 -0400 Subject: [PATCH] wfreerdp-server: multimon working on win7 --- server/Windows/wf_info.c | 2 +- server/Windows/wf_mirage.c | 18 ++++++++---------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/server/Windows/wf_info.c b/server/Windows/wf_info.c index 3bdadf1d4..3dc964011 100644 --- a/server/Windows/wf_info.c +++ b/server/Windows/wf_info.c @@ -359,7 +359,7 @@ void wf_info_getScreenData(wfInfo* wfi, long* width, long* height, BYTE** pBits, offset = (4 * wfi->invalid.left) + (wfi->invalid.top * wfi->servscreen_width * 4); *pBits = ((BYTE*) (changes->Userbuffer)) + offset; - *pitch = wfi->servscreen_width * 4; + *pitch = wfi->virtscreen_width * 4; } #endif } diff --git a/server/Windows/wf_mirage.c b/server/Windows/wf_mirage.c index 2b2b4a71e..df3409145 100644 --- a/server/Windows/wf_mirage.c +++ b/server/Windows/wf_mirage.c @@ -182,20 +182,18 @@ BOOL wf_mirror_driver_update(wfInfo* wfi, int unload) if (!unload) { - int vscreen_w; - int vscreen_h; //first let's get the virtual screen dimentions - vscreen_w = GetSystemMetrics(SM_CXVIRTUALSCREEN); - vscreen_h = GetSystemMetrics(SM_CYVIRTUALSCREEN); + wfi->virtscreen_width = GetSystemMetrics(SM_CXVIRTUALSCREEN); + wfi->virtscreen_height = GetSystemMetrics(SM_CYVIRTUALSCREEN); /* * Will have to come back to this for supporting non primary displays and multimonitor setups */ - dc = GetDC(NULL); + /*dc = GetDC(NULL); wfi->servscreen_width = GetDeviceCaps(dc, HORZRES); wfi->servscreen_height = GetDeviceCaps(dc, VERTRES); wfi->bitsPerPixel = GetDeviceCaps(dc, BITSPIXEL); - ReleaseDC(NULL, dc); + ReleaseDC(NULL, dc);*/ } else @@ -217,11 +215,11 @@ BOOL wf_mirror_driver_update(wfInfo* wfi, int unload) deviceMode->dmSize = sizeof(DEVMODE); deviceMode->dmDriverExtra = drvExtraSaved; - deviceMode->dmPelsWidth = wfi->servscreen_width; - deviceMode->dmPelsHeight = wfi->servscreen_height; + deviceMode->dmPelsWidth = wfi->virtscreen_width; + deviceMode->dmPelsHeight = wfi->virtscreen_height; deviceMode->dmBitsPerPel = wfi->bitsPerPixel; - deviceMode->dmPosition.x = 0; - deviceMode->dmPosition.y = 0; + deviceMode->dmPosition.x = wfi->servscreen_xoffset; + deviceMode->dmPosition.y = wfi->servscreen_yoffset; deviceMode->dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT | DM_POSITION;