Xming: Add FORCEEXIT option to configuration file
Add a new option to configuration file: FORCEEXIT, like SILENTEXIT but ignores the client count. Unsaved client work may be lost with this option but it is useful if you want no dialogs. Add description of this new keyword to XWinrc man page Also fix grammar of the exit confirmation dialog warning to be correct when there is only one(1) client connected. Also rearrange yacc tokens to one per line to make future merges easier Also amend default system.XWinrc so that SILENTEXIT is on by default Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
This commit is contained in:
parent
019a601de6
commit
f3fad371cc
|
@ -65,8 +65,13 @@ system tray area.
|
|||
.TP 8
|
||||
.B SILENTEXIT
|
||||
The \fBSILENTEXIT\fP keyword, which takes no parameters, disables the
|
||||
exit confirmation dialog.
|
||||
exit confirmation dialog if no clients are connected.
|
||||
|
||||
.TP 8
|
||||
.B FORCEEXIT
|
||||
The \fBFORCEEXIT\fP keyword, which takes no parameters, disables the
|
||||
exit confirmation dialog always. Unsaved client work may be lost but
|
||||
this may be useful if you want no dialogs.
|
||||
|
||||
.SH Menu instructions
|
||||
.TP 8
|
||||
|
|
|
@ -119,7 +119,7 @@ SysMenu {
|
|||
# "xterm" "uninstall.ico"
|
||||
# }
|
||||
|
||||
# SilentExit
|
||||
SilentExit
|
||||
|
||||
DEBUG "Done parsing the configuration file..."
|
||||
|
||||
|
|
|
@ -282,8 +282,9 @@ winDisplayExitDialog (winPrivScreenPtr pScreenPriv)
|
|||
if (liveClients < 0)
|
||||
liveClients = 0;
|
||||
|
||||
/* Don't show the exit confirmation dialog if SilentExit is enabled */
|
||||
if (pref.fSilentExit && liveClients <= 0)
|
||||
/* Don't show the exit confirmation dialog if SilentExit & no clients,
|
||||
or ForceExit, is enabled */
|
||||
if ((pref.fSilentExit && liveClients <= 0) || pref.fForceExit)
|
||||
{
|
||||
if (g_hDlgExit != NULL)
|
||||
{
|
||||
|
@ -326,7 +327,7 @@ winDisplayExitDialog (winPrivScreenPtr pScreenPriv)
|
|||
GetDlgItem (g_hDlgExit, IDCANCEL), TRUE);
|
||||
}
|
||||
|
||||
#define CONNECTED_CLIENTS_FORMAT "There are currently %d clients connected."
|
||||
#define CONNECTED_CLIENTS_FORMAT "There %s currently %d client%s connected."
|
||||
|
||||
|
||||
/*
|
||||
|
@ -353,7 +354,9 @@ winExitDlgProc (HWND hDialog, UINT message,
|
|||
|
||||
/* Format the connected clients string */
|
||||
pszConnectedClients = Xprintf (CONNECTED_CLIENTS_FORMAT,
|
||||
s_pScreenPriv->iConnectedClients);
|
||||
(s_pScreenPriv->iConnectedClients == 1) ? "is" : "are",
|
||||
s_pScreenPriv->iConnectedClients,
|
||||
(s_pScreenPriv->iConnectedClients == 1) ? "" : "s");
|
||||
if (!pszConnectedClients)
|
||||
return TRUE;
|
||||
|
||||
|
|
|
@ -143,6 +143,9 @@ typedef struct WINPREFS
|
|||
STYLEITEM *style;
|
||||
int styleItems;
|
||||
|
||||
/* Force exit flag */
|
||||
Bool fForceExit;
|
||||
|
||||
/* Silent exit flag */
|
||||
Bool fSilentExit;
|
||||
|
||||
|
|
|
@ -92,10 +92,34 @@ extern int yylex(void);
|
|||
int iVal;
|
||||
}
|
||||
|
||||
%token NEWLINE MENU LB RB ICONDIRECTORY DEFAULTICON ICONS STYLES
|
||||
%token TOPMOST MAXIMIZE MINIMIZE BOTTOM NOTITLE OUTLINE NOFRAME DEFAULTSYSMENU
|
||||
%token SYSMENU ROOTMENU SEPARATOR ATSTART ATEND EXEC ALWAYSONTOP DEBUG
|
||||
%token RELOAD TRAYICON SILENTEXIT
|
||||
%token NEWLINE
|
||||
%token MENU
|
||||
%token LB
|
||||
%token RB
|
||||
%token ICONDIRECTORY
|
||||
%token DEFAULTICON
|
||||
%token ICONS
|
||||
%token STYLES
|
||||
%token TOPMOST
|
||||
%token MAXIMIZE
|
||||
%token MINIMIZE
|
||||
%token BOTTOM
|
||||
%token NOTITLE
|
||||
%token OUTLINE
|
||||
%token NOFRAME
|
||||
%token DEFAULTSYSMENU
|
||||
%token SYSMENU
|
||||
%token ROOTMENU
|
||||
%token SEPARATOR
|
||||
%token ATSTART
|
||||
%token ATEND
|
||||
%token EXEC
|
||||
%token ALWAYSONTOP
|
||||
%token DEBUG
|
||||
%token RELOAD
|
||||
%token TRAYICON
|
||||
%token FORCEEXIT
|
||||
%token SILENTEXIT
|
||||
|
||||
%token <sVal> STRING
|
||||
%type <uVal> group1
|
||||
|
@ -128,6 +152,7 @@ command: defaulticon
|
|||
| defaultsysmenu
|
||||
| debug
|
||||
| trayicon
|
||||
| forceexit
|
||||
| silentexit
|
||||
;
|
||||
|
||||
|
@ -212,6 +237,9 @@ sysmenulist: sysmenuline
|
|||
sysmenu: SYSMENU LB NEWLINE {OpenSysMenu();} newline_or_nada sysmenulist RB {CloseSysMenu();}
|
||||
;
|
||||
|
||||
forceexit: FORCEEXIT NEWLINE { pref.fForceExit = TRUE; }
|
||||
;
|
||||
|
||||
silentexit: SILENTEXIT NEWLINE { pref.fSilentExit = TRUE; }
|
||||
;
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user