From 81493d30981d7deb38f57bca2a35487add5ea509 Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Sequoia Date: Sun, 18 Sep 2016 23:13:20 -0700 Subject: XQuartz: Remove X11ApplicationFatalError AppKit handles crashes on app launch with their own dialog now, so we shouldn't need to do this ourselves. Signed-off-by: Jeremy Huddleston Sequoia --- hw/xquartz/X11Application.h | 3 --- hw/xquartz/X11Application.m | 48 --------------------------------------------- hw/xquartz/darwin.c | 1 - 3 files changed, 52 deletions(-) diff --git a/hw/xquartz/X11Application.h b/hw/xquartz/X11Application.h index 87cba6dec..740a8070a 100644 --- a/hw/xquartz/X11Application.h +++ b/hw/xquartz/X11Application.h @@ -86,9 +86,6 @@ X11ApplicationLaunchClient(const char *cmd); Bool X11ApplicationCanEnterRandR(void); -void -X11ApplicationFatalError(const char *f, va_list args) __printflike(1, 0); - void X11ApplicationMain(int argc, char **argv, char **envp); diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m index 9a2290990..19e9451f7 100644 --- a/hw/xquartz/X11Application.m +++ b/hw/xquartz/X11Application.m @@ -84,7 +84,6 @@ static dispatch_queue_t eventTranslationQueue; extern Bool noTestExtensions; extern Bool noRenderExtension; -extern BOOL serverRunning; #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050 static TISInputSourceRef last_key_layout; @@ -1096,53 +1095,6 @@ X11ApplicationCanEnterRandR(void) } } -void -X11ApplicationFatalError(const char *f, va_list args) -{ -#ifdef HAVE_LIBDISPATCH - NSString *title, *msg; - char *error_msg; - - /* This is called by FatalError() in the server thread just before - * we would abort. If the server never got off the ground, We should - * inform the user of the error rather than letting the ever-so-friendly - * CrashReporter do it for us. - * - * This also has the benefit of forcing user interaction rather than - * allowing an infinite throttled-restart if the crash occurs before - * we can drain the launchd socket. - */ - - if (serverRunning) { - return; - } - - title = NSLocalizedString(@"The application X11 could not be opened.", - @"Dialog title when encountering a fatal error"); - msg = NSLocalizedString( - @"An error occurred while starting the X11 server: \"%s\"\n\nClick Quit to quit X11. Click Report to see more details or send a report to Apple.", - @"Dialog when encountering a fatal error"); - - vasprintf(&error_msg, f, args); - msg = [NSString stringWithFormat:msg, error_msg]; - - /* We want the AppKit thread to actually service the alert or we will race [NSApp run] and create an - * 'NSInternalInconsistencyException', reason: 'NSApp with wrong _running count' - */ - dispatch_sync(dispatch_get_main_queue(), ^{ - if (NSAlertDefaultReturn == - NSRunAlertPanel (title, @"%@", - NSLocalizedString (@"Quit", @""), - NSLocalizedString (@"Report...", @""), - nil, msg)) { - exit (EXIT_FAILURE); - } - }); - - /* fall back to caller to do the abort() in the DIX */ -#endif -} - static void check_xinitrc(void) { diff --git a/hw/xquartz/darwin.c b/hw/xquartz/darwin.c index c0d0b8a19..36c149cba 100644 --- a/hw/xquartz/darwin.c +++ b/hw/xquartz/darwin.c @@ -680,7 +680,6 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) void OsVendorFatalError(const char *f, va_list args) { - X11ApplicationFatalError(f, args); } /* -- cgit v1.2.3