xserver: Branch 'xorg-server-1.4-apple' - 6 commits

Jeremy Huddleston jeremyhu at kemper.freedesktop.org
Wed Aug 5 16:31:09 PDT 2009


 hw/xquartz/GL/indirect.c      |    1 
 hw/xquartz/GL/visualConfigs.c |  287 +++++++++++++++++++++---------------------
 hw/xquartz/X11Application.m   |   68 +++++----
 hw/xquartz/quartzAudio.c      |   40 -----
 hw/xquartz/quartzAudio.h      |    3 
 hw/xquartz/quartzKeyboard.c   |    2 
 6 files changed, 196 insertions(+), 205 deletions(-)

New commits:
commit bd0ecd5b502b4ee3d580c84920e7a9adbb93e649
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Wed Aug 5 16:30:22 2009 -0700

    XQuartz: GLX: Update visualConfigs.c to look more like the 1.5 server's for easier patching.

diff --git a/hw/xquartz/GL/visualConfigs.c b/hw/xquartz/GL/visualConfigs.c
index 2895056..49ed805 100644
--- a/hw/xquartz/GL/visualConfigs.c
+++ b/hw/xquartz/GL/visualConfigs.c
@@ -60,51 +60,50 @@
 /* Based originally on code from indirect.c which was based on code from i830_dri.c. */
 void setVisualConfigs(void) {
     int numConfigs = 0;
-    __GLXvisualConfig *visualConfigs = NULL;
+    __GLXvisualConfig *visualConfigs, *c;
     void **visualPrivates = NULL;
     struct glCapabilities caps;
     struct glCapabilitiesConfig *conf = NULL;
     int stereo, depth, aux, buffers, stencil, accum, color, msample;
-    int i = 0; 
     
     if(getGlCapabilities(&caps)) {
-	ErrorF("error from getGlCapabilities()!\n");
-	return;
+        ErrorF("error from getGlCapabilities()!\n");
+        return;
     }
     
     /*
-      conf->stereo is 0 or 1, but we need at least 1 iteration of the loop, 
-      so we treat a true conf->stereo as 2.
-
-      The depth size is 0 or 24.  Thus we do 2 iterations for that.
-
-      conf->aux_buffers (when available/non-zero) result in 2 iterations instead of 1.
-
-      conf->buffers indicates whether we have single or double buffering.
+     conf->stereo is 0 or 1, but we need at least 1 iteration of the loop, 
+     so we treat a true conf->stereo as 2.
+     
+     The depth size is 0 or 24.  Thus we do 2 iterations for that.
+     
+     conf->aux_buffers (when available/non-zero) result in 2 iterations instead of 1.
+     
+     conf->buffers indicates whether we have single or double buffering.
+     
+     conf->total_stencil_bit_depths
+     
+     conf->total_color_buffers indicates the RGB/RGBA color depths.
+     
+     conf->total_accum_buffers iterations for accum (with at least 1 if equal to 0) 
+     
+     conf->total_depth_buffer_depths 
+     
+     conf->multisample_buffers iterations (with at least 1 if equal to 0).  We add 1
+     for the 0 multisampling config.
      
-      conf->total_stencil_bit_depths
-       
-      conf->total_color_buffers indicates the RGB/RGBA color depths.
-      
-      conf->total_accum_buffers iterations for accum (with at least 1 if equal to 0) 
-	
-      conf->total_depth_buffer_depths 
-
-      conf->multisample_buffers iterations (with at least 1 if equal to 0).  We add 1
-      for the 0 multisampling config.
-      
      */
-
+    
     assert(NULL != caps.configurations);
     conf = caps.configurations;
-  
+    
     numConfigs = 0;
-
+    
     for(conf = caps.configurations; conf; conf = conf->next) {
-	if(conf->total_color_buffers <= 0)
-	    continue;
-
-	numConfigs += (conf->stereo ? 2 : 1) 
+        if(conf->total_color_buffers <= 0)
+            continue;
+        
+        numConfigs += (conf->stereo ? 2 : 1) 
 	    * (conf->aux_buffers ? 2 : 1) 
 	    * conf->buffers
 	    * ((conf->total_stencil_bit_depths > 0) ? conf->total_stencil_bit_depths : 1)
@@ -113,125 +112,137 @@ void setVisualConfigs(void) {
 	    * conf->total_depth_buffer_depths
 	    * (conf->multisample_buffers + 1);
     }
-
+    
     visualConfigs = xcalloc(sizeof(*visualConfigs), numConfigs);
-
+    
     if(NULL == visualConfigs) {
-	ErrorF("xcalloc failure when allocating visualConfigs\n");
-	freeGlCapabilities(&caps);
-	return;
+        ErrorF("xcalloc failure when allocating visualConfigs\n");
+        freeGlCapabilities(&caps);
+        return;
     }
     
     visualPrivates = xcalloc(sizeof(void *), numConfigs);
-
+    
     if(NULL == visualPrivates) {
-	ErrorF("xcalloc failure when allocating visualPrivates");
-	freeGlCapabilities(&caps);
-	xfree(visualConfigs);
-	return;
-    }
+        ErrorF("xcalloc failure when allocating visualPrivates");
+        freeGlCapabilities(&caps);
+        xfree(visualConfigs);
+        return;
+    }    
     
-    i = 0; /* current buffer */
+    c = visualConfigs; /* current buffer */
     for(conf = caps.configurations; conf; conf = conf->next) {
-	for(stereo = 0; stereo < (conf->stereo ? 2 : 1); ++stereo) {
-	    for(aux = 0; aux < (conf->aux_buffers ? 2 : 1); ++aux) {
-		for(buffers = 0; buffers < conf->buffers; ++buffers) {
-		    for(stencil = 0; stencil < ((conf->total_stencil_bit_depths > 0) ? 
-						conf->total_stencil_bit_depths : 1); ++stencil) {
-			for(color = 0; color < conf->total_color_buffers; ++color) {
-			    for(accum = 0; accum < ((conf->total_accum_buffers > 0) ?
-						    conf->total_accum_buffers : 1); ++accum) {
-				for(depth = 0; depth < conf->total_depth_buffer_depths; ++depth) {
-				    for(msample = 0; msample < (conf->multisample_buffers + 1); ++msample) {
-					visualConfigs[i].vid = (VisualID)(-1);
-					visualConfigs[i].class = TrueColor;
-					
-					visualConfigs[i].rgba = true;
-
-					if(GLCAPS_COLOR_BUF_INVALID_VALUE != conf->color_buffers[color].a) {
-					    visualConfigs[i].alphaSize =  conf->color_buffers[color].a;
-					} else {
-					    visualConfigs[i].alphaSize = 0;
-					}
-	
-					visualConfigs[i].redSize = conf->color_buffers[color].r;
-					visualConfigs[i].greenSize = conf->color_buffers[color].g;
-					visualConfigs[i].blueSize = conf->color_buffers[color].b;
-
-					visualConfigs[i].bufferSize = visualConfigs[i].alphaSize + visualConfigs[i].redSize + visualConfigs[i].greenSize + visualConfigs[i].blueSize;
-
-					visualConfigs[i].alphaMask = AM_ARGB(visualConfigs[i].alphaSize, visualConfigs[i].redSize, visualConfigs[i].greenSize, visualConfigs[i].blueSize);
-					visualConfigs[i].redMask   = RM_ARGB(visualConfigs[i].alphaSize, visualConfigs[i].redSize, visualConfigs[i].greenSize, visualConfigs[i].blueSize);
-					visualConfigs[i].greenMask = GM_ARGB(visualConfigs[i].alphaSize, visualConfigs[i].redSize, visualConfigs[i].greenSize, visualConfigs[i].blueSize);
-					visualConfigs[i].blueMask  = BM_ARGB(visualConfigs[i].alphaSize, visualConfigs[i].redSize, visualConfigs[i].greenSize, visualConfigs[i].blueSize);
-					
-					if(conf->total_accum_buffers > 0) {
-					    visualConfigs[i].accumRedSize = conf->accum_buffers[accum].r;
-					    visualConfigs[i].accumGreenSize = conf->accum_buffers[accum].g;
-					    visualConfigs[i].accumBlueSize = conf->accum_buffers[accum].b;
-					    if(GLCAPS_COLOR_BUF_INVALID_VALUE != conf->accum_buffers[accum].a) {
-						visualConfigs[i].accumAlphaSize = conf->accum_buffers[accum].a;
-					    } else {
-						visualConfigs[i].accumAlphaSize = 0;
-					    }
-					} else {
-					    visualConfigs[i].accumRedSize = 0;
-					    visualConfigs[i].accumGreenSize = 0;
-					    visualConfigs[i].accumBlueSize = 0;
-					    visualConfigs[i].accumAlphaSize = 0;
-					}
-					
-					visualConfigs[i].doubleBuffer = buffers ? TRUE : FALSE;
-					visualConfigs[i].stereo = stereo ? TRUE : FALSE;
-
-  					visualConfigs[i].depthSize = conf->depth_buffers[depth];
-				
-					if(conf->total_stencil_bit_depths > 0) {
-					    visualConfigs[i].stencilSize = conf->stencil_bit_depths[stencil];
-					} else {
-					    visualConfigs[i].stencilSize = 0;
-					}
-					visualConfigs[i].auxBuffers = aux ? conf->aux_buffers : 0;
-					visualConfigs[i].level = 0;
-				
-					if(conf->accelerated) {
-					    visualConfigs[i].visualRating = GLX_NONE;
-					} else {
-					    visualConfigs[i].visualRating = GLX_SLOW_VISUAL_EXT;
-					}
-					
-					visualConfigs[i].transparentPixel = GLX_NONE;
-					visualConfigs[i].transparentRed = GLX_NONE;
-					visualConfigs[i].transparentGreen = GLX_NONE;
-					visualConfigs[i].transparentBlue = GLX_NONE;
-					visualConfigs[i].transparentAlpha = GLX_NONE;
-					visualConfigs[i].transparentIndex = GLX_NONE;
-					
-					if(msample > 0) {
-					    visualConfigs[i].multiSampleSize = conf->multisample_samples;
-					    visualConfigs[i].nMultiSampleBuffers = conf->multisample_buffers;
-					} else {
-					    visualConfigs[i].multiSampleSize = 0;
-					    visualConfigs[i].nMultiSampleBuffers = 0;
-					}
-										
-					++i;
-				    }
-				}
-			    }
-			}
-		    }
-		}
-	    }
-	}
+        for(stereo = 0; stereo < (conf->stereo ? 2 : 1); ++stereo) {
+            for(aux = 0; aux < (conf->aux_buffers ? 2 : 1); ++aux) {
+                for(buffers = 0; buffers < conf->buffers; ++buffers) {
+                    for(stencil = 0; stencil < ((conf->total_stencil_bit_depths > 0) ? 
+                                                conf->total_stencil_bit_depths : 1); ++stencil) {
+                        for(color = 0; color < conf->total_color_buffers; ++color) {
+                            for(accum = 0; accum < ((conf->total_accum_buffers > 0) ?
+                                                    conf->total_accum_buffers : 1); ++accum) {
+                                for(depth = 0; depth < conf->total_depth_buffer_depths; ++depth) {
+                                    for(msample = 0; msample < (conf->multisample_buffers + 1); ++msample) {
+                                        
+                                        // Global
+                                        c->vid = (VisualID)-1;
+                                        c->class = GLX_TRUE_COLOR;
+
+                                        c->rgba = true;
+                                        
+                                        c->level = 0;
+                                        
+                                        if(conf->accelerated) {
+                                            c->visualRating = GLX_NONE;
+                                        } else {
+                                            c->visualRating = GLX_SLOW_VISUAL_EXT;
+                                        }
+                                        
+                                        c->transparentPixel = GLX_NONE;
+                                        c->transparentRed = GLX_NONE;
+                                        c->transparentGreen = GLX_NONE;
+                                        c->transparentBlue = GLX_NONE;
+                                        c->transparentAlpha = GLX_NONE;
+                                        c->transparentIndex = GLX_NONE;
+                                        
+                                        c->visualSelectGroup = 0;
+                                        
+                                        // Stereo
+                                        c->stereo = stereo ? TRUE : FALSE;
+
+                                        // Aux buffers
+                                        c->auxBuffers = aux ? conf->aux_buffers : 0;
+                                        
+                                        // Double Buffered
+                                        c->doubleBuffer = buffers ? TRUE : FALSE;
+
+                                        // Stencil Buffer
+                                        if(conf->total_stencil_bit_depths > 0) {
+                                            c->stencilSize = conf->stencil_bit_depths[stencil];
+                                        } else {
+                                            c->stencilSize = 0;
+                                        }
+                                        
+                                        // Color
+                                        if(GLCAPS_COLOR_BUF_INVALID_VALUE != conf->color_buffers[color].a) {
+                                            c->alphaSize = conf->color_buffers[color].a;
+                                        } else {
+                                            c->alphaSize = 0;
+                                        }
+                                        c->redSize   = conf->color_buffers[color].r;
+                                        c->greenSize = conf->color_buffers[color].g;
+                                        c->blueSize  = conf->color_buffers[color].b;
+                                        
+                                        c->bufferSize = c->alphaSize + c->redSize + c->greenSize + c->blueSize;
+
+                                        c->alphaMask = AM_ARGB(c->alphaSize, c->redSize, c->greenSize, c->blueSize);
+                                        c->redMask   = RM_ARGB(c->alphaSize, c->redSize, c->greenSize, c->blueSize);
+                                        c->greenMask = GM_ARGB(c->alphaSize, c->redSize, c->greenSize, c->blueSize);
+                                        c->blueMask  = BM_ARGB(c->alphaSize, c->redSize, c->greenSize, c->blueSize);
+                                                                                
+                                        // Accumulation Buffers
+                                        if(conf->total_accum_buffers > 0) {
+                                            c->accumRedSize = conf->accum_buffers[accum].r;
+                                            c->accumGreenSize = conf->accum_buffers[accum].g;
+                                            c->accumBlueSize = conf->accum_buffers[accum].b;
+                                            if(GLCAPS_COLOR_BUF_INVALID_VALUE != conf->accum_buffers[accum].a) {
+                                                c->accumAlphaSize = conf->accum_buffers[accum].a;
+                                            } else {
+                                                c->accumAlphaSize = 0;
+                                            }
+                                        } else {
+                                            c->accumRedSize = 0;
+                                            c->accumGreenSize = 0;
+                                            c->accumBlueSize = 0;
+                                            c->accumAlphaSize = 0;
+                                        } 
+
+                                        // Depth
+                                        c->depthSize = conf->depth_buffers[depth];
+                                        
+                                        // MultiSample
+                                        if(msample > 0) {
+                                            c->multiSampleSize = conf->multisample_samples;
+                                            c->nMultiSampleBuffers = conf->multisample_buffers;
+                                        } else {
+                                            c->multiSampleSize = 0;
+                                            c->nMultiSampleBuffers = 0;
+                                        }
+
+                                        c = c + 1;
+                                    }
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        }
     }
 
-    if (i != numConfigs) {
-	ErrorF("numConfigs calculation error in setVisualConfigs!  numConfigs is %d  i is %d\n", numConfigs, i);
-	abort();
+    if (c - visualConfigs != numConfigs) {
+        FatalError("numConfigs calculation error in setVisualConfigs!  numConfigs is %d  i is %d\n", numConfigs, c - visualConfigs);
     }
-
+    
     freeGlCapabilities(&caps);
-
     GlxSetVisualConfigs(numConfigs, visualConfigs, visualPrivates);
 }
commit 6769ffb2f8ad299df06e586c3675433c20ebffcc
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Sat Aug 1 22:53:45 2009 -0700

    XQuartz: Only save lastpt on mouse/tablet events
    (cherry picked from commit 552be074e5be6492df3e290e8b7d9daff1a2cb34)

diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m
index 5d28132..6ade527 100644
--- a/hw/xquartz/X11Application.m
+++ b/hw/xquartz/X11Application.m
@@ -990,55 +990,50 @@ static inline int ensure_flag(int flags, int device_independent, int device_depe
 #endif
 
 - (void) sendX11NSEvent:(NSEvent *)e {
-    NSRect screen;
-    NSPoint location, tilt;
-    NSWindow *window;
+    NSPoint location = NSZeroPoint, tilt = NSZeroPoint;
     int ev_button, ev_type;
-    float pressure;
+    float pressure = 0.0;
     DeviceIntPtr pDev;
     int modifierFlags;
-    BOOL isTabletEvent;
-
-    static NSPoint lastpt;
-
-    /* convert location to be relative to top-left of primary display */
-    window = [e window];
-
-    isTabletEvent = ([e type] == NSTabletPoint) || 
-                    (( [e type] == NSLeftMouseDown    ||  [e type] == NSOtherMouseDown    ||  [e type] == NSRightMouseDown    ||
-                       [e type] == NSLeftMouseUp      ||  [e type] == NSOtherMouseUp      ||  [e type] == NSRightMouseUp      ||
-                       [e type] == NSLeftMouseDragged ||  [e type] == NSOtherMouseDragged ||  [e type] == NSRightMouseDragged ||
-                       [e type] == NSMouseMoved ) && ([e subtype] == NSTabletPointEventSubtype || [e subtype] == NSTabletProximityEventSubtype));
-    
-    if (window != nil)	{
-        NSRect frame = [window frame];
-        location = [e locationInWindow];
-        location.x += frame.origin.x;
-        location.y += frame.origin.y;
-        lastpt = location;
-    } else if(isTabletEvent) {
-        // NSEvents for tablets are not consistent wrt deltaXY between events, so we cannot rely on that
-        // Thus tablets will be subject to the warp-pointer bug worked around by the delta, but tablets
-        // are not normally used in cases where that bug would present itself, so this is a fair tradeoff
-        // <rdar://problem/7111003> deltaX and deltaY are incorrect for NSMouseMoved, NSTabletPointEventSubtype
-        // http://xquartz.macosforge.org/trac/ticket/288
-        location = [e locationInWindow];
-        lastpt = location;
-    } else {
-        location.x = lastpt.x + [e deltaX];
-        location.y = lastpt.y - [e deltaY];
-        lastpt = [NSEvent mouseLocation]; // [e locationInWindow] gives us the "unfixed" location when our cursor is fixed.  This bugs things like quake
+    BOOL isMouseOrTabletEvent, isTabletEvent;
+
+    isMouseOrTabletEvent =  [e type] == NSLeftMouseDown    ||  [e type] == NSOtherMouseDown    ||  [e type] == NSRightMouseDown    ||
+                            [e type] == NSLeftMouseUp      ||  [e type] == NSOtherMouseUp      ||  [e type] == NSRightMouseUp      ||
+                            [e type] == NSLeftMouseDragged ||  [e type] == NSOtherMouseDragged ||  [e type] == NSRightMouseDragged ||
+                            [e type] == NSMouseMoved       ||  [e type] == NSTabletPoint;
+
+    isTabletEvent = ([e type] == NSTabletPoint) ||
+                    (isMouseOrTabletEvent && ([e subtype] == NSTabletPointEventSubtype || [e subtype] == NSTabletProximityEventSubtype));
+
+    if(isMouseOrTabletEvent) {
+        static NSPoint lastpt;
+        NSWindow *window = [e window];
+        NSRect screen = [[[NSScreen screens] objectAtIndex:0] frame];;
+
+        if (window != nil)	{
+            NSRect frame = [window frame];
+            location = [e locationInWindow];
+            location.x += frame.origin.x;
+            location.y += frame.origin.y;
+            lastpt = location;
+        } else if(isTabletEvent) {
+            // NSEvents for tablets are not consistent wrt deltaXY between events, so we cannot rely on that
+            // Thus tablets will be subject to the warp-pointer bug worked around by the delta, but tablets
+            // are not normally used in cases where that bug would present itself, so this is a fair tradeoff
+            // <rdar://problem/7111003> deltaX and deltaY are incorrect for NSMouseMoved, NSTabletPointEventSubtype
+            // http://xquartz.macosforge.org/trac/ticket/288
+            location = [e locationInWindow];
+            lastpt = location;
+        } else {
+            location.x = lastpt.x + [e deltaX];
+            location.y = lastpt.y - [e deltaY];
+            lastpt = [e locationInWindow];
+        }
+        
+        /* Convert coordinate system */
+        location.y = (screen.origin.y + screen.size.height) - location.y;
     }
     
-    /* Convert coordinate system */
-    screen = [[[NSScreen screens] objectAtIndex:0] frame];
-    location.y = (screen.origin.y + screen.size.height) - location.y;
-    
-    /* Setup our valuators.  These will range from 0 to 1 */
-    pressure = 0;
-    tilt.x = 0.0;
-    tilt.y = 0.0;
-
     modifierFlags = [e modifierFlags];
     
 #ifdef NX_DEVICELCMDKEYMASK
commit cba52fa3e3fd6db05ad339421d59e0220bf1b431
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Sat Aug 1 12:43:14 2009 -0700

    XQuartz: Use mouseLocation rather than locationInWindow when setting lastpt
    
    I don't understand the *why* ... I just see that it works better this way for games like Quake2 through wine.  It *should* be better the other way, but somehow it's not.
    
    I guess this will go in my list of puzzles to unravel.
    (cherry picked from commit 65ae2d00e1a53f97f2ff9522406ab69d50bf3199)

diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m
index 9d6ee71..5d28132 100644
--- a/hw/xquartz/X11Application.m
+++ b/hw/xquartz/X11Application.m
@@ -1027,7 +1027,7 @@ static inline int ensure_flag(int flags, int device_independent, int device_depe
     } else {
         location.x = lastpt.x + [e deltaX];
         location.y = lastpt.y - [e deltaY];
-        lastpt = [e locationInWindow];
+        lastpt = [NSEvent mouseLocation]; // [e locationInWindow] gives us the "unfixed" location when our cursor is fixed.  This bugs things like quake
     }
     
     /* Convert coordinate system */
commit 6a2c4d5959e29f140884bb42c907cade45bb8d9f
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Sat Aug 1 02:32:52 2009 -0700

    XQuartz: Don't use location delta for tablets since NSEvent does not give a precise delta.
    (cherry picked from commit 6c5bf756a7f5389cdfe2e43a339d7c31a3e522e9)

diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m
index 7eadc48..9d6ee71 100644
--- a/hw/xquartz/X11Application.m
+++ b/hw/xquartz/X11Application.m
@@ -997,22 +997,37 @@ static inline int ensure_flag(int flags, int device_independent, int device_depe
     float pressure;
     DeviceIntPtr pDev;
     int modifierFlags;
+    BOOL isTabletEvent;
 
     static NSPoint lastpt;
 
     /* convert location to be relative to top-left of primary display */
     window = [e window];
 
+    isTabletEvent = ([e type] == NSTabletPoint) || 
+                    (( [e type] == NSLeftMouseDown    ||  [e type] == NSOtherMouseDown    ||  [e type] == NSRightMouseDown    ||
+                       [e type] == NSLeftMouseUp      ||  [e type] == NSOtherMouseUp      ||  [e type] == NSRightMouseUp      ||
+                       [e type] == NSLeftMouseDragged ||  [e type] == NSOtherMouseDragged ||  [e type] == NSRightMouseDragged ||
+                       [e type] == NSMouseMoved ) && ([e subtype] == NSTabletPointEventSubtype || [e subtype] == NSTabletProximityEventSubtype));
+    
     if (window != nil)	{
         NSRect frame = [window frame];
         location = [e locationInWindow];
         location.x += frame.origin.x;
         location.y += frame.origin.y;
         lastpt = location;
+    } else if(isTabletEvent) {
+        // NSEvents for tablets are not consistent wrt deltaXY between events, so we cannot rely on that
+        // Thus tablets will be subject to the warp-pointer bug worked around by the delta, but tablets
+        // are not normally used in cases where that bug would present itself, so this is a fair tradeoff
+        // <rdar://problem/7111003> deltaX and deltaY are incorrect for NSMouseMoved, NSTabletPointEventSubtype
+        // http://xquartz.macosforge.org/trac/ticket/288
+        location = [e locationInWindow];
+        lastpt = location;
     } else {
         location.x = lastpt.x + [e deltaX];
         location.y = lastpt.y - [e deltaY];
-        lastpt = [NSEvent mouseLocation];
+        lastpt = [e locationInWindow];
     }
     
     /* Convert coordinate system */
commit f99b27bc6e98b54e4ebdfa53ec5a8297fc879272
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Fri Jul 31 16:09:50 2009 -0700

    XQuartz: Purge redundant QuartzBell
    (cherry picked from commit de14a63d20095e1537fd74352850c734d900031d)

diff --git a/hw/xquartz/quartzAudio.c b/hw/xquartz/quartzAudio.c
index 8627588..8cf2417 100644
--- a/hw/xquartz/quartzAudio.c
+++ b/hw/xquartz/quartzAudio.c
@@ -219,6 +219,12 @@ void DDXRingBell(
     int pitch,          // pitch is Hz
     int duration )      // duration is milliseconds
 {
+    if (quartzUseSysBeep) {
+        if (volume)
+            NSBeep();
+        return;
+    }
+        
     if (quartzAudioDevice == kAudioDeviceUnknown) return;
 
     pthread_mutex_lock(&data.lock);
@@ -247,40 +253,6 @@ void DDXRingBell(
     pthread_mutex_unlock(&data.lock);
 }
 
-
-/*
- * QuartzBell
- *  Ring the bell
- */
-void QuartzBell(
-    int volume,             // volume in percent of max
-    DeviceIntPtr pDevice,
-    pointer ctrl,
-    int class )
-{
-    int pitch;              // pitch in Hz
-    int duration;           // duration in milliseconds
-
-    if (class == BellFeedbackClass) {
-        pitch = ((BellCtrl*)ctrl)->pitch;
-        duration = ((BellCtrl*)ctrl)->duration;
-    } else if (class == KbdFeedbackClass) {
-        pitch = ((KeybdCtrl*)ctrl)->bell_pitch;
-        duration = ((KeybdCtrl*)ctrl)->bell_duration;    
-    } else {
-        ErrorF("QuartzBell: bad bell class %d\n", class);
-        return;
-    }
-
-    if (quartzUseSysBeep) {
-        if (volume)
-            NSBeep();
-    } else {
-        DDXRingBell(volume, pitch, duration);
-    }
-}
-
-
 /*
  * QuartzAudioInit
  *  Prepare to play the bell with the CoreAudio API
diff --git a/hw/xquartz/quartzAudio.h b/hw/xquartz/quartzAudio.h
index c406bbc..2a78b39 100644
--- a/hw/xquartz/quartzAudio.h
+++ b/hw/xquartz/quartzAudio.h
@@ -32,9 +32,6 @@
 #ifndef _QUARTZAUDIO_H
 #define _QUARTZAUDIO_H
 
-#include "input.h"
-
 void QuartzAudioInit(void);
-void QuartzBell(int volume, DeviceIntPtr pDevice, pointer ctrl, int class);
 
 #endif
diff --git a/hw/xquartz/quartzKeyboard.c b/hw/xquartz/quartzKeyboard.c
index 73ede51..0c3f0b6 100644
--- a/hw/xquartz/quartzKeyboard.c
+++ b/hw/xquartz/quartzKeyboard.c
@@ -338,7 +338,7 @@ void DarwinKeyboardInit(DeviceIntPtr pDev) {
     
     DarwinLoadKeyboardMapping(&keySyms);    
     XkbInitKeyboardDeviceStruct(pDev, &names, &keySyms, keyInfo.modMap,
-                                       QuartzBell, DarwinChangeKeyboardControl);
+                                NULL, DarwinChangeKeyboardControl);
     pthread_mutex_unlock(&keyInfo_mutex);
 
     /* Get our key repeat settings from GlobalPreferences */
commit 291b8efd79cf005f0568e72abf744a2ba34c9ca0
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Wed Aug 5 16:13:10 2009 -0700

    XQuartz: Added a reminder not to purge a stub that can lead to a crash

diff --git a/hw/xquartz/GL/indirect.c b/hw/xquartz/GL/indirect.c
index e8ba4c7..39234b9 100644
--- a/hw/xquartz/GL/indirect.c
+++ b/hw/xquartz/GL/indirect.c
@@ -430,6 +430,7 @@ static int __glXAquaContextForceCurrent(__GLXcontext *baseContext)
 /* Drawing surface notification callbacks */
 
 static GLboolean __glXAquaDrawableResize(__GLXdrawable *base)  {
+    // Don't remove, <rdar://problem/7114913>
     GLAQUA_DEBUG_MSG("unimplemented glAquaDrawableResize\n");
     return GL_TRUE;
 }


More information about the xorg-commit mailing list