xserver: Branch 'master' - 2 commits

Jeremy Huddleston jeremyhu at kemper.freedesktop.org
Fri Aug 29 20:55:34 PDT 2008


 hw/xquartz/X11Application.m           |    8 +++++---
 hw/xquartz/darwin.c                   |    2 --
 hw/xquartz/mach-startup/bundle-main.c |   19 +++++++++++++++++--
 miext/rootless/rootlessWindow.c       |   33 +++++++++++++++++++++++++++++++--
 4 files changed, 53 insertions(+), 9 deletions(-)

New commits:
commit 8abcc12fdd5bd9edc0288a1ab8f75e65ffcb8c71
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Fri Aug 29 20:55:25 2008 -0700

    XQuartz: Added debugging output to the crash log to help track down two crashes, since people don't often report their system.log spew.
    (cherry picked from commit aaf0f71db197526b6b866cc1b39fbdfe051879ef)

diff --git a/hw/xquartz/darwin.c b/hw/xquartz/darwin.c
index 559bc89..fb0a806 100644
--- a/hw/xquartz/darwin.c
+++ b/hw/xquartz/darwin.c
@@ -152,8 +152,6 @@ const int NUMFORMATS = sizeof(formats)/sizeof(formats[0]);
 #define XORG_RELEASE "?"
 #endif
 
-const char *__crashreporter_info__ = "X.Org X Server " XSERVER_VERSION " Build Date: " BUILD_DATE;
-
 void DDXRingBell(int volume, int pitch, int duration) {
   // FIXME -- make some noise, yo
 }
diff --git a/hw/xquartz/mach-startup/bundle-main.c b/hw/xquartz/mach-startup/bundle-main.c
index 0eb45d1..6f1704e 100644
--- a/hw/xquartz/mach-startup/bundle-main.c
+++ b/hw/xquartz/mach-startup/bundle-main.c
@@ -59,6 +59,18 @@ extern int noPanoramiXExtension;
 #define DEFAULT_STARTX "/usr/X11/bin/startx"
 #define DEFAULT_SHELL  "/bin/sh"
 
+#ifndef BUILD_DATE
+#define BUILD_DATE ""
+#endif
+#ifndef XSERVER_VERSION
+#define XSERVER_VERSION "?"
+#endif
+
+const int __crashreporter_info__len = 4096;
+const char *__crashreporter_info__base = "X.Org X Server " XSERVER_VERSION " Build Date: " BUILD_DATE;
+char __crashreporter_info__buf[4096];
+char *__crashreporter_info__ = __crashreporter_info__buf;
+
 #define DEBUG 1
 
 static int execute(const char *command);
@@ -389,7 +401,10 @@ int main(int argc, char **argv, char **envp) {
 
     // The server must not run the PanoramiX operations.
     noPanoramiXExtension = TRUE;
-    
+
+    /* Setup the initial crasherporter info */
+    strlcpy(__crashreporter_info__, __crashreporter_info__base, __crashreporter_info__len);
+
     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]);
@@ -397,7 +412,7 @@ int main(int argc, char **argv, char **envp) {
             listenOnly = TRUE;
         }
     }
-    
+
     mp = checkin_or_register(SERVER_BOOTSTRAP_NAME);
     if(mp == MACH_PORT_NULL) {
         fprintf(stderr, "NULL mach service: %s", SERVER_BOOTSTRAP_NAME);
diff --git a/miext/rootless/rootlessWindow.c b/miext/rootless/rootlessWindow.c
index d863e39..f9ae0ea 100644
--- a/miext/rootless/rootlessWindow.c
+++ b/miext/rootless/rootlessWindow.c
@@ -131,16 +131,45 @@ RootlessNativeWindowStateChanged (WindowPtr pWin, unsigned int state)
   pWin->rootlessUnhittable = winRec->is_offscreen;
 }
 
+#ifdef XQUARTZ
+#include <string.h>
+extern char *__crashreporter_info__;
+extern const char *__crashreporter_info__base;
+extern int __crashreporter_info__len;
+#endif
+
 void RootlessNativeWindowMoved (WindowPtr pWin) {
     xp_box bounds;
     int sx, sy, err;
     XID vlist[2];
     Mask mask;
     ClientPtr client, pClient;
-    RootlessWindowRec *winRec = WINREC(pWin);
+    RootlessWindowRec *winRec;
+
+#ifdef XQUARTZ
+    /* We're seeing a crash here, but I'm not sure what's causing it... so putting in some debugging */
+    snprintf(__crashreporter_info__, __crashreporter_info__len,
+             "%s\n\RootlessNativeWindowMoved debug data\npWin=%p\n",
+             __crashreporter_info__base, pWin);
+    ErrorF("RootlessNativeWindowMoved debug data\npWin=%p\n", pWin);
+#endif
+    
+    winRec = WINREC(pWin);
+
+#ifdef XQUARTZ
+    /* We're seeing a crash here, but I'm not sure what's causing it... so putting in some debugging */
+    snprintf(__crashreporter_info__, __crashreporter_info__len, "%swinRec=%p\nwinRec->wid=%d\n", __crashreporter_info__, winRec, winRec ? (int)winRec->wid : 0);
+    ErrorF("winRec=%p\nwinRec->wid=%d\n", winRec, winRec ? (int)winRec->wid : 0);
+#endif
     
     if (xp_get_window_bounds ((xp_window_id)winRec->wid, &bounds) != Success) return;
     
+#ifdef XQUARTZ
+    /* We're seeing a crash here, but I'm not sure what's causing it... so putting in some debugging */
+    snprintf(__crashreporter_info__, __crashreporter_info__len, "%spWin->drawable.pScreen=%p\npWin->drawable.pScreen->myNum=%d\n", __crashreporter_info__, pWin->drawable.pScreen, pWin->drawable.pScreen ? pWin->drawable.pScreen->myNum : 0);
+    ErrorF("pWin->drawable.pScreen=%p\npWin->drawable.pScreen->myNum=%d\n", pWin->drawable.pScreen, pWin->drawable.pScreen ? pWin->drawable.pScreen->myNum : 0);
+#endif
+    
     sx = dixScreenOrigins[pWin->drawable.pScreen->myNum].x + darwinMainScreenX;
     sy = dixScreenOrigins[pWin->drawable.pScreen->myNum].y + darwinMainScreenY;
     
@@ -153,7 +182,7 @@ void RootlessNativeWindowMoved (WindowPtr pWin) {
     /* pretend we're the owner of the window! */
     err = dixLookupClient(&pClient, pWin->drawable.id, NullClient, DixUnknownAccess);
     if(err != Success) {
-        ErrorF("RootlessNativeWindowMoved(): Failed to lookup window: 0x%x\n", pWin->drawable.id);
+        ErrorF("RootlessNativeWindowMoved(): Failed to lookup window: 0x%x\n", (unsigned int)pWin->drawable.id);
         return;
     }
     
commit aee19c7b5542aa147b89b1ae8340e9931d81729f
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Fri Aug 29 03:54:55 2008 -0700

    XQuartz: xp_is_symbolic_hotkey_event catches the input menu, but not our mainMenu, so we still need to do that the old way.
    (cherry picked from commit 25eccf12c89d73b8bce2c9be14841efb230acedc)

diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m
index 5b1d171..a1c09ef 100644
--- a/hw/xquartz/X11Application.m
+++ b/hw/xquartz/X11Application.m
@@ -244,13 +244,15 @@ static void message_kit_thread (SEL selector, NSObject *arg) {
                         for_x = NO;
                         DarwinSendDDXEvent(kXquartzToggleFullscreen, 0);
 #endif
-                    } else if(X11EnableKeyEquivalents &&
 #if XPLUGIN_VERSION >= 1
+                    } else if(X11EnableKeyEquivalents &&
                               xp_is_symbolic_hotkey_event([e eventRef])) {
-#else
+                        swallow_up = [e keyCode];
+                        for_x = NO;
+#endif
+                    } else if(X11EnableKeyEquivalents &&
                               [[self mainMenu] performKeyEquivalent:e]) {
                         for_appkit = NO;
-#endif
                         swallow_up = [e keyCode];
                         for_x = NO;
                     } else {


More information about the xorg-commit mailing list