Author: hbelusca
Date: Sun Mar 10 15:56:35 2013
New Revision: 58463
URL:
http://svn.reactos.org/svn/reactos?rev=58463&view=rev
Log:
[CONSRV]
Attempt to fix terminal window positioning at initialization. Some work also needs to be
done in console.dll.
Modified:
branches/ros-csrss/win32ss/user/consrv/guiconsole.c
Modified: branches/ros-csrss/win32ss/user/consrv/guiconsole.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-csrss/win32ss/user/consrv/g…
==============================================================================
--- branches/ros-csrss/win32ss/user/consrv/guiconsole.c [iso-8859-1] (original)
+++ branches/ros-csrss/win32ss/user/consrv/guiconsole.c [iso-8859-1] Sun Mar 10 15:56:35
2013
@@ -205,7 +205,9 @@
GuiDrawRegion(PCONSOLE Console, SMALL_RECT* Region);
static NTSTATUS WINAPI
GuiResizeBuffer(PCONSOLE Console, PCONSOLE_SCREEN_BUFFER ScreenBuffer, COORD Size);
-VOID FASTCALL
+static VOID
+GuiConsoleMoveWindow(PGUI_CONSOLE_DATA GuiData);
+static VOID
GuiConsoleResizeWindow(PGUI_CONSOLE_DATA GuiData);
@@ -482,8 +484,10 @@
SizeChanged = TRUE;
}
+ /* Move the window to the user's values */
GuiData->GuiInfo.AutoPosition = pConInfo->ci.u.GuiInfo.AutoPosition;
GuiData->GuiInfo.WindowOrigin = pConInfo->ci.u.GuiInfo.WindowOrigin;
+ GuiConsoleMoveWindow(GuiData);
if (SizeChanged)
{
@@ -516,8 +520,23 @@
return ( ((GuiData == NULL) || (GuiData->hWindow == hWnd &&
GuiData->Console != NULL)) ? GuiData : NULL );
}
-VOID
-FASTCALL
+static VOID
+GuiConsoleMoveWindow(PGUI_CONSOLE_DATA GuiData)
+{
+ /* Move the window if needed (not positioned by the system) */
+ if (!GuiData->GuiInfo.AutoPosition)
+ {
+ SetWindowPos(GuiData->hWindow,
+ NULL,
+ GuiData->GuiInfo.WindowOrigin.x,
+ GuiData->GuiInfo.WindowOrigin.y,
+ 0,
+ 0,
+ SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE);
+ }
+}
+
+static VOID
GuiConsoleResizeWindow(PGUI_CONSOLE_DATA GuiData)
{
PCONSOLE Console = GuiData->Console;
@@ -560,13 +579,8 @@
ShowScrollBar(GuiData->hWindow, SB_HORZ, FALSE);
}
- /* Resize and reposition the window */
- SetWindowPos(GuiData->hWindow,
- NULL,
- (GuiData->GuiInfo.AutoPosition ? 0 :
GuiData->GuiInfo.WindowOrigin.x),
- (GuiData->GuiInfo.AutoPosition ? 0 :
GuiData->GuiInfo.WindowOrigin.y),
- Width,
- Height,
+ /* Resize the window */
+ SetWindowPos(GuiData->hWindow, NULL, 0, 0, Width, Height,
SWP_NOZORDER | SWP_NOMOVE | SWP_NOACTIVATE);
}
@@ -662,7 +676,8 @@
SetTimer(GuiData->hWindow, CONGUI_UPDATE_TIMER, CONGUI_UPDATE_TIME, NULL);
GuiConsoleCreateSysMenu(GuiData->hWindow);
- /* Resize the window to the user's values */
+ /* Move and resize the window to the user's values */
+ GuiConsoleMoveWindow(GuiData);
GuiData->WindowSizeLock = TRUE;
GuiConsoleResizeWindow(GuiData);
GuiData->WindowSizeLock = FALSE;