diff options
Diffstat (limited to 'hw/xquartz')
-rw-r--r-- | hw/xquartz/bundle/Info.plist.cpp | 4 | ||||
-rw-r--r-- | hw/xquartz/console_redirect.c | 28 | ||||
-rw-r--r-- | hw/xquartz/xpr/xprEvent.c | 22 |
3 files changed, 41 insertions, 13 deletions
diff --git a/hw/xquartz/bundle/Info.plist.cpp b/hw/xquartz/bundle/Info.plist.cpp index 4b6d9d182..460047cc2 100644 --- a/hw/xquartz/bundle/Info.plist.cpp +++ b/hw/xquartz/bundle/Info.plist.cpp @@ -19,9 +19,9 @@ <key>CFBundlePackageType</key> <string>APPL</string> <key>CFBundleShortVersionString</key> - <string>2.7.2</string> + <string>2.7.3</string> <key>CFBundleVersion</key> - <string>2.7.2</string> + <string>2.7.3</string> <key>CFBundleSignature</key> <string>x11a</string> <key>CSResourcesFileMapped</key> diff --git a/hw/xquartz/console_redirect.c b/hw/xquartz/console_redirect.c index 91d693b67..8fdce4699 100644 --- a/hw/xquartz/console_redirect.c +++ b/hw/xquartz/console_redirect.c @@ -110,27 +110,33 @@ _read_redirect(int fd, int flush) /* Increment our returned number read */ total_read += nbytes; - nbytes += (aslr->w - aslr->buf); - aslr->buf[nbytes] = '\0'; + /* Increment our write location */ + aslr->w += nbytes; + aslr->w[0] = '\0'; /* One line at a time */ - for (p = aslr->buf; *p && (p - aslr->buf) < nbytes; p = s + 1) { + for (p = aslr->buf; p < aslr->w; p = s + 1) { // Find null or \n for (s = p; *s && *s != '\n'; s++) ; if (*s == '\n') { *s = '\0'; + } + + if (s < aslr->w || aslr->buf == p) { + /* Either the first of multiple messages or one message which is larger than our buffer */ asl_log(aslr->asl, aslr->msg, aslr->level, "%s", p); } - else if (aslr->buf != p) { + else { + /* We reached the end of the buffer, move this chunk to the start. */ memmove(aslr->buf, p, BUF_SIZE - (p - aslr->buf)); aslr->w = aslr->buf + (s - p); break; } - else if (nbytes == BUF_SIZE - 1) { - asl_log(aslr->asl, aslr->msg, aslr->level, "%s", p); - aslr->w = aslr->buf; - break; - } + } + + if (p == aslr->w) { + /* Start writing at the beginning in the case where we flushed */ + aslr->w = aslr->buf; } } @@ -359,8 +365,8 @@ xq_asl_log_fd(aslclient asl, aslmsg msg, int level, int fd) BLOCK_DONE; } redirect_fds = new_array; - memset(redirect_fds + n_redirect_fds, 0, new_n - - n_redirect_fds); + memset(redirect_fds + n_redirect_fds, 0, (new_n - + n_redirect_fds) * sizeof(*redirect_fds)); n_redirect_fds = new_n; } diff --git a/hw/xquartz/xpr/xprEvent.c b/hw/xquartz/xpr/xprEvent.c index 106a91931..398177ca8 100644 --- a/hw/xquartz/xpr/xprEvent.c +++ b/hw/xquartz/xpr/xprEvent.c @@ -52,6 +52,10 @@ #include <sys/uio.h> #include <unistd.h> +#ifdef HAVE_LIBDISPATCH +#include <dispatch/dispatch.h> +#endif + #include "rootlessWindow.h" #include "xprEvent.h" @@ -72,7 +76,25 @@ QuartzModeEventHandler(int screenNum, XQuartzEvent *e, DeviceIntPtr dev) case kXquartzBringAllToFront: DEBUG_LOG("kXquartzBringAllToFront\n"); + /* There's no need to do xp_window_bring_all_to_front on Leopard, + * and we don't care about the result, so just do it async. + */ +#if defined(HAVE_LIBDISPATCH) && defined(XPLUGIN_VERSION) && XPLUGIN_VERSION >= 6 +# if defined(XPLUGIN_VERSION_MIN_REQUIRED) && XPLUGIN_VERSION_MIN_REQUIRED < 6 + if (&xp_window_bring_all_to_front) { +# endif + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ + xp_window_bring_all_to_front(); + }); +# if defined(XPLUGIN_VERSION_MIN_REQUIRED) && XPLUGIN_VERSION_MIN_REQUIRED < 6 + } else { + RootlessOrderAllWindows(e->data[0]); + } +# endif +#else RootlessOrderAllWindows(e->data[0]); +#endif + return TRUE; default: |