Skip to content
Snippets Groups Projects
Commit cf611198 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Add support to SDL and GDI modes for CONIO_OPT_DISABLE_CLOSE

... to disable the OS or Window Manager's "close" app icon/control/option
which attempts an ungraceful termination of UIFC apps (e.g. SCFG) and does
weird and wonderful things (e.g. infinite loops which are invisible on
Win32-GDI, so you end up with a ghost/zombie process).

Disabling the OS/WM close option is an alternative solution to checking
uifc.exit_flags & UIFC_XF_QUIT everywhere you need to to avoid a
looping/zombie process.

Next up X11, which appears I need to remove _NET_WM_ACTION_CLOSE
from the _NET_WM_ALLOWED_ACTIONS Atom... ?
parent 74f4348c
No related branches found
No related tags found
No related merge requests found
/* $Id: ciolib.h,v 1.125 2020/06/27 00:04:44 deuce Exp $ */
/****************************************************************************
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
......@@ -13,21 +11,9 @@
* See the GNU Lesser General Public License for more details: lgpl.txt or *
* http://www.fsf.org/copyleft/lesser.html *
* *
* Anonymous FTP access to the most recent released source is available at *
* ftp://vert.synchro.net, ftp://cvs.synchro.net and ftp://ftp.synchro.net *
* *
* Anonymous CVS access to the development source and modification history *
* is available at cvs.synchro.net:/cvsroot/sbbs, example: *
* cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs login *
* (just hit return, no password is necessary) *
* cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs checkout src *
* *
* For Synchronet coding style and modification guidelines, see *
* http://www.synchro.net/source.html *
* *
* You are encouraged to submit any modifications (preferably in Unix diff *
* format) via e-mail to mods@synchro.net *
* *
* Note: If this box doesn't appear square, then you need to fix your tabs. *
****************************************************************************/
......@@ -324,6 +310,7 @@ typedef struct {
#define CONIO_OPT_EXTENDED_PALETTE (1 << 12)
#define CONIO_OPT_BLOCKY_SCALING (1 << 13)
#define CONIO_OPT_EXTERNAL_SCALING (1 << 14)
#define CONIO_OPT_DISABLE_CLOSE (1 << 15) // Disable OS/WM app close control/menu-option
void (*clreol) (void);
int (*puttext) (int,int,int,int,void *);
int (*vmem_puttext) (int,int,int,int,struct vmem_cell *);
......
......@@ -232,6 +232,8 @@ int init_sdl_video(void)
if (!sdl.gotfuncs)
return -1;
if (cio_api.options & CONIO_OPT_DISABLE_CLOSE)
sdl.SetHint(SDL_HINT_WINDOWS_NO_CLOSE_ON_ALT_F4, "1");
sdl.SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "2" );
sdl.SetHint(SDL_HINT_VIDEO_ALLOW_SCREENSAVER, "1" );
#ifdef _WIN32
......
......@@ -858,6 +858,8 @@ gdi_thread(void *arg)
win = CreateWindowW(wc.lpszClassName, L"SyncConsole", STYLE, wx, wy, r.right - r.left, r.bottom - r.top, NULL, NULL, NULL, NULL);
if (win == NULL)
goto fail;
if (cio_api.options & CONIO_OPT_DISABLE_CLOSE)
EnableMenuItem(GetSystemMenu(win, /* revert; */FALSE), SC_CLOSE, MF_DISABLED); // Disable the Windows' app-system-menu close option
// No failing after this...
init_success = true;
if (fullscreen)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment