xserver: Branch 'server-1.10-branch' - 3 commits

Jeremy Huddleston jeremyhu at kemper.freedesktop.org
Wed Jun 29 21:45:48 PDT 2011


 Xext/xvmc.c                 |   11 ++++++-----
 glx/glapi_gentable.c        |    6 ++++++
 hw/xquartz/X11Application.m |   25 ++++++++++++++++---------
 3 files changed, 28 insertions(+), 14 deletions(-)

New commits:
commit 79ef102c3adf7cae8982b05320109d0439e6587c
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Mon Jun 27 15:06:16 2011 +0100

    Guard use of backtrace() with HAVE_BACKTRACE
    
    Guard the use of backtrace() with HAVE_BACKTRACE, since we already
    have the autoconf machinery for setting that.
    
    For the moment, assume dladdr() is available when backtrace() is
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>
    (cherry picked from commit 38d55f06cfbf4b05fee0aef8f97f90e835beaacb)

diff --git a/glx/glapi_gentable.c b/glx/glapi_gentable.c
index a9ba3af..b49ae20 100644
--- a/glx/glapi_gentable.c
+++ b/glx/glapi_gentable.c
@@ -31,7 +31,10 @@
 #include <dix-config.h>
 #endif
 
+#ifdef HAVE_BACKTRACE
 #include <execinfo.h>
+#endif
+
 #include <dlfcn.h>
 #include <stdlib.h>
 #include <stdio.h>
@@ -46,6 +49,8 @@
 static void
 __glapi_gentable_NoOp(void) {
     const char *fstr = "Unknown";
+
+#ifdef HAVE_BACKTRACE
     void *frames[2];
 
     if(backtrace(frames, 2) == 2) {
@@ -54,6 +59,7 @@ __glapi_gentable_NoOp(void) {
         if(info.dli_sname)
             fstr = info.dli_sname;
     }
+#endif
 
     LogMessage(X_ERROR, "GLX: Call to unimplemented API: %s\n", fstr);
 }
commit f0ee98584c909b503691d72c01f76602d0a28ba2
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Tue Jun 21 21:14:46 2011 -0700

    XQuartz: Make a call to activateIgnoringOtherApps in our NSApplicationActivatedEventType handler
    
    In addition, this change will not call into the X11 activation unless an X11
    window was active when we deactivated.  We can't rely on the event and current
    key windows because the key window will be nil until activated, and the event
    will only reference the window if the window was clicked (whereas it will be
    nil if we activated via dock or cmd-tab).
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>
    (cherry picked from commit c8b80a82d97d92d445c1c0af6dba42c9de7c56cd)

diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m
index a5159b6..17e6b27 100644
--- a/hw/xquartz/X11Application.m
+++ b/hw/xquartz/X11Application.m
@@ -334,18 +334,21 @@ static void message_kit_thread (SEL selector, NSObject *arg) {
             
         case NSAppKitDefined:
             switch ([e subtype]) {
+                static BOOL x_was_active = NO;
+
                 case NSApplicationActivatedEventType:
                     for_x = NO;
-                    if ([self modalWindow] == nil) {
+                    if ([e window] == nil && x_was_active) {
                         BOOL order_all_windows = YES, workspaces, ok;
                         for_appkit = NO;
-                        
-                        /* FIXME: hack to avoid having to pass the event to appkit,
-                         which would cause it to raise one of its windows. */
+
+                        /* FIXME: This is a hack to avoid passing the event to AppKit which
+                         *        would result in it raising one of its windows.
+                         */
                         _appFlags._active = YES;
-                        
-                        [self activateX:YES];
-                        
+
+                        X11ApplicationSetFrontProcess();
+
                         /* Get the Spaces preference for SwitchOnActivate */
                         (void)CFPreferencesAppSynchronize(CFSTR("com.apple.dock"));
                         workspaces = CFPreferencesGetAppBooleanValue(CFSTR("workspaces"), CFSTR("com.apple.dock"), &ok);
@@ -366,8 +369,9 @@ static void message_kit_thread (SEL selector, NSObject *arg) {
                          *       If there are no active windows, and there are minimized windows, we should
                          *       be restoring one of them.
                          */
-                        if ([e data2] & 0x10) // 0x10 is set when we use cmd-tab or the dock icon
+                        if ([e data2] & 0x10) { // 0x10 (bfCPSOrderAllWindowsForward) is set when we use cmd-tab or the dock icon
                             DarwinSendDDXEvent(kXquartzBringAllToFront, 1, order_all_windows);
+                        }
                     }
                     break;
                     
@@ -377,7 +381,10 @@ static void message_kit_thread (SEL selector, NSObject *arg) {
                     
                 case NSApplicationDeactivatedEventType:
                     for_x = NO;
-                    [self activateX:NO];
+
+                    x_was_active = _x_active;
+                    if(_x_active)
+                        [self activateX:NO];
                     break;
             }
             break;
commit 1834e82b42a876195d12dda28c80004d37c4fa0c
Author: Cyril Brulebois <kibi at debian.org>
Date:   Tue May 24 18:33:11 2011 +0200

    Xext: Fix buggy checks.
    
    XvMCScreenKey is defined as XvMCScreenKeyRec's address, so will never be
    NULL. Use the check proposed by Alan Coopersmith and Jeremy Huddleston
    instead.
    
    Those warnings go away accordingly:
    |   CC     xvmc.lo
    | xvmc.c: In function 'ProcXvMCListSubpictureTypes':
    | xvmc.c:490:22: warning: the comparison will always evaluate as 'false' for the address of 'XvMCScreenKeyRec' will never be NULL [-Waddress]
    | xvmc.c: In function 'XvMCExtensionInit':
    | xvmc.c:671:21: warning: the comparison will always evaluate as 'false' for the address of 'XvMCScreenKeyRec' will never be NULL [-Waddress]
    | xvmc.c: In function 'XvMCFindXvImage':
    | xvmc.c:749:22: warning: the comparison will always evaluate as 'false' for the address of 'XvMCScreenKeyRec' will never be NULL [-Waddress]
    
    Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com>
    Signed-off-by: Cyril Brulebois <kibi at debian.org>
    (cherry picked from commit 9da5aa09d70e26dd4d2ef878a21317dae7bf24de)

diff --git a/Xext/xvmc.c b/Xext/xvmc.c
index 8fbdfae..61ba95f 100644
--- a/Xext/xvmc.c
+++ b/Xext/xvmc.c
@@ -487,8 +487,8 @@ ProcXvMCListSubpictureTypes(ClientPtr client)
 
     pScreen = pPort->pAdaptor->pScreen;
 
-    if(XvMCScreenKey == NULL) /* No XvMC adaptors */
-        return BadMatch;
+    if (!dixPrivateKeyRegistered(XvMCScreenKey))
+        return BadMatch;   /* No XvMC adaptors */
 
     if(!(pScreenPriv = XVMC_GET_PRIVATE(pScreen)))
         return BadMatch;   /* None this screen */
@@ -668,8 +668,8 @@ XvMCExtensionInit(void)
 {
    ExtensionEntry *extEntry;
 
-   if(XvMCScreenKey == NULL) /* nobody supports it */
-	return; 
+   if (!dixPrivateKeyRegistered(XvMCScreenKey))
+	return;
 
    if(!(XvMCRTContext = CreateNewResourceType(XvMCDestroyContextRes,
 					      "XvMCRTContext")))
@@ -746,7 +746,8 @@ XvImagePtr XvMCFindXvImage(XvPortPtr pPort, CARD32 id)
     XvMCAdaptorPtr adaptor = NULL;
     int i;
 
-    if(XvMCScreenKey == NULL) return NULL;
+    if (!dixPrivateKeyRegistered(XvMCScreenKey))
+        return NULL;
 
     if(!(pScreenPriv = XVMC_GET_PRIVATE(pScreen))) 
         return NULL;


More information about the xorg-commit mailing list