From 339207be6f184cc783076fc7e2cc12f92f57f2ba Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Date: Thu, 25 Mar 2010 22:15:58 -0700 Subject: [PATCH 1/4] XQuartz: Workaround weird key data reported on some layouts This should make 'Unicode Hex Input' work as an input layout. Signed-off-by: Jeremy Huddleston Acked-by: Adam Jackson --- hw/xquartz/quartzKeyboard.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hw/xquartz/quartzKeyboard.c b/hw/xquartz/quartzKeyboard.c index c9ef7cc81..a4a0b08bd 100644 --- a/hw/xquartz/quartzKeyboard.c +++ b/hw/xquartz/quartzKeyboard.c @@ -735,7 +735,10 @@ Bool QuartzReadSystemKeymap(darwinKeyboardInfo *info) { if (err != noErr) continue; } - if (len > 0 && s[0] != 0x0010) { + /* Not sure why 0x0010 is there. + * 0x0000 - 'Unicode Hex Input' ... + */ + if (len > 0 && s[0] != 0x0010 && s[0] != 0x0000) { k[j] = ucs2keysym (s[0]); if (dead_key_state != 0) k[j] = make_dead_key (k[j]); } From 73b3b67aac9f3938a96cb8822b9c270bd82ded5c Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Date: Mon, 22 Mar 2010 09:30:51 -0700 Subject: [PATCH 2/4] GLX: Remove a redundant initialization Signed-off-by: Jeremy Huddleston Acked-by: Adam Jackson --- glx/indirect_dispatch.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/glx/indirect_dispatch.c b/glx/indirect_dispatch.c index 666551903..ecd2bc8de 100644 --- a/glx/indirect_dispatch.c +++ b/glx/indirect_dispatch.c @@ -98,8 +98,6 @@ void __glXDisp_CallLists(GLbyte * pc) const GLenum type = *(GLenum *)(pc + 4); const GLvoid * lists = (const GLvoid *)(pc + 8); - lists = (const GLvoid *) (pc + 8); - CALL_CallLists( GET_DISPATCH(), ( n, type, From 436d0bb9cca122bfdde32902b683d2499f61e6fc Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Date: Sat, 27 Mar 2010 17:35:10 -0700 Subject: [PATCH 3/4] darwin: Generate crash reports on FatalError() Signed-off-by: Jeremy Huddleston Acked-by: Adam Jackson --- hw/xquartz/GL/capabilities.c | 3 +-- hw/xquartz/darwin.c | 10 +++------- hw/xquartz/mach-startup/bundle-main.c | 11 ++++++----- os/log.c | 9 +++++++++ os/utils.c | 2 ++ 5 files changed, 21 insertions(+), 14 deletions(-) diff --git a/hw/xquartz/GL/capabilities.c b/hw/xquartz/GL/capabilities.c index 2c5ec658c..fc7dd57dd 100644 --- a/hw/xquartz/GL/capabilities.c +++ b/hw/xquartz/GL/capabilities.c @@ -525,8 +525,7 @@ bool getGlCapabilities(struct glCapabilities *cap) { conf = malloc(sizeof(*conf)); if(NULL == conf) { - perror("malloc"); - OsAbort(); + FatalError("Unable to allocate memory for OpenGL capabilities\n"); } /* Copy the struct. */ diff --git a/hw/xquartz/darwin.c b/hw/xquartz/darwin.c index 066f5a596..d3f448820 100644 --- a/hw/xquartz/darwin.c +++ b/hw/xquartz/darwin.c @@ -602,7 +602,7 @@ void InitOutput( ScreenInfo *pScreenInfo, int argc, char **argv ) /* - * OsVendorFataError + * OsVendorFatalError */ void OsVendorFatalError( void ) { @@ -760,7 +760,7 @@ void ddxUseMsg( void ) */ void ddxGiveUp( void ) { - ErrorF( "Quitting Xquartz...\n" ); + ErrorF( "Quitting Xquartz\n" ); } @@ -773,11 +773,7 @@ void ddxGiveUp( void ) void AbortDDX( void ) { ErrorF( " AbortDDX\n" ); - /* - * This is needed for a abnormal server exit, since the normal exit stuff - * MUST also be performed (i.e. the vt must be left in a defined state) - */ - ddxGiveUp(); + OsAbort(); } #include "mivalidate.h" // for union _Validate used by windowstr.h diff --git a/hw/xquartz/mach-startup/bundle-main.c b/hw/xquartz/mach-startup/bundle-main.c index 4872ff59b..625b8b4c2 100644 --- a/hw/xquartz/mach-startup/bundle-main.c +++ b/hw/xquartz/mach-startup/bundle-main.c @@ -73,10 +73,11 @@ extern int noPanoramiXExtension; #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; +static char __crashreporter_info_buff__[4096] = {0}; +static const char *__crashreporter_info__ = &__crashreporter_info_buff__[0]; +asm (".desc __crashreporter_info__, 0x10"); + +static const char *__crashreporter_info__base = "X.Org X Server " XSERVER_VERSION " Build Date: " BUILD_DATE; static char *launchd_id_prefix = NULL; static char *server_bootstrap_name = NULL; @@ -548,7 +549,7 @@ int main(int argc, char **argv, char **envp) { noPanoramiXExtension = TRUE; /* Setup the initial crasherporter info */ - strlcpy(__crashreporter_info__, __crashreporter_info__base, __crashreporter_info__len); + strlcpy(__crashreporter_info_buff__, __crashreporter_info__base, sizeof(__crashreporter_info_buff__)); fprintf(stderr, "X11.app: main(): argc=%d\n", argc); for(i=0; i < argc; i++) { diff --git a/os/log.c b/os/log.c index f4832c12f..c1301d754 100644 --- a/os/log.c +++ b/os/log.c @@ -117,6 +117,12 @@ static char *saveBuffer = NULL; static int bufferSize = 0, bufferUnused = 0, bufferPos = 0; static Bool needBuffer = TRUE; +#ifdef __APPLE__ +static char __crashreporter_info_buff__[4096] = {0}; +static const char *__crashreporter_info__ = &__crashreporter_info_buff__[0]; +asm (".desc __crashreporter_info__, 0x10"); +#endif + /* Prefix strings for log messages. */ #ifndef X_UNKNOWN_STRING #define X_UNKNOWN_STRING "(\?\?)" @@ -527,6 +533,9 @@ FatalError(const char *f, ...) ErrorF("\nFatal server error:\n"); va_start(args, f); +#ifdef __APPLE__ + (void)vsnprintf(__crashreporter_info_buff__, sizeof(__crashreporter_info_buff__), f, args); +#endif VErrorF(f, args); va_end(args); ErrorF("\n"); diff --git a/os/utils.c b/os/utils.c index 5a5a20374..13d3b3ff0 100644 --- a/os/utils.c +++ b/os/utils.c @@ -1315,7 +1315,9 @@ OsReleaseSignals (void) void OsAbort (void) { +#ifndef __APPLE__ OsBlockSignals(); +#endif abort(); } From 28a5f14b4089dccb8045cc4fdc923542a73dd22d Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Date: Sun, 28 Mar 2010 13:46:23 -0700 Subject: [PATCH 4/4] XQuartz: Re-query dixScreenOrigins as the value could've changed. Fix a regression in 9c9c3a85b094a3c7b2763a572715d710325091aa Signed-off-by: Jeremy Huddleston Acked-by: Adam Jackson --- hw/xquartz/quartz.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/hw/xquartz/quartz.c b/hw/xquartz/quartz.c index 59107be84..a611854e7 100644 --- a/hw/xquartz/quartz.c +++ b/hw/xquartz/quartz.c @@ -268,8 +268,11 @@ void QuartzUpdateScreens(void) { DarwinAdjustScreenOrigins(&screenInfo); quartzProcs->UpdateScreen(pScreen); - sx = x + darwinMainScreenX; - sy = y + darwinMainScreenY; + /* DarwinAdjustScreenOrigins or UpdateScreen may change dixScreenOrigins, + * so use it rather than x/y + */ + sx = dixScreenOrigins[pScreen->myNum].x + darwinMainScreenX; + sy = dixScreenOrigins[pScreen->myNum].y + darwinMainScreenY; /* Adjust the root window. */ pRoot = WindowTable[pScreen->myNum];