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
70f24d6c
Commit
70f24d6c
authored
Nov 15, 2010
by
Eric Pouech
Committed by
Alexandre Julliard
Nov 16, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wineconsole: Properly handle (user)-window resizing wrt the console.
parent
544dbb51
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
0 deletions
+38
-0
user.c
programs/wineconsole/user.c
+5
-0
winecon_private.h
programs/wineconsole/winecon_private.h
+2
-0
wineconsole.c
programs/wineconsole/wineconsole.c
+31
-0
No files found.
programs/wineconsole/user.c
View file @
70f24d6c
...
...
@@ -778,6 +778,7 @@ static void WCUSER_Paint(const struct inner_data* data)
{
PAINTSTRUCT
ps
;
if
(
data
->
in_set_config
)
return
;
/* in order to avoid some flicker */
BeginPaint
(
data
->
hWnd
,
&
ps
);
BitBlt
(
ps
.
hdc
,
0
,
0
,
data
->
curcfg
.
win_width
*
data
->
curcfg
.
cell_width
,
...
...
@@ -1329,6 +1330,10 @@ static LRESULT CALLBACK WCUSER_Proc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM
if
(
!
HIWORD
(
lParam
))
return
DefWindowProcW
(
hWnd
,
uMsg
,
wParam
,
lParam
);
WCUSER_SetMenuDetails
(
data
,
GetSystemMenu
(
data
->
hWnd
,
FALSE
));
break
;
case
WM_SIZE
:
WINECON_ResizeWithContainer
(
data
,
LOWORD
(
lParam
)
/
data
->
curcfg
.
cell_width
,
HIWORD
(
lParam
)
/
data
->
curcfg
.
cell_height
);
break
;
default:
return
DefWindowProcW
(
hWnd
,
uMsg
,
wParam
,
lParam
);
}
...
...
programs/wineconsole/winecon_private.h
View file @
70f24d6c
...
...
@@ -60,6 +60,7 @@ struct inner_data {
HANDLE
hSynchro
;
/* waitable handle signalled by server when something in server has been modified */
HWND
hWnd
;
/* handle of 'user' window or NULL for 'curses' */
INT
nCmdShow
;
/* argument of WinMain */
BOOL
in_set_config
;
/* to handle re-entrant calls to WINECON_SetConfig */
int
(
*
fnMainLoop
)(
struct
inner_data
*
data
);
void
(
*
fnPosCursor
)(
const
struct
inner_data
*
data
);
...
...
@@ -77,6 +78,7 @@ struct inner_data {
/* from wineconsole.c */
extern
void
WINECON_Fatal
(
const
char
*
msg
);
extern
void
WINECON_ResizeWithContainer
(
struct
inner_data
*
data
,
int
width
,
int
height
);
extern
int
WINECON_GetHistorySize
(
HANDLE
hConIn
);
extern
int
WINECON_GetHistoryMode
(
HANDLE
hConIn
);
extern
BOOL
WINECON_GetConsoleTitle
(
HANDLE
hConIn
,
WCHAR
*
buffer
,
size_t
len
);
...
...
programs/wineconsole/wineconsole.c
View file @
70f24d6c
...
...
@@ -82,6 +82,34 @@ static void WINECON_FetchCells(struct inner_data* data, int upd_tp, int upd_bm)
}
/******************************************************************
* WINECON_ResizeWithContainer
*
* For console embedded in a container (e.g. user in a win32 window, or (n)curses
* in a TERM, perform resize of console (screen buffer and window) to fit in
* (new) container size.
*/
void
WINECON_ResizeWithContainer
(
struct
inner_data
*
data
,
int
width
,
int
height
)
{
struct
config_data
cfg
;
if
(
data
->
in_set_config
)
return
;
cfg
=
data
->
curcfg
;
cfg
.
win_width
=
width
;
cfg
.
win_height
=
height
;
/* auto size screen-buffer if it's now smaller than window */
if
(
cfg
.
sb_width
<
cfg
.
win_width
)
cfg
.
sb_width
=
cfg
.
win_width
;
if
(
cfg
.
sb_height
<
cfg
.
win_height
)
cfg
.
sb_height
=
cfg
.
win_height
;
/* and reset window pos so that we don't display outside of the screen-buffer */
if
(
cfg
.
win_pos
.
X
+
cfg
.
win_width
>
cfg
.
sb_width
)
cfg
.
win_pos
.
X
=
cfg
.
sb_width
-
cfg
.
win_width
;
if
(
cfg
.
win_pos
.
Y
+
cfg
.
win_height
>
cfg
.
sb_height
)
cfg
.
win_pos
.
Y
=
cfg
.
sb_height
-
cfg
.
win_height
;
WINECON_SetConfig
(
data
,
&
cfg
);
}
/******************************************************************
* WINECON_SetHistorySize
*
*
...
...
@@ -336,6 +364,8 @@ int WINECON_GrabChanges(struct inner_data* data)
*/
void
WINECON_SetConfig
(
struct
inner_data
*
data
,
const
struct
config_data
*
cfg
)
{
if
(
data
->
in_set_config
)
return
;
data
->
in_set_config
=
TRUE
;
if
(
data
->
curcfg
.
cursor_size
!=
cfg
->
cursor_size
||
data
->
curcfg
.
cursor_visible
!=
cfg
->
cursor_visible
)
{
...
...
@@ -467,6 +497,7 @@ void WINECON_SetConfig(struct inner_data* data, const struct config_data* cf
* in order to get data correctly updated
*/
WINECON_GrabChanges
(
data
);
data
->
in_set_config
=
FALSE
;
}
/******************************************************************
...
...
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