Author: hbelusca
Date: Fri Oct 11 22:59:05 2013
New Revision: 60623
URL:
http://svn.reactos.org/svn/reactos?rev=60623&view=rev
Log:
[CONSRV]
Definitely fix "Select All" functionality (see r59811).
Modified:
trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c
Modified: trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c [iso-8859-1]
(original)
+++ trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c [iso-8859-1] Fri Oct
11 22:59:05 2013
@@ -318,13 +318,33 @@
SIZE_T Length = 0;
/*
- * We select all the characters from line 1 to
- * the line where the cursor is positioned.
+ * The selection area extends to the whole screen buffer's width.
*/
Console->Selection.dwSelectionAnchor.X = 0;
Console->Selection.dwSelectionAnchor.Y = 0;
- Console->dwSelectionCursor.X = ActiveBuffer->ViewSize.X - 1;
- Console->dwSelectionCursor.Y = ActiveBuffer->CursorPosition.Y;
+ Console->dwSelectionCursor.X = ActiveBuffer->ScreenBufferSize.X - 1;
+
+ /*
+ * Determine whether the selection must extend to just some part
+ * (for text-mode screen buffers) or to all of the screen buffer's
+ * height (for graphics ones).
+ */
+ if (GetType(ActiveBuffer) == TEXTMODE_BUFFER)
+ {
+ /*
+ * We select all the characters from the first line
+ * to the line where the cursor is positioned.
+ */
+ Console->dwSelectionCursor.Y = ActiveBuffer->CursorPosition.Y;
+ }
+ else /* if (GetType(ActiveBuffer) == GRAPHICS_BUFFER) */
+ {
+ /*
+ * We select all the screen buffer area.
+ */
+ Console->dwSelectionCursor.Y = ActiveBuffer->ScreenBufferSize.Y -
1;
+ }
+
Console->Selection.dwFlags |= CONSOLE_SELECTION_IN_PROGRESS |
CONSOLE_MOUSE_SELECTION;
GuiConsoleUpdateSelection(Console, &Console->dwSelectionCursor);