diff options
| author | su_v <suv-sf@users.sourceforge.net> | 2014-08-20 01:44:01 +0000 |
|---|---|---|
| committer | ~suv <suv-sf@users.sourceforge.net> | 2014-08-20 01:44:01 +0000 |
| commit | c1f2cee561acdbd6963c5bf9300953ef40140e8e (patch) | |
| tree | cb772442b269c095120564b5196cb692089ce7d8 /packaging | |
| parent | update custom fonts.conf to latest upstream changes (diff) | |
| download | inkscape-c1f2cee561acdbd6963c5bf9300953ef40140e8e.tar.gz inkscape-c1f2cee561acdbd6963c5bf9300953ef40140e8e.zip | |
remove support for X11 on Panther and Tiger (Leopard and later use launchd)
(bzr r13506.1.11)
Diffstat (limited to 'packaging')
| -rwxr-xr-x | packaging/macosx/Resources/bin/getdisplay.sh | 9 | ||||
| -rwxr-xr-x | packaging/macosx/Resources/script | 31 | ||||
| -rw-r--r-- | packaging/macosx/ScriptExec/main.c | 59 |
3 files changed, 3 insertions, 96 deletions
diff --git a/packaging/macosx/Resources/bin/getdisplay.sh b/packaging/macosx/Resources/bin/getdisplay.sh deleted file mode 100755 index f7f383348..000000000 --- a/packaging/macosx/Resources/bin/getdisplay.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -# -# Author: Aaron Voisine <aaron@voisine.org> - -if [ "$DISPLAY"x == "x" ]; then - echo :0 > /tmp/display.$UID -else - echo $DISPLAY > /tmp/display.$UID -fi diff --git a/packaging/macosx/Resources/script b/packaging/macosx/Resources/script index 62dcafdf5..b6464de96 100755 --- a/packaging/macosx/Resources/script +++ b/packaging/macosx/Resources/script @@ -8,37 +8,6 @@ CWD=`dirname "$0"` # System version: 3 for Panther, 4 for Tiger, 5 for Leopard export VERSION=`/usr/bin/sw_vers | grep ProductVersion | cut -f2 -d'.'` -# On Leopard, X11.app is installed by default, and will be started -# automatically via launchd. On older systems, we need to start -# X11 ourself. - -# For Panther and Tiger, start X11 -if [[ $VERSION -le 4 ]]; then - # FIXME apparently this removes the xterm that starts with X - # from xinitrc but when is it really used? Should we modify - # the .xinitrc of the user without warning? - ps -wx -ocommand | grep -e '[X]11' > /dev/null - if [ "$?" != "0" -a ! -f "${HOME}/.xinitrc" ]; then - echo "rm -f \"\${HOME}/.xinitrc\"" > "${HOME}/.xinitrc" - sed 's/xterm/# xterm/' /usr/X11R6/lib/X11/xinit/xinitrc >> "${HOME}/.xinitrc" - fi - - # Start X11 and get DISPLAY - # FIXME: Insecure tmp file usage. Why do we have to copy this to /tmp anyway? - cp -f "$CWD/bin/getdisplay.sh" /tmp/ - rm -f /tmp/display.$UID - open-x11 /tmp/getdisplay.sh || \ - open -a XDarwin /tmp/getdisplay.sh || \ - echo ":0" > /tmp/display.$UID - - while [ "$?" == "0" -a ! -f /tmp/display.$UID ]; do - sleep 1 - done - export DISPLAY=`cat /tmp/display.$UID` - - ps -wx -ocommand | grep -e '[X]11' > /dev/null || exit 11 -fi - # Warn the user about time-consuming generation of fontconfig caches. test -f "${HOME}/.inkscape-etc/.fccache-new" || exit 12 diff --git a/packaging/macosx/ScriptExec/main.c b/packaging/macosx/ScriptExec/main.c index e754057a9..c9c6ffaa8 100644 --- a/packaging/macosx/ScriptExec/main.c +++ b/packaging/macosx/ScriptExec/main.c @@ -28,7 +28,7 @@ /* * This app laucher basically takes care of: - * - launching Inkscape and X11 when double-clicked + * - launching Inkscape when double-clicked * - bringing X11 to the top when its icon is clicked in the dock (via a small applescript) * - catch file dropped on icon events (and double-clicked gimp documents) and notify gimp. * - catch quit events performed outside gimp, e.g. on the dock icon. @@ -43,7 +43,7 @@ // Note: including Carbon prevents building the launcher app in x86_64 // used for StandardAlert in RequestUserAttention(), -// RedFatalAlert() and X11FailedHandler() +// RedFatalAlert() #include <Carbon/Carbon.h> #include <CoreFoundation/CoreFoundation.h> @@ -73,7 +73,6 @@ #define kEventClassRedFatalAlert 911 // custom carbon event types -#define kEventKindX11Failed 911 #define kEventKindFCCacheFailed 912 //maximum arguments the script accepts @@ -104,8 +103,6 @@ static OSErr AppOpenDocAEHandler(const AppleEvent *theAppleEvent, AppleEvent *reply, long refCon); static OSErr AppOpenAppAEHandler(const AppleEvent *theAppleEvent, AppleEvent *reply, long refCon); -static OSStatus X11FailedHandler(EventHandlerCallRef theHandlerCall, - EventRef theEvent, void *userData); static OSStatus FCCacheFailedHandler(EventHandlerCallRef theHandlerCall, EventRef theEvent, void *userData); static OSErr AppReopenAppAEHandler(const AppleEvent *theAppleEvent, @@ -149,7 +146,6 @@ extern char **environ; int main(int argc, char* argv[]) { OSErr err = noErr; - EventTypeSpec X11events = { kEventClassRedFatalAlert, kEventKindX11Failed }; EventTypeSpec FCCacheEvents = { kEventClassRedFatalAlert, kEventKindFCCacheFailed }; InitCursor(); @@ -170,9 +166,6 @@ int main(int argc, char* argv[]) 0, false); err += InstallEventHandler(GetApplicationEventTarget(), - NewEventHandlerUPP(X11FailedHandler), 1, - &X11events, NULL, NULL); - err += InstallEventHandler(GetApplicationEventTarget(), NewEventHandlerUPP(FCCacheFailedHandler), 1, &FCCacheEvents, NULL, NULL); @@ -268,12 +261,7 @@ static void *Execute (void *arg) taskDone = false; OSErr err = ExecuteScript(scriptPath, &pid); - if (err == (OSErr)11) { - CreateEvent(NULL, kEventClassRedFatalAlert, kEventKindX11Failed, 0, - kEventAttributeNone, &event); - PostEventToQueue(GetMainEventQueue(), event, kEventPriorityStandard); - } - else if (err == (OSErr)12) { + if (err == (OSErr)12) { CreateEvent(NULL, kEventClassRedFatalAlert, kEventKindFCCacheFailed, 0, kEventAttributeNone, &event); PostEventToQueue(GetMainEventQueue(), event, kEventPriorityHigh); @@ -577,47 +565,6 @@ static void OpenURL(Str255 url) } -////////////////////////////////// -// Handler for when X11 fails to start -////////////////////////////////// -static OSStatus X11FailedHandler(EventHandlerCallRef theHandlerCall, - EventRef theEvent, void *userData) -{ - #pragma unused(theHanderCall, theEvent, userData) - - pthread_join(tid, NULL); - if (odtid) pthread_join(odtid, NULL); - - SInt16 itemHit; - const char *getX11 = "\pGet X11 for Panther"; - - AlertStdAlertParamRec params; - params.movable = true; - params.helpButton = false; - params.filterProc = NULL; - params.defaultText = (StringPtr) kAlertDefaultOKText; - params.cancelText = getX11; - params.otherText = NULL; - params.defaultButton = kAlertStdAlertOKButton; - params.cancelButton = kAlertStdAlertCancelButton; - params.position = kWindowDefaultPosition; - - StandardAlert(kAlertStopAlert, "\pFailed to start X11", - "\pInkscape.app requires XQuartz.", - ¶ms, &itemHit); - - if (itemHit == kAlertStdAlertCancelButton) - { - OpenURL("http://xquartz.macosforge.org/landing/"); - } - - ExitToShell(); - - - return noErr; -} - - // Compile and run a small AppleScript. The code below does no cleanup and no proper error checks // but since it's there until the app is shut down, and since we know the script is okay, // there should not be any problems. |
