xserver: Branch 'master' - 6 commits

Keith Packard keithp at kemper.freedesktop.org
Tue Mar 25 16:10:24 PDT 2014


 include/opaque.h |    1 +
 include/os.h     |    6 +++---
 include/xkbsrv.h |    3 +++
 os/connection.c  |   41 +++++++++++++++++++++++++++++++++++------
 os/utils.c       |    4 ++--
 test/Makefile.am |    1 -
 xkb/xkbUtils.c   |    6 ++++++
 7 files changed, 50 insertions(+), 12 deletions(-)

New commits:
commit bda6fdc71c25b0c3f3747f445103a1995a5713f4
Merge: e46820f 78167a9
Author: Keith Packard <keithp at keithp.com>
Date:   Tue Mar 25 16:06:03 2014 -0700

    Merge remote-tracking branch 'whot/for-keith'

commit 78167a98a8631ee3fad145ddc051ceb8487b9683
Author: Adam Jackson <ajax at redhat.com>
Date:   Fri Nov 8 09:44:24 2013 -0500

    xkb: Restore XkbCopyDeviceKeymap
    
    Removed in d35a02a767017f13db4bd4742eef49293d5a30ea, tigervnc 1.2.80 and
    xf86-video-nested need it for now.
    
    Signed-off-by: Adam Jackson <ajax at redhat.com>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/include/xkbsrv.h b/include/xkbsrv.h
index a80e119..229de21 100644
--- a/include/xkbsrv.h
+++ b/include/xkbsrv.h
@@ -824,6 +824,9 @@ extern _X_EXPORT void XkbSendNewKeyboardNotify(DeviceIntPtr /* kbd */ ,
 extern Bool XkbCopyKeymap(XkbDescPtr /* dst */ ,
                           XkbDescPtr /* src */ );
 
+extern _X_EXPORT Bool XkbCopyDeviceKeymap(DeviceIntPtr /* dst */,
+					  DeviceIntPtr /* src */);
+
 extern _X_EXPORT Bool XkbDeviceApplyKeymap(DeviceIntPtr /* dst */ ,
                                            XkbDescPtr /* src */ );
 
diff --git a/xkb/xkbUtils.c b/xkb/xkbUtils.c
index 6cf6e79..c14a790 100644
--- a/xkb/xkbUtils.c
+++ b/xkb/xkbUtils.c
@@ -2027,6 +2027,12 @@ XkbDeviceApplyKeymap(DeviceIntPtr dst, XkbDescPtr desc)
     return ret;
 }
 
+Bool
+XkbCopyDeviceKeymap(DeviceIntPtr dst, DeviceIntPtr src)
+{
+    return XkbDeviceApplyKeymap(dst, src->key->xkbInfo->desc);
+}
+
 int
 XkbGetEffectiveGroup(XkbSrvInfoPtr xkbi, XkbStatePtr xkbState, CARD8 keycode)
 {
commit 215f3d2e0f2a4ef6fc2f2c08fb991e1f00b747c8
Author: Kristian Høgsberg <krh at bitplanet.net>
Date:   Wed Mar 19 20:46:41 2014 -0700

    os: Add AddClientOnOpenFD() to create a new client for an file descriptor
    
    When the Xwayland server is socket-activated, we need to connect and
    initialize the window manager before the activating client gets to
    proceed with connecting.  We do this by passing a socket file
    descriptor for the window manager connection to the Xwayland server,
    which then uses this new function to set it up as an X client.
    
    Signed-off-by: Kristian Høgsberg <krh at bitplanet.net>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/include/os.h b/include/os.h
index 90229e6..d26e399 100644
--- a/include/os.h
+++ b/include/os.h
@@ -168,6 +168,8 @@ extern _X_EXPORT void MakeClientGrabPervious(ClientPtr /*client */ );
 
 extern _X_EXPORT void ListenOnOpenFD(int /* fd */ , int /* noxauth */ );
 
+extern _X_EXPORT Bool AddClientOnOpenFD(int /* fd */ );
+
 extern _X_EXPORT CARD32 GetTimeInMillis(void);
 extern _X_EXPORT CARD64 GetTimeInMicros(void);
 
diff --git a/os/connection.c b/os/connection.c
index b50f9e9..b3640b8 100644
--- a/os/connection.c
+++ b/os/connection.c
@@ -1312,3 +1312,30 @@ ListenOnOpenFD(int fd, int noxauth)
     XdmcpReset();
 #endif
 }
+
+/* based on TRANS(SocketUNIXAccept) (XtransConnInfo ciptr, int *status) */
+Bool
+AddClientOnOpenFD(int fd)
+{
+    XtransConnInfo ciptr;
+    CARD32 connect_time;
+    char port[20];
+
+    snprintf(port, sizeof(port), ":%d", atoi(display));
+    ciptr = _XSERVTransReopenCOTSServer(5, fd, port);
+    if (ciptr == NULL)
+        return FALSE;
+
+    _XSERVTransSetOption(ciptr, TRANS_NONBLOCKING, 1);
+    ciptr->flags |= TRANS_NOXAUTH;
+
+    connect_time = GetTimeInMillis();
+
+    if (!AllocNewConnection(ciptr, fd, connect_time)) {
+        ErrorConnMax(ciptr);
+        _XSERVTransClose(ciptr);
+        return FALSE;
+    }
+
+    return TRUE;
+}
commit 44fe1b8ea284df6bbaef67e246016d104665b2fe
Author: Kristian Høgsberg <krh at bitplanet.net>
Date:   Wed Mar 19 14:03:13 2014 -0700

    os: Add a mechanism to prevent creating any listen sockets
    
    A socket-activated server will receive its listening sockets from the
    parent process and should not create its own sockets.  This patch
    introduces a NoListen flag that can be set by a DDX to prevent
    the server from creating the sockets.  When NoListen is enabled, we
    also disable the server lock checking, since the parent process is
    responsible for checking the lock before picking the display name and
    creating the sockets.
    
    Signed-off-by: Kristian Høgsberg <krh at bitplanet.net>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>

diff --git a/include/opaque.h b/include/opaque.h
index 73d40c3..7ec1d85 100644
--- a/include/opaque.h
+++ b/include/opaque.h
@@ -74,5 +74,6 @@ extern _X_EXPORT Bool whiteRoot;
 extern _X_EXPORT Bool bgNoneRoot;
 
 extern _X_EXPORT Bool CoreDump;
+extern _X_EXPORT Bool NoListenAll;
 
 #endif                          /* OPAQUE_H */
diff --git a/os/connection.c b/os/connection.c
index 400c542..b50f9e9 100644
--- a/os/connection.c
+++ b/os/connection.c
@@ -138,6 +138,7 @@ fd_set OutputPending;           /* clients with reply/event data ready to go */
 int MaxClients = 0;
 Bool NewOutputPending;          /* not yet attempted to write some new output */
 Bool AnyClientsWriteBlocked;    /* true if some client blocked on write */
+Bool NoListenAll;               /* Don't establish any listening sockets */
 
 static Bool RunFromSmartParent; /* send SIGUSR1 to parent process */
 Bool RunFromSigStopParent;      /* send SIGSTOP to our own process; Upstart (or
@@ -406,7 +407,10 @@ CreateWellKnownSockets(void)
     /* display is initialized to "0" by main(). It is then set to the display
      * number if specified on the command line, or to NULL when the -displayfd
      * option is used. */
-    if (display) {
+    if (NoListenAll) {
+        ListenTransCount = 0;
+    }
+    else if (display) {
         if (TryCreateSocket(atoi(display), &partial) &&
             ListenTransCount >= 1)
             if (!PartialNetwork && partial)
@@ -440,9 +444,10 @@ CreateWellKnownSockets(void)
             DefineSelf (fd);
     }
 
-    if (!XFD_ANYSET(&WellKnownConnections))
+    if (!XFD_ANYSET(&WellKnownConnections) && !NoListenAll)
         FatalError
             ("Cannot establish any listening sockets - Make sure an X server isn't already running");
+
 #if !defined(WIN32)
     OsSignal(SIGPIPE, SIG_IGN);
     OsSignal(SIGHUP, AutoResetServer);
diff --git a/os/utils.c b/os/utils.c
index 497779b..c513968 100644
--- a/os/utils.c
+++ b/os/utils.c
@@ -270,7 +270,7 @@ LockServer(void)
     int len;
     char port[20];
 
-    if (nolock)
+    if (nolock || NoListenAll)
         return;
     /*
      * Path names
@@ -390,7 +390,7 @@ LockServer(void)
 void
 UnlockServer(void)
 {
-    if (nolock)
+    if (nolock || NoListenAll)
         return;
 
     if (!StillLocking) {
commit 62d584d63190c6c8cef5fd49d87b1cb29358a434
Author: Kristian Høgsberg <krh at bitplanet.net>
Date:   Tue Mar 18 22:05:58 2014 -0700

    os: Always compile ListenOnOpenFD() and export it
    
    This function was written to allow the X server to inherit the listen
    socket from launchd on OS X.  The code is not specific to OS X though
    and will be useful for on-demand launched Xwayland servers.
    
    Signed-off-by: Kristian Høgsberg <krh at bitplanet.net>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>

diff --git a/include/os.h b/include/os.h
index e5f86d6..90229e6 100644
--- a/include/os.h
+++ b/include/os.h
@@ -166,9 +166,7 @@ extern _X_EXPORT void MakeClientGrabImpervious(ClientPtr /*client */ );
 
 extern _X_EXPORT void MakeClientGrabPervious(ClientPtr /*client */ );
 
-#ifdef XQUARTZ
-extern void ListenOnOpenFD(int /* fd */ , int /* noxauth */ );
-#endif
+extern _X_EXPORT void ListenOnOpenFD(int /* fd */ , int /* noxauth */ );
 
 extern _X_EXPORT CARD32 GetTimeInMillis(void);
 extern _X_EXPORT CARD64 GetTimeInMicros(void);
diff --git a/os/connection.c b/os/connection.c
index ddf4f0a..400c542 100644
--- a/os/connection.c
+++ b/os/connection.c
@@ -1253,8 +1253,7 @@ MakeClientGrabPervious(ClientPtr client)
     }
 }
 
-#ifdef XQUARTZ
-/* Add a fd (from launchd) to our listeners */
+/* Add a fd (from launchd or similar) to our listeners */
 void
 ListenOnOpenFD(int fd, int noxauth)
 {
@@ -1276,7 +1275,7 @@ ListenOnOpenFD(int fd, int noxauth)
      */
     ciptr = _XSERVTransReopenCOTSServer(5, fd, port);
     if (ciptr == NULL) {
-        ErrorF("Got NULL while trying to Reopen launchd port.\n");
+        ErrorF("Got NULL while trying to Reopen listen port.\n");
         return;
     }
 
@@ -1308,5 +1307,3 @@ ListenOnOpenFD(int fd, int noxauth)
     XdmcpReset();
 #endif
 }
-
-#endif
commit 797781c7bfd7a0df354fb85aa73df4560828b90b
Author: Kristian Høgsberg <krh at bitplanet.net>
Date:   Wed Mar 19 10:27:39 2014 -0700

    test: Don't add TEST_LDADD to list test
    
    The list test case is always enabled, even if Xorg is disabled.
    TEST_LDADD pulls in Xorg files which breaks linking when Xorg is disabled.
    The list test doesn't need any libraries, so just remove list_LDADD.
    
    Signed-off-by: Kristian Høgsberg <krh at bitplanet.net>
    Cc: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/test/Makefile.am b/test/Makefile.am
index f8aa659..88fb6aa 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -30,7 +30,6 @@ endif
 xkb_LDADD=$(TEST_LDADD)
 input_LDADD=$(TEST_LDADD)
 xtest_LDADD=$(TEST_LDADD)
-list_LDADD=$(TEST_LDADD)
 misc_LDADD=$(TEST_LDADD)
 fixes_LDADD=$(TEST_LDADD)
 xfree86_LDADD=$(TEST_LDADD)


More information about the xorg-commit mailing list