xserver: Branch 'master' - 5 commits

Keith Packard keithp at kemper.freedesktop.org
Mon Aug 6 15:08:12 PDT 2012


 hw/xquartz/pbproxy/x-selection.m |    2 -
 hw/xquartz/pseudoramiX.c         |   73 +++++++++++++++++++++++++++------------
 hw/xquartz/xpr/xprEvent.c        |   34 ++++++------------
 3 files changed, 65 insertions(+), 44 deletions(-)

New commits:
commit ad707a7dcc65c30e030c7600b54f734090e56a91
Merge: 5a51cb8... 884f51e...
Author: Keith Packard <keithp at keithp.com>
Date:   Mon Aug 6 15:08:01 2012 -0700

    Merge remote-tracking branch 'jeremyhu/master'

commit 884f51e9770c9ccd3b38a14ea393ea2c7a5ef235
Author: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
Date:   Wed Aug 1 18:46:08 2012 -0700

    XQuartz: Fix xp_window_bring_all_to_front linking on OS versions with older libXplugin
    
    Found-by: Tinderbox
    Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu at apple.com>

diff --git a/hw/xquartz/xpr/xprEvent.c b/hw/xquartz/xpr/xprEvent.c
index 73bcc93..398177c 100644
--- a/hw/xquartz/xpr/xprEvent.c
+++ b/hw/xquartz/xpr/xprEvent.c
@@ -59,13 +59,6 @@
 #include "rootlessWindow.h"
 #include "xprEvent.h"
 
-/* This is important enough to declare here if building against an old
- * libXplugin, so we pick it up whenever libXplugin  starts to support it.
- */
-#if !defined(XPLUGIN_VERSION) || XPLUGIN_VERSION < 6
-extern xp_error xp_window_bring_all_to_front(void) __attribute__((weak_import));
-#endif
-
 Bool
 QuartzModeEventHandler(int screenNum, XQuartzEvent *e, DeviceIntPtr dev)
 {
@@ -86,21 +79,18 @@ QuartzModeEventHandler(int screenNum, XQuartzEvent *e, DeviceIntPtr dev)
         /* 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)
-#if (defined(XPLUGIN_VERSION_MIN_REQUIRED) && XPLUGIN_VERSION_MIN_REQUIRED >= 6) || \
-    (!defined(XPLUGIN_VERSION_MIN_REQUIRED) && defined(XPLUGIN_VERSION) && XPLUGIN_VERSION >= 6)
-        dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
-            xp_window_bring_all_to_front();
-        });
-#else
-            if (&xp_window_bring_all_to_front) {
-                dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
-                    xp_window_bring_all_to_front();
-                });
-            } else {
-                RootlessOrderAllWindows(e->data[0]);
-            }
-#endif
+#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
commit b4c2358e0a388730f1beda5d3a12e79755208ce6
Author: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
Date:   Wed Aug 1 18:45:43 2012 -0700

    pbproxy: Fix a warning about a bad method prototype
    
    x-selection.m:1502:1: warning: method has no return type specified; defaults to 'id'
          [-Wmissing-method-return-type,Semantic Issue]
    - init
    ^
      (id)
    1 warning generated.
    
    Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu at apple.com>

diff --git a/hw/xquartz/pbproxy/x-selection.m b/hw/xquartz/pbproxy/x-selection.m
index 13d5e13..57ddb74 100644
--- a/hw/xquartz/pbproxy/x-selection.m
+++ b/hw/xquartz/pbproxy/x-selection.m
@@ -1499,7 +1499,7 @@ get_property(Window win, Atom property, struct propdata *pdata, Bool delete,
 
 /* Allocation */
 
-- init
+- (id) init
 {
     unsigned long pixel;
 
commit f193907f1b2f8d17dac9b59b7e93ddbb0f4e31ca
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Fri Jun 22 14:56:22 2012 +0100

    Fix pseudoramiX.c compilation without darwin.h
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu at apple.com>

diff --git a/hw/xquartz/pseudoramiX.c b/hw/xquartz/pseudoramiX.c
index ccff64f..23dbc73 100644
--- a/hw/xquartz/pseudoramiX.c
+++ b/hw/xquartz/pseudoramiX.c
@@ -37,7 +37,6 @@
 #include <dix-config.h>
 #endif
 
-#include "darwin.h"
 #include "pseudoramiX.h"
 #include "extnsionst.h"
 #include "extinit.h"
@@ -46,6 +45,9 @@
 #include <X11/extensions/panoramiXproto.h>
 #include "globals.h"
 
+#define TRACE PseudoramiXTrace("TRACE " __FILE__ ":%s",__FUNCTION__)
+#define DEBUG_LOG PseudoramiXDebug
+
 Bool noPseudoramiXExtension = FALSE;
 
 extern int
@@ -96,6 +98,26 @@ static int pseudoramiXScreensAllocated = 0;
 static int pseudoramiXNumScreens = 0;
 static unsigned long pseudoramiXGeneration = 0;
 
+static void
+PseudoramiXTrace(const char *format, ...)
+{
+    va_list ap;
+
+    va_start(ap, format);
+    LogVMessageVerb(X_NONE, 10, format, ap);
+    va_end(ap);
+}
+
+static void
+PseudoramiXDebug(const char *format, ...)
+{
+    va_list ap;
+
+    va_start(ap, format);
+    LogVMessageVerb(X_NONE, 3, format, ap);
+    va_end(ap);
+}
+
 // Add a PseudoramiX screen.
 // The rest of the X server will know nothing about this screen.
 // Can be called before or after extension init.
@@ -133,7 +155,7 @@ PseudoramiXExtensionInit(void)
 
     if (noPseudoramiXExtension) return;
 
-    TRACE();
+    TRACE;
 
     /* Even with only one screen we need to enable PseudoramiX to allow
        dynamic screen configuration changes. */
@@ -170,7 +192,7 @@ PseudoramiXExtensionInit(void)
 void
 PseudoramiXResetScreens(void)
 {
-    TRACE();
+    TRACE;
 
     pseudoramiXNumScreens = 0;
 }
@@ -178,7 +200,7 @@ PseudoramiXResetScreens(void)
 static void
 PseudoramiXResetProc(ExtensionEntry *extEntry)
 {
-    TRACE();
+    TRACE;
 
     PseudoramiXResetScreens();
 }
@@ -187,7 +209,7 @@ PseudoramiXResetProc(ExtensionEntry *extEntry)
 static int
 ProcPseudoramiXQueryVersion(ClientPtr client)
 {
-    TRACE();
+    TRACE;
 
     return ProcPanoramiXQueryVersion(client);
 }
@@ -201,7 +223,7 @@ ProcPseudoramiXGetState(ClientPtr client)
     xPanoramiXGetStateReply rep;
     register int rc;
 
-    TRACE();
+    TRACE;
 
     REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
     rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
@@ -231,7 +253,7 @@ ProcPseudoramiXGetScreenCount(ClientPtr client)
     xPanoramiXGetScreenCountReply rep;
     register int rc;
 
-    TRACE();
+    TRACE;
 
     REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
     rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
@@ -261,7 +283,7 @@ ProcPseudoramiXGetScreenSize(ClientPtr client)
     xPanoramiXGetScreenSizeReply rep;
     register int rc;
 
-    TRACE();
+    TRACE;
 
     if (stuff->screen >= pseudoramiXNumScreens)
       return BadMatch;
@@ -300,7 +322,7 @@ ProcPseudoramiXIsActive(ClientPtr client)
     /* REQUEST(xXineramaIsActiveReq); */
     xXineramaIsActiveReply rep;
 
-    TRACE();
+    TRACE;
 
     REQUEST_SIZE_MATCH(xXineramaIsActiveReq);
 
@@ -369,7 +391,7 @@ static int
 ProcPseudoramiXDispatch(ClientPtr client)
 {
     REQUEST(xReq);
-    TRACE();
+    TRACE;
     switch (stuff->data) {
     case X_PanoramiXQueryVersion:
         return ProcPseudoramiXQueryVersion(client);
@@ -397,7 +419,7 @@ SProcPseudoramiXQueryVersion(ClientPtr client)
 {
     REQUEST(xPanoramiXQueryVersionReq);
 
-    TRACE();
+    TRACE;
 
     swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xPanoramiXQueryVersionReq);
@@ -409,7 +431,7 @@ SProcPseudoramiXGetState(ClientPtr client)
 {
     REQUEST(xPanoramiXGetStateReq);
 
-    TRACE();
+    TRACE;
 
     swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
@@ -421,7 +443,7 @@ SProcPseudoramiXGetScreenCount(ClientPtr client)
 {
     REQUEST(xPanoramiXGetScreenCountReq);
 
-    TRACE();
+    TRACE;
 
     swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
@@ -433,7 +455,7 @@ SProcPseudoramiXGetScreenSize(ClientPtr client)
 {
     REQUEST(xPanoramiXGetScreenSizeReq);
 
-    TRACE();
+    TRACE;
 
     swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
@@ -445,7 +467,7 @@ SProcPseudoramiXIsActive(ClientPtr client)
 {
     REQUEST(xXineramaIsActiveReq);
 
-    TRACE();
+    TRACE;
 
     swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xXineramaIsActiveReq);
@@ -457,7 +479,7 @@ SProcPseudoramiXQueryScreens(ClientPtr client)
 {
     REQUEST(xXineramaQueryScreensReq);
 
-    TRACE();
+    TRACE;
 
     swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xXineramaQueryScreensReq);
@@ -469,7 +491,7 @@ SProcPseudoramiXDispatch(ClientPtr client)
 {
     REQUEST(xReq);
 
-    TRACE();
+    TRACE;
 
     switch (stuff->data) {
     case X_PanoramiXQueryVersion:
commit 067931ccce592e319baffa26d4f7380d8d924537
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Mon Jul 23 12:16:36 2012 +0100

    hw/xquartz: Various fixes for pseudoramiX.c
    
    Various fixes, applied to panoramiX.c in commit 2b266eda, also need applying to pseudoramiX.c:
     Fix panoramiX request and reply swapping
     Set window and screen values in panoramix replies
     Prevent buffer overrun in ProcPanoramiXGetScreenSize
    
    These fixes seem to be necessary in order to compile pseudoramiX.c with gcc
    
    pseudoramiX.c: In function 'ProcPseudoramiXGetState':
    pseudoramiX.c:221:56: error: call to 'wrong_size' declared with attribute error: wrong sized variable passed to swap
    pseudoramiX.c: In function 'ProcPseudoramiXGetScreenCount':
    pseudoramiX.c:250:62: error: call to 'wrong_size' declared with attribute error: wrong sized variable passed to swap
    pseudoramiX.c: In function 'ProcPseudoramiXGetScreenSize':
    pseudoramiX.c:283:56: error: call to 'wrong_size' declared with attribute error: wrong sized variable passed to swap
    pseudoramiX.c:284:57: error: call to 'wrong_size' declared with attribute error: wrong sized variable passed to swap
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu at apple.com>

diff --git a/hw/xquartz/pseudoramiX.c b/hw/xquartz/pseudoramiX.c
index c650dd7..ccff64f 100644
--- a/hw/xquartz/pseudoramiX.c
+++ b/hw/xquartz/pseudoramiX.c
@@ -212,10 +212,11 @@ ProcPseudoramiXGetState(ClientPtr client)
     rep.length = 0;
     rep.sequenceNumber = client->sequence;
     rep.state = !noPseudoramiXExtension;
+    rep.window = stuff->window;
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swapl(&rep.length);
-        swaps(&rep.state);
+        swapl(&rep.window);
     }
     WriteToClient(client, sizeof(xPanoramiXGetStateReply),&rep);
     return Success;
@@ -241,10 +242,11 @@ ProcPseudoramiXGetScreenCount(ClientPtr client)
     rep.length = 0;
     rep.sequenceNumber = client->sequence;
     rep.ScreenCount = pseudoramiXNumScreens;
+    rep.window = stuff->window;
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swapl(&rep.length);
-        swaps(&rep.ScreenCount);
+        swapl(&rep.window);
     }
     WriteToClient(client, sizeof(xPanoramiXGetScreenCountReply),&rep);
     return Success;
@@ -261,6 +263,9 @@ ProcPseudoramiXGetScreenSize(ClientPtr client)
 
     TRACE();
 
+    if (stuff->screen >= pseudoramiXNumScreens)
+      return BadMatch;
+
     REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
     rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
     if (rc != Success)
@@ -274,11 +279,15 @@ ProcPseudoramiXGetScreenSize(ClientPtr client)
     // was screenInfo.screens[stuff->screen]->width;
     rep.height = pseudoramiXScreens[stuff->screen].h;
     // was screenInfo.screens[stuff->screen]->height;
+    rep.window = stuff->window;
+    rep.screen = stuff->screen;
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swapl(&rep.length);
-        swaps(&rep.width);
-        swaps(&rep.height);
+        swapl(&rep.width);
+        swapl(&rep.height);
+        swapl(&rep.window);
+        swapl(&rep.screen);
     }
     WriteToClient(client, sizeof(xPanoramiXGetScreenSizeReply),&rep);
     return Success;


More information about the xorg-commit mailing list