XDarwin: Merging misc changes from downstream.

The only functional changes in this patch are a removal of use of
Xtrans internals -- replaced by xcb, which doesn't seem to be used
elsewhere in the server?  Pity.
Also, a fix to make all X11 windows pop to the front of the display
when the X11.app icon is clicked -- currently takes two clicks,
not sure why.
This commit is contained in:
Ben Byer 2007-09-20 16:50:49 -07:00
parent 3a965fdadc
commit 374bd88d10
5 changed files with 30 additions and 75 deletions

View File

@ -4,42 +4,6 @@
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>x11app</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>X11.icns</string>
<key>CFBundleTypeName</key>
<string>X11 Application</string>
<key>CFBundleTypeOSTypes</key>
<array>
<string>****</string>
</array>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>LSIsAppleDefaultForType</key>
<true/>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>tool</string>
<string>*</string>
</array>
<key>CFBundleTypeName</key>
<string>UNIX Application</string>
<key>CFBundleTypeOSTypes</key>
<array>
<string>****</string>
</array>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
</dict>
</array>
<key>CFBundleExecutable</key>
<string>X11</string>
<key>CFBundleGetInfoString</key>
@ -57,7 +21,7 @@
<key>CFBundleShortVersionString</key>
<string>2.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<string>x11a</string>
<key>CSResourcesFileMapped</key>
<true/>
<key>NSHumanReadableCopyright</key>

View File

@ -79,7 +79,7 @@ extern void X11ApplicationMain (int argc, const char *argv[],
extern int X11EnableKeyEquivalents;
extern int quartzHasRoot, quartzEnableRootless;
#define APP_PREFS "com.apple.x11"
#define APP_PREFS "org.x.x11"
#define PREFS_APPSMENU "apps_menu"
#define PREFS_FAKEBUTTONS "enable_fake_buttons"

View File

@ -41,13 +41,11 @@
# include "micmap.h"
#undef BOOL
//#include "xf86Version.h"
#include <mach/mach.h>
#include <unistd.h>
#include <pthread.h>
#define DEFAULTS_FILE "/etc/X11/xserver/Xquartz.plist"
#define DEFAULTS_FILE "/usr/X11/lib/X11xserver/Xquartz.plist"
int X11EnableKeyEquivalents = TRUE;
int quartzHasRoot = FALSE, quartzEnableRootless = TRUE;
@ -275,9 +273,7 @@ static void message_kit_thread (SEL selector, NSObject *arg) {
_appFlags._active = YES;
[self activateX:YES];
#ifdef DARWIN_DDX_MISSING
if ([e data2] & 0x10) QuartzMessageServerThread (kXDarwinBringAllToFront, 0);
#endif
if ([e data2] & 0x10) X11ApplicationSetFrontProcess();
}
break;

View File

@ -38,14 +38,12 @@
/* ouch! */
#define BOOL X_BOOL
//# include "Xproto.h"
#include "opaque.h"
# include "darwin.h"
# include "../quartz/quartz.h"
# define _APPLEWM_SERVER_
# include "X11/extensions/applewm.h"
# include "../quartz/applewmExt.h"
//# include "X.h"
#undef BOOL
#include <stdio.h>
@ -301,6 +299,7 @@
int child1, child2 = 0;
int status;
/* this old code doesn't work with csh ...
shell = getenv("SHELL");
if (shell == NULL) shell = "/bin/bash";
@ -308,8 +307,14 @@
argv[1] = "-l";
argv[2] = "-c";
argv[3] = command;
argv[4] = NULL;
argv[4] = NULL;
... but the new code doesn't work with spaces in a command :(
*/
argv[0] = "/usr/bin/login";
argv[1] = "-fp";
argv[2] = getlogin();
/* Do the fork-twice trick to avoid having to reap zombies */
child1 = fork();
@ -655,7 +660,7 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn row:(int)row
- (IBAction) x11_help:sender
{
AHLookupAnchor (CFSTR ("Mac Help"), CFSTR ("mchlp2276"));
AHLookupAnchor ((CFStringRef)NSLocalizedString(@"Mac Help", no comment), CFSTR ("mchlp2276"));
}
- (BOOL) validateMenuItem:(NSMenuItem *)item

View File

@ -70,14 +70,16 @@
#include <X11/Xlib.h>
#include <X11/Xauth.h>
#ifdef USE_XCB
#include <xcb/xcb.h>
#endif
#include <CoreFoundation/CoreFoundation.h>
#include <SystemConfiguration/SystemConfiguration.h>
#define X_SERVER "/usr/X11/bin/Xquartz"
#define XTERM_PATH "/usr/X11/bin/xterm"
#define WM_PATH "/usr/X11/bin/quartz-wm"
#define DEFAULT_XINITRC "/etc/X11/xinit/xinitrc"
#define WM_PATH "/usr/bin/quartz-wm"
#define DEFAULT_XINITRC "/usr/X11/lib/X11/xinit/xinitrc"
#define DEFAULT_PATH "/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/X11/bin"
/* what xinit does */
@ -595,37 +597,25 @@ static Boolean
display_exists_p (int number)
{
char buf[64];
void *conn;
char *fullname = NULL;
int idisplay, iscreen;
char *conn_auth_name, *conn_auth_data;
int conn_auth_namelen, conn_auth_datalen;
#ifdef USE_XTRANS_INTERNALS
extern void *_X11TransConnectDisplay ();
extern void _XDisconnectDisplay ();
#endif
#ifdef USE_XCB
xcb_connection_t *conn;
#endif
/* Since connecting to the display waits for a few seconds if the
display doesn't exist, check for trivial non-existence - if the
socket in /tmp exists or not.. (note: if the socket exists, the
server may still not, so we need to try to connect in that case..) */
sprintf (buf, "/tmp/.X11-unix/X%d", number);
if (access (buf, F_OK) != 0)
return FALSE;
#ifdef USE_XTRANS_INTERNALS
/* This is a private function that we shouldn't really be calling,
but it's the best way to see if the server exists (without
needing to hold the necessary authentication to use it) */
if (access (buf, F_OK) != 0) return FALSE;
#ifdef USE_XCB
sprintf (buf, ":%d", number);
conn = _X11TransConnectDisplay (buf, &fullname, &idisplay, &iscreen,
&conn_auth_name, &conn_auth_namelen,
&conn_auth_data, &conn_auth_datalen);
if (conn == NULL)
return FALSE;
_XDisconnectDisplay (conn);
conn = xcb_connect(buf, NULL);
if (conn == NULL) return FALSE;
xcb_disconnect(conn);
#endif
return TRUE;
}