summaryrefslogtreecommitdiff
path: root/hw/xquartz
diff options
context:
space:
mode:
Diffstat (limited to 'hw/xquartz')
-rw-r--r--hw/xquartz/X11Application.h2
-rw-r--r--hw/xquartz/X11Application.m17
-rw-r--r--hw/xquartz/X11Controller.m4
-rw-r--r--hw/xquartz/mach-startup/bundle-main.c37
-rw-r--r--hw/xquartz/mach-startup/mach_startup_types.h1
-rw-r--r--hw/xquartz/mach-startup/stub.c19
-rw-r--r--hw/xquartz/pbproxy/app-main.m26
-rw-r--r--hw/xquartz/pbproxy/main.m25
-rw-r--r--hw/xquartz/pbproxy/x-selection.m7
-rw-r--r--hw/xquartz/quartz.h8
-rw-r--r--hw/xquartz/quartzKeyboard.c144
-rw-r--r--hw/xquartz/xpr/xprScreen.c4
12 files changed, 118 insertions, 176 deletions
diff --git a/hw/xquartz/X11Application.h b/hw/xquartz/X11Application.h
index 91debd663..1cfbe0803 100644
--- a/hw/xquartz/X11Application.h
+++ b/hw/xquartz/X11Application.h
@@ -75,8 +75,6 @@ void X11ApplicationMain(int argc, char **argv, char **envp);
extern int X11EnableKeyEquivalents;
extern int quartzHasRoot, quartzEnableRootless, quartzFullscreenMenu;
-#define APP_PREFS "org.x.X11"
-
#define PREFS_APPSMENU "apps_menu"
#define PREFS_FAKEBUTTONS "enable_fake_buttons"
#define PREFS_SYSBEEP "enable_system_beep"
diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m
index 57f680965..44b8418f0 100644
--- a/hw/xquartz/X11Application.m
+++ b/hw/xquartz/X11Application.m
@@ -76,6 +76,8 @@ extern int darwinFakeButtons;
X11Application *X11App;
+CFStringRef app_prefs_domain_cfstr = NULL;
+
#define ALL_KEY_MASKS (NSShiftKeyMask | NSControlKeyMask | NSAlternateKeyMask | NSCommandKeyMask)
@interface X11Application (Private)
@@ -466,7 +468,7 @@ static NSMutableArray * cfarray_to_nsarray (CFArrayRef in) {
- (CFPropertyListRef) prefs_get:(NSString *)key {
CFPropertyListRef value;
- value = CFPreferencesCopyAppValue ((CFStringRef) key, CFSTR (APP_PREFS));
+ value = CFPreferencesCopyAppValue ((CFStringRef) key, app_prefs_domain_cfstr);
if (value == NULL) {
static CFDictionaryRef defaults;
@@ -618,7 +620,7 @@ static NSMutableArray * cfarray_to_nsarray (CFArrayRef in) {
x = CFNumberCreate (NULL, kCFNumberIntType, &value);
- CFPreferencesSetValue ((CFStringRef) key, (CFTypeRef) x, CFSTR (APP_PREFS),
+ CFPreferencesSetValue ((CFStringRef) key, (CFTypeRef) x, app_prefs_domain_cfstr,
kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
CFRelease (x);
@@ -629,7 +631,7 @@ static NSMutableArray * cfarray_to_nsarray (CFArrayRef in) {
x = CFNumberCreate (NULL, kCFNumberFloatType, &value);
- CFPreferencesSetValue ((CFStringRef) key, (CFTypeRef) x, CFSTR (APP_PREFS),
+ CFPreferencesSetValue ((CFStringRef) key, (CFTypeRef) x, app_prefs_domain_cfstr,
kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
CFRelease (x);
@@ -638,7 +640,7 @@ static NSMutableArray * cfarray_to_nsarray (CFArrayRef in) {
- (void) prefs_set_boolean:(NSString *)key value:(int)value {
CFPreferencesSetValue ((CFStringRef) key,
(CFTypeRef) (value ? kCFBooleanTrue
- : kCFBooleanFalse), CFSTR (APP_PREFS),
+ : kCFBooleanFalse), app_prefs_domain_cfstr,
kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
}
@@ -649,14 +651,14 @@ static NSMutableArray * cfarray_to_nsarray (CFArrayRef in) {
cfarray = nsarray_to_cfarray (value);
CFPreferencesSetValue ((CFStringRef) key,
(CFTypeRef) cfarray,
- CFSTR (APP_PREFS),
+ app_prefs_domain_cfstr,
kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
CFRelease (cfarray);
}
- (void) prefs_set_string:(NSString *)key value:(NSString *)value {
CFPreferencesSetValue ((CFStringRef) key, (CFTypeRef) value,
- CFSTR (APP_PREFS), kCFPreferencesCurrentUser,
+ app_prefs_domain_cfstr, kCFPreferencesCurrentUser,
kCFPreferencesAnyHost);
}
@@ -857,6 +859,9 @@ void X11ApplicationMain (int argc, char **argv, char **envp) {
pool = [[NSAutoreleasePool alloc] init];
X11App = (X11Application *) [X11Application sharedApplication];
init_ports ();
+
+ app_prefs_domain_cfstr = (CFStringRef)[[NSBundle mainBundle] bundleIdentifier];
+
[NSApp read_defaults];
[NSBundle loadNibNamed:@"main" owner:NSApp];
[[NSNotificationCenter defaultCenter] addObserver:NSApp
diff --git a/hw/xquartz/X11Controller.m b/hw/xquartz/X11Controller.m
index 76fbb573a..233fd4f1d 100644
--- a/hw/xquartz/X11Controller.m
+++ b/hw/xquartz/X11Controller.m
@@ -55,6 +55,8 @@
#include <sys/types.h>
#include <sys/wait.h>
+BOOL xquartz_resetenv_display = NO;
+
@implementation X11Controller
- (void) awakeFromNib
@@ -356,7 +358,7 @@
/* Setup environment */
temp = getenv("DISPLAY");
- if (temp == NULL || temp[0] == 0) {
+ if (xquartz_resetenv_display || temp == NULL || temp[0] == 0) {
snprintf(buf, sizeof(buf), ":%s", display);
setenv("DISPLAY", buf, TRUE);
}
diff --git a/hw/xquartz/mach-startup/bundle-main.c b/hw/xquartz/mach-startup/bundle-main.c
index a49013e0d..e58277a9e 100644
--- a/hw/xquartz/mach-startup/bundle-main.c
+++ b/hw/xquartz/mach-startup/bundle-main.c
@@ -29,6 +29,7 @@
prior written authorization. */
#include <CoreFoundation/CoreFoundation.h>
+#include <AvailabilityMacros.h>
#include <X11/Xlib.h>
#include <unistd.h>
@@ -56,6 +57,8 @@ void DarwinListenOnOpenFD(int fd);
extern int noPanoramiXExtension;
+extern int xquartz_resetenv_display;
+
#define DEFAULT_CLIENT "/usr/X11/bin/xterm"
#define DEFAULT_STARTX "/usr/X11/bin/startx"
#define DEFAULT_SHELL "/bin/sh"
@@ -72,10 +75,9 @@ const char *__crashreporter_info__base = "X.Org X Server " XSERVER_VERSION " Bui
char __crashreporter_info__buf[4096];
char *__crashreporter_info__ = __crashreporter_info__buf;
-#define DEBUG 1
+static char *server_bootstrap_name = "org.x.X11";
-static int execute(const char *command);
-static char *command_from_prefs(const char *key, const char *default_value);
+#define DEBUG 1
/* This is in quartzStartup.c */
int server_main(int argc, char **argv, char **envp);
@@ -372,9 +374,13 @@ int startup_trigger(int argc, char **argv, char **envp) {
strlcpy(newenvp[i], envp[i], STRING_T_SIZE);
}
- kr = bootstrap_look_up(bootstrap_port, SERVER_BOOTSTRAP_NAME, &mp);
+ kr = bootstrap_look_up(bootstrap_port, server_bootstrap_name, &mp);
if (kr != KERN_SUCCESS) {
+#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
fprintf(stderr, "bootstrap_look_up(): %s\n", bootstrap_strerror(kr));
+#else
+ fprintf(stderr, "bootstrap_look_up(): %ul\n", (unsigned long)kr);
+#endif
exit(EXIT_FAILURE);
}
@@ -404,6 +410,9 @@ int startup_trigger(int argc, char **argv, char **envp) {
if((s = getenv("DISPLAY"))) {
fprintf(stderr, "X11.app: Could not connect to server (DISPLAY=\"%s\", unsetting). Starting X server.\n", s);
unsetenv("DISPLAY");
+
+ /* This tells X11Controller to not use the environment's DISPLAY and reset it based on the server's display */
+ xquartz_resetenv_display = 1;
} else {
fprintf(stderr, "X11.app: Could not connect to server (DISPLAY is not set). Starting X server.\n");
}
@@ -424,6 +433,22 @@ int main(int argc, char **argv, char **envp) {
/* Setup the initial crasherporter info */
strlcpy(__crashreporter_info__, __crashreporter_info__base, __crashreporter_info__len);
+ /* Pass on our prefs domain to startx and its inheritors (mainly for
+ * quartz-wm and the Xquartz stub's MachIPC)
+ */
+ CFBundleRef bundle = CFBundleGetMainBundle();
+ if(bundle) {
+ CFStringRef pd = CFBundleGetIdentifier(bundle);
+ if(pd) {
+ const char *pds = CFStringGetCStringPtr(pd, 0);
+ if(pds) {
+ server_bootstrap_name = malloc(sizeof(char) * (strlen(pds) + 1));
+ strcpy(server_bootstrap_name, pds);
+ setenv("X11_PREFS_DOMAIN", pds, 1);
+ }
+ }
+ }
+
fprintf(stderr, "X11.app: main(): argc=%d\n", argc);
for(i=0; i < argc; i++) {
fprintf(stderr, "\targv[%u] = %s\n", (unsigned)i, argv[i]);
@@ -432,9 +457,9 @@ int main(int argc, char **argv, char **envp) {
}
}
- mp = checkin_or_register(SERVER_BOOTSTRAP_NAME);
+ mp = checkin_or_register(server_bootstrap_name);
if(mp == MACH_PORT_NULL) {
- fprintf(stderr, "NULL mach service: %s", SERVER_BOOTSTRAP_NAME);
+ fprintf(stderr, "NULL mach service: %s", server_bootstrap_name);
return EXIT_FAILURE;
}
diff --git a/hw/xquartz/mach-startup/mach_startup_types.h b/hw/xquartz/mach-startup/mach_startup_types.h
index 97ac147cd..459c750db 100644
--- a/hw/xquartz/mach-startup/mach_startup_types.h
+++ b/hw/xquartz/mach-startup/mach_startup_types.h
@@ -1,7 +1,6 @@
#ifndef _MACH_STARTUP_TYPES_H_
#define _MACH_STARTUP_TYPES_H_
-#define SERVER_BOOTSTRAP_NAME "org.x.X11"
#define STRING_T_SIZE 1024
typedef char string_t[STRING_T_SIZE];
diff --git a/hw/xquartz/mach-startup/stub.c b/hw/xquartz/mach-startup/stub.c
index bc4f7eca0..893d19c8d 100644
--- a/hw/xquartz/mach-startup/stub.c
+++ b/hw/xquartz/mach-startup/stub.c
@@ -40,6 +40,12 @@
#include <sys/socket.h>
#include <sys/un.h>
+static char *server_bootstrap_name = "org.x.X11";
+
+/* The launchd startup is only designed for the primary X11.app that is
+ * org.x.X11... server_bootstrap_name might be differnet if we were triggered to
+ * start by another X11.app.
+ */
#define kX11AppBundleId "org.x.X11"
#define kX11AppBundlePath "/Contents/MacOS/X11"
@@ -222,6 +228,9 @@ int main(int argc, char **argv, char **envp) {
return EXIT_SUCCESS;
}
+ if(getenv("X11_PREFS_DOMAIN"))
+ server_bootstrap_name = getenv("X11_PREFS_DOMAIN");
+
/* We don't have a mechanism in place to handle this interrupt driven
* server-start notification, so just send the signal now, so xinit doesn't
* time out waiting for it and will just poll for the server.
@@ -238,7 +247,7 @@ int main(int argc, char **argv, char **envp) {
/* Get the $DISPLAY FD */
launchd_fd = launchd_display_fd();
- kr = bootstrap_look_up(bootstrap_port, SERVER_BOOTSTRAP_NAME, &mp);
+ kr = bootstrap_look_up(bootstrap_port, server_bootstrap_name, &mp);
if(kr != KERN_SUCCESS) {
set_x11_path();
@@ -261,13 +270,17 @@ int main(int argc, char **argv, char **envp) {
/* Try connecting for 10 seconds */
for(i=0; i < 80; i++) {
usleep(250000);
- kr = bootstrap_look_up(bootstrap_port, SERVER_BOOTSTRAP_NAME, &mp);
+ kr = bootstrap_look_up(bootstrap_port, server_bootstrap_name, &mp);
if(kr == KERN_SUCCESS)
break;
}
if(kr != KERN_SUCCESS) {
- fprintf(stderr, "Xquartz: bootstrap_look_up(): Timed out: %s\n", bootstrap_strerror(kr));
+#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
+ fprintf(stderr, "Xquartz: bootstrap_look_up(): %s\n", bootstrap_strerror(kr));
+#else
+ fprintf(stderr, "Xquartz: bootstrap_look_up(): %ul\n", (unsigned long)kr);
+#endif
return EXIT_FAILURE;
}
}
diff --git a/hw/xquartz/pbproxy/app-main.m b/hw/xquartz/pbproxy/app-main.m
index b5748dace..cb0fa5744 100644
--- a/hw/xquartz/pbproxy/app-main.m
+++ b/hw/xquartz/pbproxy/app-main.m
@@ -34,6 +34,11 @@
#include <unistd.h> /*for getpid*/
#include <Cocoa/Cocoa.h>
+static const char *app_prefs_domain = "org.x.X11";
+CFStringRef app_prefs_domain_cfstr;
+
+char *display = NULL;
+
static void signal_handler (int sig) {
switch(sig) {
case SIGHUP:
@@ -50,6 +55,27 @@ int main (int argc, const char *argv[]) {
#endif
xpbproxy_is_standalone = YES;
+
+ if((s = getenv("X11_PREFS_DOMAIN")))
+ app_prefs_domain = s;
+
+ for (i = 1; i < argc; i++) {
+ if(strcmp (argv[i], "--prefs-domain") == 0 && i+1 < argc) {
+ app_prefs_domain = argv[++i];
+ } else if (strcmp (argv[i], "--help") == 0) {
+ printf("usage: xpbproxy OPTIONS\n"
+ "Pasteboard proxying for X11.\n\n"
+ "--prefs-domain <domain> Change the domain used for reading preferences\n"
+ " (default: org.x.X11)\n");
+ return 0;
+ } else {
+ fprintf(stderr, "usage: xpbproxy OPTIONS...\n"
+ "Try 'xpbproxy --help' for more information.\n");
+ return 1;
+ }
+ }
+
+ app_prefs_domain_cfstr = CFStringCreateWithCString(NULL, app_prefs_domain, kCFStringEncodingUTF8);
if(!xpbproxy_init())
return EXIT_FAILURE;
diff --git a/hw/xquartz/pbproxy/main.m b/hw/xquartz/pbproxy/main.m
index efa42e3a3..247ff7475 100644
--- a/hw/xquartz/pbproxy/main.m
+++ b/hw/xquartz/pbproxy/main.m
@@ -31,6 +31,7 @@
#import "x-selection.h"
#include <pthread.h>
+#include <unistd.h>
#include <X11/extensions/applewm.h>
Display *xpbproxy_dpy;
@@ -38,6 +39,8 @@ int xpbproxy_apple_wm_event_base, xpbproxy_apple_wm_error_base;
int xpbproxy_xfixes_event_base, xpbproxy_xfixes_error_base;
BOOL xpbproxy_have_xfixes;
+extern char *display;
+
#ifdef STANDALONE_XPBPROXY
BOOL xpbproxy_is_standalone = NO;
#endif
@@ -67,10 +70,24 @@ static int x_error_handler (Display *dpy, XErrorEvent *errevent) {
BOOL xpbproxy_init (void) {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-
- xpbproxy_dpy = XOpenDisplay (NULL);
+ size_t i;
+
+ for(i=0, xpbproxy_dpy=NULL; !xpbproxy_dpy && i<5; i++) {
+ xpbproxy_dpy = XOpenDisplay(NULL);
+
+ if(!xpbproxy_dpy && display) {
+ char _display[32];
+ snprintf(_display, sizeof(_display), ":%s", display);
+ setenv("DISPLAY", _display, TRUE);
+
+ xpbproxy_dpy=XOpenDisplay(_display);
+ }
+ if(!xpbproxy_dpy)
+ sleep(1);
+ }
+
if (xpbproxy_dpy == NULL) {
- fprintf (stderr, "can't open default display\n");
+ fprintf (stderr, "xpbproxy: can't open default display\n");
[pool release];
return FALSE;
}
@@ -80,7 +97,7 @@ BOOL xpbproxy_init (void) {
if (!XAppleWMQueryExtension (xpbproxy_dpy, &xpbproxy_apple_wm_event_base,
&xpbproxy_apple_wm_error_base)) {
- fprintf (stderr, "can't open AppleWM server extension\n");
+ fprintf (stderr, "xpbproxy: can't open AppleWM server extension\n");
[pool release];
return FALSE;
}
diff --git a/hw/xquartz/pbproxy/x-selection.m b/hw/xquartz/pbproxy/x-selection.m
index 960499557..cd540be98 100644
--- a/hw/xquartz/pbproxy/x-selection.m
+++ b/hw/xquartz/pbproxy/x-selection.m
@@ -97,12 +97,13 @@ dump_prefs (FILE *fp) {
}
#endif
-#define APP_PREFS "org.x.X11"
+extern CFStringRef app_prefs_domain_cfstr;
+
static BOOL
prefs_get_bool (CFStringRef key, BOOL defaultValue) {
Boolean value, ok;
- value = CFPreferencesGetAppBooleanValue (key, CFSTR (APP_PREFS), &ok);
+ value = CFPreferencesGetAppBooleanValue (key, app_prefs_domain_cfstr, &ok);
return ok ? (BOOL) value : defaultValue;
}
@@ -1425,7 +1426,7 @@ get_property(Window win, Atom property, struct propdata *pdata, Bool delete, Ato
* It's uncertain how we could handle the synchronization failing, so cast to void.
* The prefs_get_bool should fall back to defaults if the org.x.X11 plist doesn't exist or is invalid.
*/
- (void)CFPreferencesAppSynchronize(CFSTR(APP_PREFS));
+ (void)CFPreferencesAppSynchronize(app_prefs_domain_cfstr);
#ifdef STANDALONE_XPBPROXY
if(xpbproxy_is_standalone)
pbproxy_prefs.active = YES;
diff --git a/hw/xquartz/quartz.h b/hw/xquartz/quartz.h
index 8b04b798e..c5da4c510 100644
--- a/hw/xquartz/quartz.h
+++ b/hw/xquartz/quartz.h
@@ -54,20 +54,16 @@ typedef void (*InitInputProc)(int argc, char **argv);
* Cursor functions
*/
typedef Bool (*InitCursorProc)(ScreenPtr pScreen);
-typedef void (*CursorUpdateProc)(void);
/*
* Suspend and resume X11 activity
*/
typedef void (*SuspendScreenProc)(ScreenPtr pScreen);
typedef void (*ResumeScreenProc)(ScreenPtr pScreen, int x, int y);
-typedef void (*CaptureScreensProc)(void);
-typedef void (*ReleaseScreensProc)(void);
/*
* Screen state change support
*/
-typedef void (*ScreenChangedProc)(void);
typedef void (*AddPseudoramiXScreensProc)(int *x, int *y, int *width, int *height);
typedef void (*UpdateScreenProc)(ScreenPtr pScreen);
@@ -101,14 +97,10 @@ typedef struct _QuartzModeProcs {
InitInputProc InitInput;
InitCursorProc InitCursor;
- CursorUpdateProc CursorUpdate; // Not used if NULL
SuspendScreenProc SuspendScreen;
ResumeScreenProc ResumeScreen;
- CaptureScreensProc CaptureScreens; // Only called in fullscreen
- ReleaseScreensProc ReleaseScreens; // Only called in fullscreen
- ScreenChangedProc ScreenChanged;
AddPseudoramiXScreensProc AddPseudoramiXScreens;
UpdateScreenProc UpdateScreen;
diff --git a/hw/xquartz/quartzKeyboard.c b/hw/xquartz/quartzKeyboard.c
index 8aaa57025..1ee2382aa 100644
--- a/hw/xquartz/quartzKeyboard.c
+++ b/hw/xquartz/quartzKeyboard.c
@@ -77,143 +77,6 @@ enum {
#define UKEYSYM(u) ((u) | 0x01000000)
-#define AltMask Mod1Mask
-#define MetaMask Mod2Mask
-#define FunctionMask Mod3Mask
-
-#define UK(a) NoSymbol // unknown symbol
-
-static KeySym const next_to_x[256] = {
- NoSymbol, NoSymbol, NoSymbol, XK_KP_Enter,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- XK_BackSpace, XK_Tab, XK_Linefeed, NoSymbol,
- NoSymbol, XK_Return, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, XK_Escape,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- XK_space, XK_exclam, XK_quotedbl, XK_numbersign,
- XK_dollar, XK_percent, XK_ampersand, XK_apostrophe,
- XK_parenleft, XK_parenright, XK_asterisk, XK_plus,
- XK_comma, XK_minus, XK_period, XK_slash,
- XK_0, XK_1, XK_2, XK_3,
- XK_4, XK_5, XK_6, XK_7,
- XK_8, XK_9, XK_colon, XK_semicolon,
- XK_less, XK_equal, XK_greater, XK_question,
- XK_at, XK_A, XK_B, XK_C,
- XK_D, XK_E, XK_F, XK_G,
- XK_H, XK_I, XK_J, XK_K,
- XK_L, XK_M, XK_N, XK_O,
- XK_P, XK_Q, XK_R, XK_S,
- XK_T, XK_U, XK_V, XK_W,
- XK_X, XK_Y, XK_Z, XK_bracketleft,
- XK_backslash, XK_bracketright,XK_asciicircum, XK_underscore,
- XK_grave, XK_a, XK_b, XK_c,
- XK_d, XK_e, XK_f, XK_g,
- XK_h, XK_i, XK_j, XK_k,
- XK_l, XK_m, XK_n, XK_o,
- XK_p, XK_q, XK_r, XK_s,
- XK_t, XK_u, XK_v, XK_w,
- XK_x, XK_y, XK_z, XK_braceleft,
- XK_bar, XK_braceright, XK_asciitilde, XK_BackSpace,
-// 128
- NoSymbol, XK_Agrave, XK_Aacute, XK_Acircumflex,
- XK_Atilde, XK_Adiaeresis, XK_Aring, XK_Ccedilla,
- XK_Egrave, XK_Eacute, XK_Ecircumflex, XK_Ediaeresis,
- XK_Igrave, XK_Iacute, XK_Icircumflex, XK_Idiaeresis,
-// 144
- XK_ETH, XK_Ntilde, XK_Ograve, XK_Oacute,
- XK_Ocircumflex, XK_Otilde, XK_Odiaeresis, XK_Ugrave,
- XK_Uacute, XK_Ucircumflex, XK_Udiaeresis, XK_Yacute,
- XK_THORN, XK_mu, XK_multiply, XK_division,
-// 160
- XK_copyright, XK_exclamdown, XK_cent, XK_sterling,
- UK(fraction), XK_yen, UK(fhook), XK_section,
- XK_currency, XK_rightsinglequotemark,
- XK_leftdoublequotemark,
- XK_guillemotleft,
- XK_leftanglebracket,
- XK_rightanglebracket,
- UK(filigature), UK(flligature),
-// 176
- XK_registered, XK_endash, XK_dagger, XK_doubledagger,
- XK_periodcentered,XK_brokenbar, XK_paragraph, UK(bullet),
- XK_singlelowquotemark,
- XK_doublelowquotemark,
- XK_rightdoublequotemark,
- XK_guillemotright,
- XK_ellipsis, UK(permille), XK_notsign, XK_questiondown,
-// 192
- XK_onesuperior, XK_dead_grave, XK_dead_acute, XK_dead_circumflex,
- XK_dead_tilde, XK_dead_macron, XK_dead_breve, XK_dead_abovedot,
- XK_dead_diaeresis,
- XK_twosuperior, XK_dead_abovering,
- XK_dead_cedilla,
- XK_threesuperior,
- XK_dead_doubleacute,
- XK_dead_ogonek, XK_dead_caron,
-// 208
- XK_emdash, XK_plusminus, XK_onequarter, XK_onehalf,
- XK_threequarters,
- XK_agrave, XK_aacute, XK_acircumflex,
- XK_atilde, XK_adiaeresis, XK_aring, XK_ccedilla,
- XK_egrave, XK_eacute, XK_ecircumflex, XK_ediaeresis,
-// 224
- XK_igrave, XK_AE, XK_iacute, XK_ordfeminine,
- XK_icircumflex, XK_idiaeresis, XK_eth, XK_ntilde,
- XK_Lstroke, XK_Ooblique, XK_OE, XK_masculine,
- XK_ograve, XK_oacute, XK_ocircumflex, XK_otilde,
-// 240
- XK_odiaeresis, XK_ae, XK_ugrave, XK_uacute,
- XK_ucircumflex, XK_idotless, XK_udiaeresis, XK_ygrave,
- XK_lstroke, XK_ooblique, XK_oe, XK_ssharp,
- XK_thorn, XK_ydiaeresis, NoSymbol, NoSymbol,
- };
-
-#define MIN_SYMBOL 0xAC
-static KeySym const symbol_to_x[] = {
- XK_Left, XK_Up, XK_Right, XK_Down
- };
-static int const NUM_SYMBOL = sizeof(symbol_to_x) / sizeof(symbol_to_x[0]);
-
-#define MIN_FUNCKEY 0x20
-static KeySym const funckey_to_x[] = {
- XK_F1, XK_F2, XK_F3, XK_F4,
- XK_F5, XK_F6, XK_F7, XK_F8,
- XK_F9, XK_F10, XK_F11, XK_F12,
- XK_Insert, XK_Delete, XK_Home, XK_End,
- XK_Page_Up, XK_Page_Down, XK_F13, XK_F14,
- XK_F15
- };
-static int const NUM_FUNCKEY = sizeof(funckey_to_x) / sizeof(funckey_to_x[0]);
-
-typedef struct {
- KeySym normalSym;
- KeySym keypadSym;
-} darwinKeyPad_t;
-
-static darwinKeyPad_t const normal_to_keypad[] = {
- { XK_0, XK_KP_0 },
- { XK_1, XK_KP_1 },
- { XK_2, XK_KP_2 },
- { XK_3, XK_KP_3 },
- { XK_4, XK_KP_4 },
- { XK_5, XK_KP_5 },
- { XK_6, XK_KP_6 },
- { XK_7, XK_KP_7 },
- { XK_8, XK_KP_8 },
- { XK_9, XK_KP_9 },
- { XK_equal, XK_KP_Equal },
- { XK_asterisk, XK_KP_Multiply },
- { XK_plus, XK_KP_Add },
- { XK_comma, XK_KP_Separator },
- { XK_minus, XK_KP_Subtract },
- { XK_period, XK_KP_Decimal },
- { XK_slash, XK_KP_Divide }
-};
-
-static int const NUM_KEYPAD = sizeof(normal_to_keypad) / sizeof(normal_to_keypad[0]);
-
/* Table of keycode->keysym mappings we use to fallback on for important
keys that are often not in the Unicode mapping. */
@@ -733,24 +596,29 @@ Bool QuartzReadSystemKeymap(darwinKeyboardInfo *info) {
ErrorF("X11.app: Debug Info: keyboard_type=%u, currentKeyLayoutRef=%p, currentKeyLayoutDataRef=%p, chr_data=%p\n",
(unsigned)keyboard_type, currentKeyLayoutRef, currentKeyLayoutDataRef, chr_data);
#endif
+
KLGetCurrentKeyboardLayout (&key_layout);
KLGetKeyboardLayoutProperty (key_layout, kKLuchrData, &chr_data);
+#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
if(chr_data != NULL) {
ErrorF("X11.app: Fallback succeeded, but this is still a bug. Please report the above information.\n");
}
+#endif
}
if (chr_data == NULL) {
- ErrorF("X11.app: Debug Info: kKLuchrData fallback failed, trying kKLKCHRData.\n");
+ ErrorF("X11.app: Debug Info: kKLuchrData failed, trying kKLKCHRData.\n");
ErrorF("If you are using a 3rd party keyboard layout, please see http://xquartz.macosforge.org/trac/ticket/154\n");
KLGetKeyboardLayoutProperty (key_layout, kKLKCHRData, &chr_data);
is_uchr = 0;
num_keycodes = 128;
+#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
if(chr_data != NULL) {
ErrorF("X11.app: Fallback succeeded, but this is still a bug. Please report the above information.\n");
}
+#endif
}
#endif
diff --git a/hw/xquartz/xpr/xprScreen.c b/hw/xquartz/xpr/xprScreen.c
index a4ee30351..18406b89c 100644
--- a/hw/xquartz/xpr/xprScreen.c
+++ b/hw/xquartz/xpr/xprScreen.c
@@ -423,12 +423,8 @@ static QuartzModeProcsRec xprModeProcs = {
xprSetupScreen,
xprInitInput,
QuartzInitCursor,
- NULL, // No need to update cursor
QuartzSuspendXCursor,
QuartzResumeXCursor,
- NULL, // No capture or release in rootless mode
- NULL,
- NULL, // Xplugin sends screen change events directly
xprAddPseudoramiXScreens,
xprUpdateScreen,
xprIsX11Window,