Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
a3583f05
Commit
a3583f05
authored
Oct 12, 2020
by
Jacek Caban
Committed by
Alexandre Julliard
Oct 12, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
conhost: Support window resizing.
Based on wineconsole. Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
603cb316
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
0 deletions
+30
-0
window.c
programs/conhost/window.c
+30
-0
No files found.
programs/conhost/window.c
View file @
a3583f05
...
...
@@ -2062,6 +2062,29 @@ static BOOL config_dialog( struct console *console, BOOL current )
return
TRUE
;
}
static
void
resize_window
(
struct
console
*
console
,
int
width
,
int
height
)
{
struct
console_config
config
;
current_config
(
console
,
&
config
);
config
.
win_width
=
width
;
config
.
win_height
=
height
;
/* auto size screen-buffer if it's now smaller than window */
if
(
config
.
sb_width
<
config
.
win_width
)
config
.
sb_width
=
config
.
win_width
;
if
(
config
.
sb_height
<
config
.
win_height
)
config
.
sb_height
=
config
.
win_height
;
/* and reset window pos so that we don't display outside of the screen-buffer */
if
(
config
.
win_pos
.
X
+
config
.
win_width
>
config
.
sb_width
)
config
.
win_pos
.
X
=
config
.
sb_width
-
config
.
win_width
;
if
(
config
.
win_pos
.
Y
+
config
.
win_height
>
config
.
sb_height
)
config
.
win_pos
.
Y
=
config
.
sb_height
-
config
.
win_height
;
apply_config
(
console
,
&
config
);
}
/* grays / ungrays the menu items according to their state */
static
void
set_menu_details
(
struct
console
*
console
,
HMENU
menu
)
{
...
...
@@ -2280,6 +2303,13 @@ static LRESULT WINAPI window_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lp
DestroyCaret
();
break
;
case
WM_SIZE
:
if
(
console
->
window
->
update_state
!=
UPDATE_BUSY
)
resize_window
(
console
,
max
(
LOWORD
(
lparam
)
/
console
->
active
->
font
.
width
,
20
),
max
(
HIWORD
(
lparam
)
/
console
->
active
->
font
.
height
,
20
));
break
;
case
WM_SYSCOMMAND
:
switch
(
wparam
)
{
...
...
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