xserver: Branch 'master' - 5 commits

Adam Jackson ajax at kemper.freedesktop.org
Tue Sep 13 20:14:38 UTC 2016


 Xext/shm.c                     |    3 ++-
 hw/xquartz/X11Application.m    |    9 +++++++++
 hw/xquartz/darwin.c            |   17 +++++++++++------
 hw/xquartz/pbproxy/Makefile.am |    5 ++---
 os/inputthread.c               |   15 +++++++++++++--
 5 files changed, 37 insertions(+), 12 deletions(-)

New commits:
commit 065eb6612492bacf4d7caaad90e35dafc2cbf7ea
Author: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
Date:   Sun Sep 11 19:56:52 2016 -0700

    os/inputthread: Fix setting of cloexec on file descriptors
    
    O_CLOEXEC is not a file bit.  It is not setable with F_SETFL.  One must
    use it when calling open(2).  To set it cloexec on an existing fd,
    F_SETFD and FD_CLOEXEC must be used.
    
    This also fixes a build failure regression on configurations that don't
    have O_CLOEXEC defined.
    
    cf: http://pubs.opengroup.org/onlinepubs/9699919799/functions/fcntl.html
    Regressed-in: 30ac7567980a1eb79d084a63e0e74e1d9a3af673
    
    Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
    Reviewed-by: Julien Cristau <jcristau at debian.org>

diff --git a/os/inputthread.c b/os/inputthread.c
index 1cd1c2a..6b379f5 100644
--- a/os/inputthread.c
+++ b/os/inputthread.c
@@ -379,6 +379,7 @@ void
 InputThreadPreInit(void)
 {
     int fds[2], hotplugPipe[2];
+    int flags;
 
     if (!InputThreadEnable)
         return;
@@ -402,13 +403,23 @@ InputThreadPreInit(void)
      * in parallel.
      */
     inputThreadInfo->readPipe = fds[0];
-    fcntl(inputThreadInfo->readPipe, F_SETFL, O_NONBLOCK | O_CLOEXEC);
+    fcntl(inputThreadInfo->readPipe, F_SETFL, O_NONBLOCK);
+    flags = fcntl(inputThreadInfo->readPipe, F_GETFD);
+    if (flags != -1) {
+        flags |= FD_CLOEXEC;
+        (void)fcntl(inputThreadInfo->readPipe, F_SETFD, &flags);
+    }
     SetNotifyFd(inputThreadInfo->readPipe, InputThreadNotifyPipe, X_NOTIFY_READ, NULL);
 
     inputThreadInfo->writePipe = fds[1];
 
     hotplugPipeRead = hotplugPipe[0];
-    fcntl(hotplugPipeRead, F_SETFL, O_NONBLOCK | O_CLOEXEC);
+    fcntl(hotplugPipeRead, F_SETFL, O_NONBLOCK);
+    flags = fcntl(hotplugPipeRead, F_GETFD);
+    if (flags != -1) {
+        flags |= FD_CLOEXEC;
+        (void)fcntl(hotplugPipeRead, F_SETFD, &flags);
+    }
     hotplugPipeWrite = hotplugPipe[1];
 
 }
commit a5769de0f5399053e9864b753fa9755220d65ae0
Author: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
Date:   Sun Sep 11 19:47:47 2016 -0700

    Xext/shm: Fix usage of F_GETFD to match standard
    
    flags = fcntl(fd, F_GETFD) is compliant.
    
    fcntl(fd, F_GETFD, &flags) is non-compliant (Linux extension?)
    
    cf: http://pubs.opengroup.org/onlinepubs/9699919799/functions/fcntl.html
    
    Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
    Reviewed-by: Julien Cristau <jcristau at debian.org>

diff --git a/Xext/shm.c b/Xext/shm.c
index 0557538..125000f 100644
--- a/Xext/shm.c
+++ b/Xext/shm.c
@@ -1213,7 +1213,8 @@ shm_tmpfile(void)
 	if (fd < 0)
 		return -1;
 	unlink(template);
-	if (fcntl(fd, F_GETFD, &flags) >= 0) {
+	flags = fcntl(fd, F_GETFD);
+	if (flags != -1) {
 		flags |= FD_CLOEXEC;
 		(void) fcntl(fd, F_SETFD, &flags);
 	}
commit 7def2fea30060d47780dc1eedc91fada5ae1934f
Author: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
Date:   Sat Sep 10 23:37:46 2016 -0700

    Xquartz: Update for removal of AddEnabledDevice and RemoveEnabledDevice
    
    Regressed-in: be5a513fee6cbf29ef7570e57eb0436d70fbd88c
    Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu at apple.com>

diff --git a/hw/xquartz/darwin.c b/hw/xquartz/darwin.c
index 3403436..c0d0b8a 100644
--- a/hw/xquartz/darwin.c
+++ b/hw/xquartz/darwin.c
@@ -303,6 +303,11 @@ DarwinScreenInit(ScreenPtr pScreen, int argc, char **argv)
    =============================================================================
  */
 
+static void
+DarwinInputHandlerNotify(int fd __unused, int ready __unused, void *data __unused)
+{
+}
+
 /*
  * DarwinMouseProc: Handle the initialization, etc. of a mouse
  */
@@ -362,13 +367,13 @@ DarwinMouseProc(DeviceIntPtr pPointer, int what)
 
     case DEVICE_ON:
         pPointer->public.on = TRUE;
-        AddEnabledDevice(darwinEventReadFD);
+        SetNotifyFd(darwinEventReadFD, DarwinInputHandlerNotify, X_NOTIFY_READ, NULL);
         return Success;
 
     case DEVICE_CLOSE:
     case DEVICE_OFF:
         pPointer->public.on = FALSE;
-        RemoveEnabledDevice(darwinEventReadFD);
+        RemoveNotifyFd(darwinEventReadFD);
         return Success;
     }
 
@@ -431,13 +436,13 @@ DarwinTabletProc(DeviceIntPtr pPointer, int what)
 
     case DEVICE_ON:
         pPointer->public.on = TRUE;
-        AddEnabledDevice(darwinEventReadFD);
+        SetNotifyFd(darwinEventReadFD, DarwinInputHandlerNotify, X_NOTIFY_READ, NULL);
         return Success;
 
     case DEVICE_CLOSE:
     case DEVICE_OFF:
         pPointer->public.on = FALSE;
-        RemoveEnabledDevice(darwinEventReadFD);
+        RemoveNotifyFd(darwinEventReadFD);
         return Success;
     }
     return Success;
@@ -459,12 +464,12 @@ DarwinKeybdProc(DeviceIntPtr pDev, int onoff)
 
     case DEVICE_ON:
         pDev->public.on = TRUE;
-        AddEnabledDevice(darwinEventReadFD);
+        SetNotifyFd(darwinEventReadFD, DarwinInputHandlerNotify, X_NOTIFY_READ, NULL);
         break;
 
     case DEVICE_OFF:
         pDev->public.on = FALSE;
-        RemoveEnabledDevice(darwinEventReadFD);
+        RemoveNotifyFd(darwinEventReadFD);
         break;
 
     case DEVICE_CLOSE:
commit 4f4ecd0f41cf1c710d3ef1626b747847e6184f4c
Author: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
Date:   Sat Sep 10 22:16:11 2016 -0700

    XQuartz: Cleanup CPPFLAGS that are no longer necessary on darwin
    
    Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu at apple.com>

diff --git a/hw/xquartz/pbproxy/Makefile.am b/hw/xquartz/pbproxy/Makefile.am
index 1b14dff..9429ea2 100644
--- a/hw/xquartz/pbproxy/Makefile.am
+++ b/hw/xquartz/pbproxy/Makefile.am
@@ -1,7 +1,6 @@
-AM_CPPFLAGS=-F/System/Library/Frameworks/ApplicationServices.framework/Frameworks \
-	-DBUNDLE_ID_PREFIX=\"$(BUNDLE_ID_PREFIX)\"
+AM_CPPFLAGS=-DBUNDLE_ID_PREFIX=\"$(BUNDLE_ID_PREFIX)\"
 
-AM_CFLAGS=$(XPBPROXY_CFLAGS) 
+AM_CFLAGS=$(XPBPROXY_CFLAGS)
 AM_OBJCFLAGS=$(XPBPROXY_CFLAGS)
 
 noinst_LTLIBRARIES = libxpbproxy.la
commit 33d595255d4206df0d136014de33100817cbe344
Author: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
Date:   Sun May 29 14:01:38 2016 -0700

    XQuartz: Fix the issue where the h key could be come "stuck" after hiding XQuartz with cmd-h
    
    The issue was that we set a flag to ignore the k key's up event when sent
    the cmd-h down event, but because the cmd-h keycode hides XQuartz, we
    became !_x_active by the time the event is delivered which caused us to
    go down a differnet codepath rather than getting a chance to ignore it.
    We then incorrectly ignored the next h up key.
    
    https://bugs.freedesktop.org/show_bug.cgi?id=92648
    
    Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu at apple.com>

diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m
index d2c5d30..9a22909 100644
--- a/hw/xquartz/X11Application.m
+++ b/hw/xquartz/X11Application.m
@@ -366,6 +366,15 @@ message_kit_thread(SEL selector, NSObject *arg)
                 else {
                     /* No kit window is focused, so send it to X. */
                     for_appkit = NO;
+
+                    /* Reset our swallow state if we're seeing the same keyCode again.
+                     * This can happen if we become !_x_active when the keyCode we
+                     * intended to swallow is delivered.  See:
+                     * https://bugs.freedesktop.org/show_bug.cgi?id=92648
+                     */
+                    if ([e keyCode] == swallow_keycode) {
+                        do_swallow = NO;
+                    }
                 }
             }
             else {       /* KeyUp */


More information about the xorg-commit mailing list