have core ask windowport if suspend is ok
PORTS: Please make sure I've done the right thing for/to your code. This patch adds a new winproc that lets the window port approve or cancel the suspend request - this should take care of the Mac Qt lockup issue. In addition, Unix suspend is restricted to accounts that can use the shell if SYSCF is defined.
This commit is contained in:
18
src/cmd.c
18
src/cmd.c
@@ -109,6 +109,8 @@ extern int NDECL(dozap); /**/
|
||||
extern int NDECL(doorganize); /**/
|
||||
#endif /* DUMB */
|
||||
|
||||
static int NDECL(dosuspend_core); /**/
|
||||
|
||||
static int NDECL((*timed_occ_fn));
|
||||
|
||||
STATIC_PTR int NDECL(doprev_message);
|
||||
@@ -2124,9 +2126,7 @@ static const struct func_tab cmdlist[] = {
|
||||
{C('w'), TRUE, wiz_wish},
|
||||
#endif
|
||||
{C('x'), TRUE, doattributes},
|
||||
#ifdef SUSPEND
|
||||
{C('z'), TRUE, dosuspend},
|
||||
#endif
|
||||
{C('z'), TRUE, dosuspend_core},
|
||||
{'a', FALSE, doapply},
|
||||
{'A', FALSE, doddoremarm},
|
||||
{M('a'), TRUE, doorganize},
|
||||
@@ -3586,4 +3586,16 @@ char def;
|
||||
return (*windowprocs.win_yn_function)(qbuf, resp, def);
|
||||
}
|
||||
|
||||
int
|
||||
dosuspend_core(){
|
||||
#ifdef SUSPEND
|
||||
/* Does current window system support suspend? */
|
||||
if( (*windowprocs.win_can_suspend)()){
|
||||
/* NB: SYSCF SHELLERS handled in port code. */
|
||||
dosuspend();
|
||||
} else
|
||||
#endif
|
||||
Norep("Suspend command not available.");
|
||||
}
|
||||
|
||||
/*cmd.c*/
|
||||
|
||||
Reference in New Issue
Block a user