Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
a9001784
Commit
a9001784
authored
Oct 06, 2020
by
Jacek Caban
Committed by
Alexandre Julliard
Oct 07, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
conhost: Scroll window to cursor position when needed.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
c29f9e6e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
+21
-0
conhost.c
programs/conhost/conhost.c
+21
-0
No files found.
programs/conhost/conhost.c
View file @
a9001784
...
...
@@ -392,6 +392,24 @@ static void empty_update_rect( struct screen_buffer *screen_buffer, RECT *rect )
SetRect
(
rect
,
screen_buffer
->
width
,
screen_buffer
->
height
,
0
,
0
);
}
static
void
scroll_to_cursor
(
struct
screen_buffer
*
screen_buffer
)
{
int
w
=
screen_buffer
->
win
.
right
-
screen_buffer
->
win
.
left
+
1
;
int
h
=
screen_buffer
->
win
.
bottom
-
screen_buffer
->
win
.
top
+
1
;
if
(
screen_buffer
->
cursor_x
<
screen_buffer
->
win
.
left
)
screen_buffer
->
win
.
left
=
min
(
screen_buffer
->
cursor_x
,
screen_buffer
->
width
-
w
);
else
if
(
screen_buffer
->
cursor_x
>
screen_buffer
->
win
.
right
)
screen_buffer
->
win
.
left
=
max
(
screen_buffer
->
cursor_x
,
w
)
-
w
+
1
;
screen_buffer
->
win
.
right
=
screen_buffer
->
win
.
left
+
w
-
1
;
if
(
screen_buffer
->
cursor_y
<
screen_buffer
->
win
.
top
)
screen_buffer
->
win
.
top
=
min
(
screen_buffer
->
cursor_y
,
screen_buffer
->
height
-
h
);
else
if
(
screen_buffer
->
cursor_y
>
screen_buffer
->
win
.
bottom
)
screen_buffer
->
win
.
top
=
max
(
screen_buffer
->
cursor_y
,
h
)
-
h
+
1
;
screen_buffer
->
win
.
bottom
=
screen_buffer
->
win
.
top
+
h
-
1
;
}
static
void
update_output
(
struct
screen_buffer
*
screen_buffer
,
RECT
*
rect
)
{
int
x
,
y
,
size
,
trailing_spaces
;
...
...
@@ -1237,6 +1255,7 @@ static void update_read_output( struct console *console )
if
(
console
->
is_unix
)
set_tty_cursor_relative
(
screen_buffer
->
console
,
update_rect
.
left
,
update_rect
.
top
);
update_output
(
screen_buffer
,
&
update_rect
);
scroll_to_cursor
(
screen_buffer
);
}
if
(
console
->
is_unix
)
set_tty_cursor_relative
(
screen_buffer
->
console
,
screen_buffer
->
cursor_x
,
screen_buffer
->
cursor_y
);
...
...
@@ -1825,6 +1844,7 @@ static NTSTATUS set_output_info( struct screen_buffer *screen_buffer,
{
screen_buffer
->
cursor_x
=
info
->
cursor_x
;
screen_buffer
->
cursor_y
=
info
->
cursor_y
;
scroll_to_cursor
(
screen_buffer
);
}
}
if
(
params
->
mask
&
SET_CONSOLE_OUTPUT_INFO_SIZE
)
...
...
@@ -1972,6 +1992,7 @@ static NTSTATUS write_console( struct screen_buffer *screen_buffer, const WCHAR
else
screen_buffer
->
cursor_x
=
update_rect
.
left
;
}
scroll_to_cursor
(
screen_buffer
);
update_output
(
screen_buffer
,
&
update_rect
);
tty_sync
(
screen_buffer
->
console
);
return
STATUS_SUCCESS
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment