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*/
|
||||
|
||||
@@ -88,6 +88,16 @@ struct win_choices {
|
||||
{ 0, 0 } /* must be last */
|
||||
};
|
||||
|
||||
boolean
|
||||
genl_can_suspend_no(){
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
boolean
|
||||
genl_can_suspend_yes(){
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
STATIC_OVL
|
||||
void
|
||||
def_raw_print(s)
|
||||
@@ -316,6 +326,7 @@ static struct window_procs hup_procs = {
|
||||
genl_status_threshold,
|
||||
# endif
|
||||
# endif /* STATUS_VIA_WINDOWPORT */
|
||||
genl_can_suspend_no,
|
||||
};
|
||||
|
||||
static void FDECL((*previnterface_exit_nhwindows), (const char *)) = 0;
|
||||
|
||||
Reference in New Issue
Block a user