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
51f06239
Commit
51f06239
authored
Mar 20, 2011
by
Eric Pouech
Committed by
Alexandre Julliard
Mar 28, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wineconsole: Ensure that the EXIT message is always properly propagated to the…
wineconsole: Ensure that the EXIT message is always properly propagated to the first caller of GrabChanges.
parent
4220cd66
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
12 deletions
+13
-12
curses.c
programs/wineconsole/curses.c
+2
-3
user.c
programs/wineconsole/user.c
+4
-3
winecon_private.h
programs/wineconsole/winecon_private.h
+3
-2
wineconsole.c
programs/wineconsole/wineconsole.c
+4
-4
No files found.
programs/wineconsole/curses.c
View file @
51f06239
...
@@ -1009,17 +1009,16 @@ static void WCCURSES_DeleteBackend(struct inner_data* data)
...
@@ -1009,17 +1009,16 @@ static void WCCURSES_DeleteBackend(struct inner_data* data)
static
int
WCCURSES_MainLoop
(
struct
inner_data
*
data
)
static
int
WCCURSES_MainLoop
(
struct
inner_data
*
data
)
{
{
DWORD
id
;
DWORD
id
;
BOOL
cont
=
TRUE
;
WCCURSES_Resize
(
data
);
WCCURSES_Resize
(
data
);
if
(
pipe
(
PRIVATE
(
data
)
->
sync_pipe
)
==
-
1
)
return
0
;
if
(
pipe
(
PRIVATE
(
data
)
->
sync_pipe
)
==
-
1
)
return
0
;
PRIVATE
(
data
)
->
input_thread
=
CreateThread
(
NULL
,
0
,
input_thread
,
data
,
0
,
&
id
);
PRIVATE
(
data
)
->
input_thread
=
CreateThread
(
NULL
,
0
,
input_thread
,
data
,
0
,
&
id
);
while
(
cont
&&
WaitForSingleObject
(
data
->
hSynchro
,
INFINITE
)
==
WAIT_OBJECT_0
)
while
(
!
data
->
dying
&&
WaitForSingleObject
(
data
->
hSynchro
,
INFINITE
)
==
WAIT_OBJECT_0
)
{
{
EnterCriticalSection
(
&
PRIVATE
(
data
)
->
lock
);
EnterCriticalSection
(
&
PRIVATE
(
data
)
->
lock
);
cont
=
WINECON_GrabChanges
(
data
);
WINECON_GrabChanges
(
data
);
LeaveCriticalSection
(
&
PRIVATE
(
data
)
->
lock
);
LeaveCriticalSection
(
&
PRIVATE
(
data
)
->
lock
);
}
}
...
...
programs/wineconsole/user.c
View file @
51f06239
...
@@ -1368,13 +1368,12 @@ static int WCUSER_MainLoop(struct inner_data* data)
...
@@ -1368,13 +1368,12 @@ static int WCUSER_MainLoop(struct inner_data* data)
MSG
msg
;
MSG
msg
;
ShowWindow
(
data
->
hWnd
,
data
->
nCmdShow
);
ShowWindow
(
data
->
hWnd
,
data
->
nCmdShow
);
for
(;;
)
while
(
!
data
->
dying
||
!
data
->
curcfg
.
exit_on_die
)
{
{
switch
(
MsgWaitForMultipleObjects
(
1
,
&
data
->
hSynchro
,
FALSE
,
INFINITE
,
QS_ALLINPUT
))
switch
(
MsgWaitForMultipleObjects
(
1
,
&
data
->
hSynchro
,
FALSE
,
INFINITE
,
QS_ALLINPUT
))
{
{
case
WAIT_OBJECT_0
:
case
WAIT_OBJECT_0
:
if
(
!
WINECON_GrabChanges
(
data
)
&&
data
->
curcfg
.
exit_on_die
)
WINECON_GrabChanges
(
data
);
PostQuitMessage
(
0
);
break
;
break
;
case
WAIT_OBJECT_0
+
1
:
case
WAIT_OBJECT_0
+
1
:
/* need to use PeekMessageW loop instead of simple GetMessage:
/* need to use PeekMessageW loop instead of simple GetMessage:
...
@@ -1393,6 +1392,8 @@ static int WCUSER_MainLoop(struct inner_data* data)
...
@@ -1393,6 +1392,8 @@ static int WCUSER_MainLoop(struct inner_data* data)
break
;
break
;
}
}
}
}
PostQuitMessage
(
0
);
return
0
;
}
}
/******************************************************************
/******************************************************************
...
...
programs/wineconsole/winecon_private.h
View file @
51f06239
...
@@ -61,6 +61,7 @@ struct inner_data {
...
@@ -61,6 +61,7 @@ struct inner_data {
HWND
hWnd
;
/* handle of 'user' window or NULL for 'curses' */
HWND
hWnd
;
/* handle of 'user' window or NULL for 'curses' */
INT
nCmdShow
;
/* argument of WinMain */
INT
nCmdShow
;
/* argument of WinMain */
BOOL
in_set_config
;
/* to handle re-entrant calls to WINECON_SetConfig */
BOOL
in_set_config
;
/* to handle re-entrant calls to WINECON_SetConfig */
BOOL
dying
;
/* to TRUE when we've been notified by server that child has died */
int
(
*
fnMainLoop
)(
struct
inner_data
*
data
);
int
(
*
fnMainLoop
)(
struct
inner_data
*
data
);
void
(
*
fnPosCursor
)(
const
struct
inner_data
*
data
);
void
(
*
fnPosCursor
)(
const
struct
inner_data
*
data
);
...
@@ -82,8 +83,8 @@ extern void WINECON_ResizeWithContainer(struct inner_data* data, int width, int
...
@@ -82,8 +83,8 @@ extern void WINECON_ResizeWithContainer(struct inner_data* data, int width, int
extern
int
WINECON_GetHistorySize
(
HANDLE
hConIn
);
extern
int
WINECON_GetHistorySize
(
HANDLE
hConIn
);
extern
int
WINECON_GetHistoryMode
(
HANDLE
hConIn
);
extern
int
WINECON_GetHistoryMode
(
HANDLE
hConIn
);
extern
BOOL
WINECON_GetConsoleTitle
(
HANDLE
hConIn
,
WCHAR
*
buffer
,
size_t
len
);
extern
BOOL
WINECON_GetConsoleTitle
(
HANDLE
hConIn
,
WCHAR
*
buffer
,
size_t
len
);
extern
int
WINECON_GrabChanges
(
struct
inner_data
*
data
);
extern
void
WINECON_GrabChanges
(
struct
inner_data
*
data
);
extern
VOID
WINECON_SetConfig
(
struct
inner_data
*
data
,
extern
void
WINECON_SetConfig
(
struct
inner_data
*
data
,
const
struct
config_data
*
cfg
);
const
struct
config_data
*
cfg
);
/* from registry.c */
/* from registry.c */
extern
void
WINECON_RegLoad
(
const
WCHAR
*
appname
,
struct
config_data
*
cfg
);
extern
void
WINECON_RegLoad
(
const
WCHAR
*
appname
,
struct
config_data
*
cfg
);
...
...
programs/wineconsole/wineconsole.c
View file @
51f06239
...
@@ -199,7 +199,7 @@ static BOOL WINECON_SetEditionMode(HANDLE hConIn, int edition_mode)
...
@@ -199,7 +199,7 @@ static BOOL WINECON_SetEditionMode(HANDLE hConIn, int edition_mode)
*
*
* A change occurs, try to figure out which
* A change occurs, try to figure out which
*/
*/
int
WINECON_GrabChanges
(
struct
inner_data
*
data
)
void
WINECON_GrabChanges
(
struct
inner_data
*
data
)
{
{
struct
console_renderer_event
evts
[
256
];
struct
console_renderer_event
evts
[
256
];
int
i
,
num
,
ev_found
;
int
i
,
num
,
ev_found
;
...
@@ -213,7 +213,7 @@ int WINECON_GrabChanges(struct inner_data* data)
...
@@ -213,7 +213,7 @@ int WINECON_GrabChanges(struct inner_data* data)
else
num
=
0
;
else
num
=
0
;
}
}
SERVER_END_REQ
;
SERVER_END_REQ
;
if
(
!
num
)
{
WINE_WARN
(
"hmm renderer signaled but no events available
\n
"
);
return
1
;}
if
(
!
num
)
{
WINE_WARN
(
"hmm renderer signaled but no events available
\n
"
);
return
;}
/* FIXME: should do some event compression here (cursor pos, update) */
/* FIXME: should do some event compression here (cursor pos, update) */
/* step 1: keep only last cursor pos event */
/* step 1: keep only last cursor pos event */
...
@@ -344,15 +344,15 @@ int WINECON_GrabChanges(struct inner_data* data)
...
@@ -344,15 +344,15 @@ int WINECON_GrabChanges(struct inner_data* data)
}
}
break
;
break
;
case
CONSOLE_RENDERER_EXIT_EVENT
:
case
CONSOLE_RENDERER_EXIT_EVENT
:
data
->
dying
=
TRUE
;
WINE_TRACE
(
". Exit!!
\n
"
);
WINE_TRACE
(
". Exit!!
\n
"
);
return
0
;
return
;
default:
default:
WINE_FIXME
(
"Unknown event type (%d)
\n
"
,
evts
[
i
].
event
);
WINE_FIXME
(
"Unknown event type (%d)
\n
"
,
evts
[
i
].
event
);
}
}
}
}
WINE_TRACE
(
".
\n
"
);
WINE_TRACE
(
".
\n
"
);
return
1
;
}
}
/******************************************************************
/******************************************************************
...
...
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