Author: khornicek
Date: Thu Jan 19 14:10:02 2012
New Revision: 55010
URL:
http://svn.reactos.org/svn/reactos?rev=55010&view=rev
Log:
[MSTSC]
- Add full screen support.
- Fix starting from command line.
Modified:
trunk/reactos/base/applications/mstsc/connectdialog.c
trunk/reactos/base/applications/mstsc/precomp.h
trunk/reactos/base/applications/mstsc/settings.c
trunk/reactos/base/applications/mstsc/win32.c
Modified: trunk/reactos/base/applications/mstsc/connectdialog.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mstsc/co…
==============================================================================
--- trunk/reactos/base/applications/mstsc/connectdialog.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mstsc/connectdialog.c [iso-8859-1] Thu Jan 19 14:10:02
2012
@@ -26,10 +26,6 @@
static VOID ReLoadGeneralPage(PINFO pInfo);
static VOID ReLoadDisplayPage(PINFO pInfo);
-
-#ifndef IDC_NAMEEDIT
- #define IDC_NAMEEDIT 1015
-#endif
static VOID
DoOpenFile(PINFO pInfo)
@@ -539,7 +535,7 @@
newEntry->Resolutions = HeapAlloc(GetProcessHeap(),
0,
- ResolutionsCount * sizeof(RESOLUTION_INFO));
+ ResolutionsCount * (sizeof(RESOLUTION_INFO) + 1));
if (!newEntry->Resolutions) goto ByeBye;
newEntry->ResolutionsCount = ResolutionsCount;
@@ -557,6 +553,11 @@
i++;
}
}
+
+ /* fullscreen */
+ newEntry->Resolutions[i].dmPelsWidth = GetSystemMetrics(SM_CXSCREEN);
+ newEntry->Resolutions[i].dmPelsHeight = GetSystemMetrics(SM_CYSCREEN);
+
descriptionSize = (wcslen(DisplayDevice->DeviceString) + 1) * sizeof(WCHAR);
description = HeapAlloc(GetProcessHeap(), 0, descriptionSize);
if (!description) goto ByeBye;
@@ -761,8 +762,11 @@
{
DWORD index;
INT width, height, pos = 0;
- INT bpp, num, i;
+ INT bpp, num, i, screenmode;
BOOL bSet = FALSE;
+
+ /* get fullscreen info */
+ screenmode = GetIntegerFromSettings(pInfo->pRdpSettings, L"screen mode
id");
/* set trackbar position */
width = GetIntegerFromSettings(pInfo->pRdpSettings, L"desktopwidth");
@@ -770,13 +774,24 @@
if (width != -1 && height != -1)
{
- for (index = 0; index < pInfo->CurrentDisplayDevice->ResolutionsCount;
index++)
- {
- if (pInfo->CurrentDisplayDevice->Resolutions[index].dmPelsWidth ==
width &&
- pInfo->CurrentDisplayDevice->Resolutions[index].dmPelsHeight ==
height)
- {
- pos = index;
- break;
+ if(screenmode == 2)
+ {
+ pos = SendDlgItemMessageW(pInfo->hDisplayPage,
+ IDC_GEOSLIDER,
+ TBM_GETRANGEMAX,
+ 0,
+ 0);
+ }
+ else
+ {
+ for (index = 0; index <
pInfo->CurrentDisplayDevice->ResolutionsCount; index++)
+ {
+ if (pInfo->CurrentDisplayDevice->Resolutions[index].dmPelsWidth ==
width &&
+ pInfo->CurrentDisplayDevice->Resolutions[index].dmPelsHeight ==
height)
+ {
+ pos = index;
+ break;
+ }
}
}
}
Modified: trunk/reactos/base/applications/mstsc/precomp.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mstsc/pr…
==============================================================================
--- trunk/reactos/base/applications/mstsc/precomp.h [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mstsc/precomp.h [iso-8859-1] Thu Jan 19 14:10:02 2012
@@ -17,7 +17,7 @@
#define MAXKEY 256
#define MAXVALUE 256
-#define NUM_SETTINGS 5
+#define NUM_SETTINGS 6
extern LPWSTR lpSettings[];
typedef struct _SETTINGS
Modified: trunk/reactos/base/applications/mstsc/settings.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mstsc/se…
==============================================================================
--- trunk/reactos/base/applications/mstsc/settings.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mstsc/settings.c [iso-8859-1] Thu Jan 19 14:10:02
2012
@@ -9,6 +9,7 @@
L"session bpp",
L"full address",
L"username",
+ L"screen mode id",
};
VOID
@@ -28,7 +29,7 @@
szValue);
}
- /* resolution */
+ /* resolution and fullscreen*/
ret = SendDlgItemMessage(pInfo->hDisplayPage,
IDC_GEOSLIDER,
TBM_GETPOS,
@@ -36,6 +37,9 @@
0);
if (ret != -1)
{
+ SetIntegerToSettings(pInfo->pRdpSettings,
+ L"screen mode id",
+ (ret == SendDlgItemMessageW(pInfo->hDisplayPage,
IDC_GEOSLIDER, TBM_GETRANGEMAX, 0, 0)) ? 2 : 1);
SetIntegerToSettings(pInfo->pRdpSettings,
L"desktopwidth",
pInfo->DisplayDeviceList->Resolutions[ret].dmPelsWidth);
Modified: trunk/reactos/base/applications/mstsc/win32.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mstsc/wi…
==============================================================================
--- trunk/reactos/base/applications/mstsc/win32.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mstsc/win32.c [iso-8859-1] Thu Jan 19 14:10:02 2012
@@ -1027,8 +1027,10 @@
}
else
{
- /* default to 16bpp */
+ /* default to screen size, 16bpp */
SetIntegerToSettings(pRdpSettings, L"session bpp", 16);
+ SetIntegerToSettings(pRdpSettings, L"desktopwidth",
GetSystemMetrics(SM_CXSCREEN));
+ SetIntegerToSettings(pRdpSettings, L"desktopheight",
GetSystemMetrics(SM_CYSCREEN));
lpToken = wcstok(lpStr, szSeps);
while (lpToken)
@@ -1056,6 +1058,10 @@
lpToken += 2;
SetIntegerToSettings(pRdpSettings, L"desktopheight",
_wtoi(lpToken));
}
+ else if (*lpToken == L'f')
+ {
+ SetIntegerToSettings(pRdpSettings, L"screen mode id", 2);
+ }
lpToken = wcstok(NULL, szSeps);
}
@@ -1109,12 +1115,21 @@
strcpy(g_password, "");
g_server_depth = GetIntegerFromSettings(pRdpSettings, L"session
bpp");
if (g_server_depth > 16) g_server_depth = 16; /* hack, we
don't support 24bpp yet */
+ g_screen_width = GetSystemMetrics(SM_CXSCREEN);
+ g_screen_height = GetSystemMetrics(SM_CYSCREEN);
g_width = GetIntegerFromSettings(pRdpSettings,
L"desktopwidth");
g_height = GetIntegerFromSettings(pRdpSettings,
L"desktopheight");
- g_screen_width = GetSystemMetrics(SM_CXSCREEN);
- g_screen_height = GetSystemMetrics(SM_CYSCREEN);
- g_xoff = GetSystemMetrics(SM_CXEDGE) * 2;
- g_yoff = GetSystemMetrics(SM_CYCAPTION) + GetSystemMetrics(SM_CYEDGE)
* 2;
+ if (GetIntegerFromSettings(pRdpSettings, L"screen mode id")
== 2)
+ {
+ g_fullscreen = 1;
+ g_xoff = 0;
+ g_yoff = 0;
+ }
+ else
+ {
+ g_xoff = GetSystemMetrics(SM_CXEDGE) * 2;
+ g_yoff = GetSystemMetrics(SM_CYCAPTION) +
GetSystemMetrics(SM_CYEDGE) * 2;
+ }
ui_main();
ret = 0;