xserver: Branch 'master' - 3 commits

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jun 15 05:12:59 UTC 2022


 hw/xquartz/X11Application.m     |   13 +++++++++++--
 miext/rootless/rootlessScreen.c |    5 -----
 os/connection.c                 |   31 ++++++++++++++++++++++++++-----
 3 files changed, 37 insertions(+), 12 deletions(-)

New commits:
commit 83d0d911069d502232d719882cd1c5cd090defa1
Author: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
Date:   Sat Sep 10 22:32:56 2016 -0700

    os/connection: Improve abstraction for launchd secure sockets
    
    This changes away from hard-coding the /tmp/launch-* path to now
    supporting a generic <absolute path to unix socket>[.<screen>]
    format for $DISPLAY.
    
    cf-libxcb: d978a4f69b30b630f28d07f1003cf290284d24d8
    
    Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
    CC: Adam Jackson <ajax at kemper.freedesktop.org>

diff --git a/os/connection.c b/os/connection.c
index 9e8d47f6b..55f1cd32e 100644
--- a/os/connection.c
+++ b/os/connection.c
@@ -79,6 +79,8 @@ SOFTWARE.
 #include <stdio.h>
 #include <stdlib.h>
 
+#include <sys/stat.h>
+
 #ifndef WIN32
 #include <sys/socket.h>
 
@@ -989,15 +991,34 @@ MakeClientGrabPervious(ClientPtr client)
 void
 ListenOnOpenFD(int fd, int noxauth)
 {
-    char port[256];
+    char port[PATH_MAX];
     XtransConnInfo ciptr;
     const char *display_env = getenv("DISPLAY");
 
-    if (display_env && (strncmp(display_env, "/tmp/launch", 11) == 0)) {
-        /* Make the path the launchd socket if our DISPLAY is set right */
-        strcpy(port, display_env);
+    /* First check if display_env matches a <absolute path to unix socket>[.<screen number>] scheme (eg: launchd) */
+    if (display_env && display_env[0] == '/') {
+        struct stat sbuf;
+
+        strlcpy(port, display_env, sizeof(port));
+
+        /* If the path exists, we don't have do do anything else.
+         * If it doesn't, we need to check for a .<screen number> to strip off and recheck.
+         */
+        if (0 != stat(port, &sbuf)) {
+            char *dot = strrchr(port, '.');
+            if (dot) {
+                *dot = '\0';
+
+                if (0 != stat(port, &sbuf)) {
+                    display_env = NULL;
+                }
+            } else {
+                display_env = NULL;
+            }
+        }
     }
-    else {
+
+    if (!display_env) {
         /* Just some default so things don't break and die. */
         snprintf(port, sizeof(port), ":%d", atoi(display));
     }
commit b1afcecc61d841f95e786e4f4f84184f91d149f1
Author: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
Date:   Sun Jun 12 22:06:01 2022 -0700

    X11Application: Ensure TIS operations are done on the main thread
    
    Fixes: https://github.com/XQuartz/XQuartz/issues/205
    Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu at apple.com>

diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m
index 3db0b2487..a100f5a6f 100644
--- a/hw/xquartz/X11Application.m
+++ b/hw/xquartz/X11Application.m
@@ -1701,8 +1701,17 @@ handle_mouse:
     }
 
         if (darwinSyncKeymap) {
-            TISInputSourceRef key_layout = 
-                TISCopyCurrentKeyboardLayoutInputSource();
+            __block TISInputSourceRef key_layout;
+            dispatch_block_t copyCurrentKeyboardLayoutInputSource = ^{
+                key_layout = TISCopyCurrentKeyboardLayoutInputSource();
+            };
+            /* This is an ugly ant-pattern, but it is more expedient to address the problem right now. */
+            if (pthread_main_np()) {
+                copyCurrentKeyboardLayoutInputSource();
+            } else {
+                dispatch_sync(dispatch_get_main_queue(), copyCurrentKeyboardLayoutInputSource);
+            }
+
             TISInputSourceRef clear;
             if (CFEqual(key_layout, last_key_layout)) {
                 CFRelease(key_layout);
commit c11b55f3c0c64645bca964aece825de0bdd92b1f
Author: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
Date:   Fri Apr 23 02:15:30 2021 -0700

    rootless: Dead code removal (ROOTLESS_REDISPLAY_DELAY is already defined)
    
    Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu at apple.com>

diff --git a/miext/rootless/rootlessScreen.c b/miext/rootless/rootlessScreen.c
index a99a2d158..79fe3507b 100644
--- a/miext/rootless/rootlessScreen.c
+++ b/miext/rootless/rootlessScreen.c
@@ -51,11 +51,6 @@
 #include "rootlessCommon.h"
 #include "rootlessWindow.h"
 
-/* In milliseconds */
-#ifndef ROOTLESS_REDISPLAY_DELAY
-#define ROOTLESS_REDISPLAY_DELAY 10
-#endif
-
 extern int RootlessMiValidateTree(WindowPtr pRoot, WindowPtr pChild,
                                   VTKind kind);
 extern Bool RootlessCreateGC(GCPtr pGC);


More information about the xorg-commit mailing list