[Xquartz-changes] xserver: Branch 'server-1.6-apple' - 2 commits
Jeremy Huddleston
jeremyhu at freedesktop.org
Sun Nov 15 11:03:57 PST 2009
hw/xquartz/X11Controller.h | 4 ++++
hw/xquartz/pbproxy/app-main.m | 4 ++++
hw/xquartz/pbproxy/main.m | 16 ++++++++++++++++
hw/xquartz/quartzKeyboard.c | 1 +
4 files changed, 25 insertions(+)
New commits:
commit e6f29318481f746232ba51f8d7db0e0926f5eeef
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date: Tue Oct 27 17:16:57 2009 -0700
XQuartz: pbproxy: Wait for the server to finish starting up, so display is valid.
Signed-off-by: Jeremy Huddleston <jeremyhu at freedesktop.org>
(cherry picked from commit e87a03fd531ce7974877688680d3bf9b85c2d835)
diff --git a/hw/xquartz/pbproxy/app-main.m b/hw/xquartz/pbproxy/app-main.m
index d4b43c6..f3f683a 100644
--- a/hw/xquartz/pbproxy/app-main.m
+++ b/hw/xquartz/pbproxy/app-main.m
@@ -37,7 +37,11 @@
static const char *app_prefs_domain = "org.x.X11";
CFStringRef app_prefs_domain_cfstr;
+/* Stubs */
char *display = NULL;
+BOOL serverInitComplete = YES;
+pthread_mutex_t serverInitCompleteMutex = PTHREAD_MUTEX_INITIALIZER;
+pthread_cond_t serverInitCompleteCond = PTHREAD_COND_INITIALIZER;
static void signal_handler (int sig) {
switch(sig) {
diff --git a/hw/xquartz/pbproxy/main.m b/hw/xquartz/pbproxy/main.m
index 5bc5182..d26b1b1 100644
--- a/hw/xquartz/pbproxy/main.m
+++ b/hw/xquartz/pbproxy/main.m
@@ -47,6 +47,20 @@ BOOL xpbproxy_is_standalone = NO;
x_selection *_selection_object;
+extern BOOL serverInitComplete;
+extern pthread_mutex_t serverInitCompleteMutex;
+extern pthread_cond_t serverInitCompleteCond;
+
+static inline void wait_for_server_init(void) {
+ /* If the server hasn't finished initializing, wait for it... */
+ if(!serverInitComplete) {
+ pthread_mutex_lock(&serverInitCompleteMutex);
+ while(!serverInitComplete)
+ pthread_cond_wait(&serverInitCompleteCond, &serverInitCompleteMutex);
+ pthread_mutex_unlock(&serverInitCompleteMutex);
+ }
+}
+
static int x_io_error_handler (Display *dpy) {
/* We lost our connection to the server. */
@@ -85,6 +99,8 @@ static void *xpbproxy_x_thread(void *args) {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
size_t i;
+ wait_for_server_init();
+
for(i=0, xpbproxy_dpy=NULL; !xpbproxy_dpy && i<5; i++) {
xpbproxy_dpy = XOpenDisplay(NULL);
commit c710a6a79d7c8c1575423bcb73930c1e5bfebabd
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date: Sun Nov 8 20:25:42 2009 -0800
XQuartz: Buildfix for Leopard and older
Signed-off-by: Jeremy Huddleston <jeremyhu at freedesktop.org>
(cherry picked from commit 15fc56addcc906592af7c0f4c0a5ac906fa5c389)
diff --git a/hw/xquartz/X11Controller.h b/hw/xquartz/X11Controller.h
index bb28447..9e16f75 100644
--- a/hw/xquartz/X11Controller.h
+++ b/hw/xquartz/X11Controller.h
@@ -55,7 +55,11 @@ typedef unsigned int NSUInteger;
#endif
#endif
+#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
@interface X11Controller : NSObject <NSTableViewDataSource>
+#else
+ at interface X11Controller : NSObject
+#endif
{
IBOutlet NSPanel *prefs_panel;
diff --git a/hw/xquartz/quartzKeyboard.c b/hw/xquartz/quartzKeyboard.c
index f4cf0e9..5dabdbe 100644
--- a/hw/xquartz/quartzKeyboard.c
+++ b/hw/xquartz/quartzKeyboard.c
@@ -40,6 +40,7 @@
#define HACK_MISSING 1
#define HACK_KEYPAD 1
+#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
More information about the Xquartz-changes
mailing list