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:
keni
2010-01-15 17:51:28 +00:00
parent 655adf8535
commit f6e40b8bf8
15 changed files with 54 additions and 6 deletions

View File

@@ -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*/