[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

xorg-server: Changes to 'ubuntu'



 Xext/xvmc.c                                                               |   11 
 Xi/xichangehierarchy.c                                                    |    2 
 configure.ac                                                              |    4 
 debian/changelog                                                          |    4 
 debian/patches/20-workaround-36986.diff                                   |   14 
 debian/patches/218_randr-check-rotated-virtual-size-limits-correctly.diff |   30 
 debian/patches/500_xi2.1.patch                                            |   51 
 debian/patches/series                                                     |    2 
 dix/devices.c                                                             |   40 
 dix/events.c                                                              |    2 
 dix/window.c                                                              |    2 
 fb/fbbltone.c                                                             |    4 
 glx/Makefile.am                                                           |    1 
 glx/glapi.h                                                               |    3 
 glx/glapi_gentable.c                                                      | 7589 ++++++++++
 hw/xfree86/os-support/linux/lnx_init.c                                    |   83 
 hw/xquartz/GL/indirect.c                                                  | 1079 -
 hw/xquartz/X11Application.m                                               |   27 
 include/input.h                                                           |    2 
 include/privates.h                                                        |    2 
 randr/rrcrtc.c                                                            |    2 
 randr/rrdispatch.c                                                        |   32 
 randr/rrscreen.c                                                          |   12 
 test/input.c                                                              |    3 
 test/xi2/protocol-common.c                                                |    2 
 25 files changed, 7823 insertions(+), 1180 deletions(-)

New commits:
commit 495bbaf1d4b2c4e85c1db7141081e068847bf7de
Author: Timo Aaltonen <tjaalton@ubuntu.com>
Date:   Fri Jul 1 14:48:50 2011 +0300

    Drop patches 20, 218, fixed upstream.

diff --git a/debian/changelog b/debian/changelog
index 3bd23eb..9a9380c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,6 +5,7 @@ xorg-server (2:1.10.2-1ubuntu2) UNRELEASED; urgency=low
   * Pull changes from server-1.10-branch, last commit being 79ef102c.
     (LP: #441653)
     - Update 500_xi2.1.patch to apply.
+    - Drop patches 20, 218, fixed upstream.
 
  -- Timo Aaltonen <tjaalton@ubuntu.com>  Mon, 27 Jun 2011 19:21:03 +0300
 
diff --git a/debian/patches/20-workaround-36986.diff b/debian/patches/20-workaround-36986.diff
deleted file mode 100644
index 24b3cb9..0000000
--- a/debian/patches/20-workaround-36986.diff
+++ /dev/null
@@ -1,14 +0,0 @@
-Workaround fdo#36986 <http://bugs.freedesktop.org/show_bug.cgi?id=36986>
---- a/test/input.c
-+++ b/test/input.c
-@@ -1213,8 +1213,10 @@
- 
-         g_assert(v);
-         g_assert(v->numAxes == num_axes);
-+#if 0
-         g_assert(((void*)v->axisVal - (void*)v) % sizeof(double) == 0);
-         g_assert(((void*)v->axes - (void*)v) % sizeof(double) == 0);
-+#endif
-         num_axes ++;
-     }
- 
diff --git a/debian/patches/218_randr-check-rotated-virtual-size-limits-correctly.diff b/debian/patches/218_randr-check-rotated-virtual-size-limits-correctly.diff
deleted file mode 100644
index 9baa90e..0000000
--- a/debian/patches/218_randr-check-rotated-virtual-size-limits-correctly.diff
+++ /dev/null
@@ -1,30 +0,0 @@
-diff --git a/randr/rrscreen.c b/randr/rrscreen.c
-index 1bc1a9e..da6d48d 100644
---- a/randr/rrscreen.c
-+++ b/randr/rrscreen.c
-@@ -910,12 +910,6 @@ ProcRRSetScreenConfig (ClientPtr client)
-      */
-     width = mode->mode.width;
-     height = mode->mode.height;
--    if (rotation & (RR_Rotate_90|RR_Rotate_270))
--    {
--	width = mode->mode.height;
--	height = mode->mode.width;
--    }
--
-     if (width < pScrPriv->minWidth || pScrPriv->maxWidth < width) {
- 	client->errorValue = width;
- 	free(pData);
-@@ -927,6 +921,12 @@ ProcRRSetScreenConfig (ClientPtr client)
- 	return BadValue;
-     }
- 
-+    if (rotation & (RR_Rotate_90|RR_Rotate_270))
-+    {
-+	width = mode->mode.height;
-+	height = mode->mode.width;
-+    }
-+
-     if (width != pScreen->width || height != pScreen->height)
-     {
- 	int	c;
diff --git a/debian/patches/series b/debian/patches/series
index ac7a0b7..8f62af8 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -5,7 +5,6 @@
 07-xfree86-fix-build-with-xv-disabled.diff
 #13_debian_add_xkbpath_env_variable.diff
 15-nouveau.diff
-20-workaround-36986.diff
 
 # Ubuntu patches
 100_rethrow_signals.patch
@@ -31,7 +30,6 @@
 210_pixman_null_ptr_check.patch
 214_glx_dri_searchdirs.patch
 217_revert_bgnonevisitwindow.patch
-218_randr-check-rotated-virtual-size-limits-correctly.diff
 219_fedora-pointer-barriers.diff
 500_xi2.1.patch
 501_xf86CoordinatesToWindow.patch

commit 44cefd3de59dcc80bbd4a451feb0d766bcd39e21
Author: Timo Aaltonen <tjaalton@ubuntu.com>
Date:   Fri Jul 1 14:43:51 2011 +0300

    Pull changes from server-1.10-branch, last commit being 79ef102c
    
    Update 500_xi2.1.patch to apply.

diff --git a/debian/changelog b/debian/changelog
index 863a155..3bd23eb 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,9 @@ xorg-server (2:1.10.2-1ubuntu2) UNRELEASED; urgency=low
 
   * Update the crtc confinement patch with one that should work, with
     further fixes from upstream. (LP: #389519)
+  * Pull changes from server-1.10-branch, last commit being 79ef102c.
+    (LP: #441653)
+    - Update 500_xi2.1.patch to apply.
 
  -- Timo Aaltonen <tjaalton@ubuntu.com>  Mon, 27 Jun 2011 19:21:03 +0300
 
diff --git a/debian/patches/500_xi2.1.patch b/debian/patches/500_xi2.1.patch
index 6dc7c66..19edeeb 100644
--- a/debian/patches/500_xi2.1.patch
+++ b/debian/patches/500_xi2.1.patch
@@ -94,7 +94,7 @@ Index: xorg-server/Xi/exevents.c
  /**
   * @return the device matching the deviceid of the device set in the event, or
   * NULL if the event is not an XInput event.
-@@ -722,6 +764,46 @@
+@@ -725,6 +767,46 @@
      XISendDeviceChangedEvent(slave, device, dce);
  }
  
@@ -141,7 +141,7 @@ Index: xorg-server/Xi/exevents.c
  /**
   * Update the device state according to the data in the event.
   *
-@@ -729,8 +811,6 @@
+@@ -732,8 +814,6 @@
   *   DEFAULT ... process as normal
   *   DONT_PROCESS ... return immediately from caller
   */
@@ -150,7 +150,7 @@ Index: xorg-server/Xi/exevents.c
  int
  UpdateDeviceState(DeviceIntPtr device, DeviceEvent* event)
  {
-@@ -854,34 +934,9 @@
+@@ -857,34 +937,9 @@
  
          if (!button_is_down(device, key, BUTTON_PROCESSED))
              return DONT_PROCESS;
@@ -186,7 +186,7 @@ Index: xorg-server/Xi/exevents.c
  
          /* Add state and motionMask to the filter for this event */
          mask = DevicePointerMotionMask | b->state | b->motionMask;
-@@ -923,6 +978,955 @@
+@@ -926,6 +981,955 @@
  }
  
  /**
@@ -1142,7 +1142,7 @@ Index: xorg-server/Xi/exevents.c
   * Main device event processing function.
   * Called from when processing the events from the event queue.
   *
-@@ -951,6 +1955,33 @@
+@@ -954,6 +1958,33 @@
      {
          ProcessRawEvent(&ev->raw_event, device);
          return;
@@ -1176,7 +1176,7 @@ Index: xorg-server/Xi/exevents.c
      }
  
      if (IsPointerDevice(device))
-@@ -1149,6 +2180,50 @@
+@@ -1152,6 +2183,50 @@
          dev->proximity->in_proximity = FALSE;
  }
  
@@ -1227,7 +1227,7 @@ Index: xorg-server/Xi/exevents.c
  static void
  FixDeviceStateNotify(DeviceIntPtr dev, deviceStateNotify * ev, KeyClassPtr k,
  		     ButtonClassPtr b, ValuatorClassPtr v, int first)
-@@ -1559,6 +2634,38 @@
+@@ -1562,6 +2637,38 @@
      return AddPassiveGrabToList(client, grab);
  }
  
@@ -1266,7 +1266,7 @@ Index: xorg-server/Xi/exevents.c
  int
  SelectForWindow(DeviceIntPtr dev, WindowPtr pWin, ClientPtr client,
  		Mask mask, Mask exclusivemasks)
-@@ -1696,10 +2803,65 @@
+@@ -1699,10 +2806,65 @@
      }
  }
  
@@ -1332,7 +1332,7 @@ Index: xorg-server/Xi/exevents.c
  
      if (!wOtherInputMasks(pWin))
  	return Success;
-@@ -1735,6 +2897,54 @@
+@@ -1738,6 +2900,54 @@
      FatalError("client not on device event list");
  }
  
@@ -1600,7 +1600,7 @@ Index: xorg-server/Xi/xipassivegrab.c
 ===================================================================
 --- xorg-server.orig/Xi/xipassivegrab.c	2011-04-06 18:25:23.000000000 +0300
 +++ xorg-server/Xi/xipassivegrab.c	2011-04-09 10:42:15.000000000 +0300
-@@ -110,19 +110,30 @@
+@@ -105,19 +105,30 @@
      if (stuff->grab_type != XIGrabtypeButton &&
          stuff->grab_type != XIGrabtypeKeycode &&
          stuff->grab_type != XIGrabtypeEnter &&
@@ -1633,7 +1633,7 @@ Index: xorg-server/Xi/xipassivegrab.c
      if (XICheckInvalidMaskBits(client, (unsigned char*)&stuff[1],
                                 stuff->mask_len * 4) != Success)
          return BadValue;
-@@ -192,6 +203,9 @@
+@@ -185,6 +196,9 @@
                  status = GrabWindow(client, dev, stuff->grab_type,
                                      &param, &mask);
                  break;
@@ -1893,7 +1893,7 @@ Index: xorg-server/dix/devices.c
      FreeDeviceClass(ButtonClass, (pointer)&classes->button);
      FreeDeviceClass(FocusClass, (pointer)&classes->focus);
      FreeDeviceClass(ProximityClass, (pointer)&classes->proximity);
-@@ -1574,6 +1589,151 @@
+@@ -1547,6 +1562,151 @@
  	   InitPtrFeedbackClassDeviceStruct(dev, controlProc));
  }
  
@@ -2045,8 +2045,8 @@ Index: xorg-server/dix/devices.c
  /*
   * Check if the given buffer contains elements between low (inclusive) and
   * high (inclusive) only.
-@@ -2406,6 +2566,58 @@
-     }
+@@ -2419,6 +2579,58 @@
+     FreeEventList(eventlist, GetMaximumEventsNum());
  }
  
 +static void
@@ -2104,7 +2104,7 @@ Index: xorg-server/dix/devices.c
  /**
   * Attach device 'dev' to device 'master'.
   * Client is set to the client that issued the request, or NULL if it comes
-@@ -2471,6 +2683,12 @@
+@@ -2486,6 +2698,12 @@
          dev->spriteInfo->spriteOwner = FALSE;
  
          RecalculateMasterButtons(master);
@@ -3871,8 +3871,8 @@ Index: xorg-server/include/input.h
 ===================================================================
 --- xorg-server.orig/include/input.h	2011-04-06 18:25:23.000000000 +0300
 +++ xorg-server/include/input.h	2011-04-09 10:42:15.000000000 +0300
-@@ -105,6 +105,8 @@
- typedef struct _ValuatorClassRec *ValuatorClassPtr;
+@@ -104,6 +104,8 @@
+ typedef struct _DeviceIntRec *DeviceIntPtr;
  typedef struct _ClassesRec *ClassesPtr;
  typedef struct _SpriteRec *SpritePtr;
 +typedef struct _TouchClassRec *TouchClassPtr;
@@ -3880,7 +3880,7 @@ Index: xorg-server/include/input.h
  typedef union _GrabMask GrabMask;
  
  typedef struct _EventList {
-@@ -319,6 +321,12 @@
+@@ -314,6 +316,12 @@
  extern _X_EXPORT Bool InitFocusClassDeviceStruct(
      DeviceIntPtr /*device*/);
  
@@ -3893,7 +3893,7 @@ Index: xorg-server/include/input.h
  typedef void (*BellProcPtr)(
      int /*percent*/,
      DeviceIntPtr /*device*/,
-@@ -468,6 +476,22 @@
+@@ -463,6 +471,22 @@
      int key_code,
      const ValuatorMask *mask);
  
@@ -3916,7 +3916,7 @@ Index: xorg-server/include/input.h
  extern int GetProximityEvents(
      EventListPtr events,
      DeviceIntPtr pDev,
-@@ -530,6 +554,18 @@
+@@ -525,6 +549,18 @@
  extern _X_EXPORT InputAttributes *DuplicateInputAttributes(InputAttributes *attrs);
  extern _X_EXPORT void FreeInputAttributes(InputAttributes *attrs);
  
@@ -3983,7 +3983,7 @@ Index: xorg-server/include/inputstr.h
  
 @@ -284,6 +289,75 @@
      ValuatorAccelerationRec	accelScheme;
- } ValuatorClassRec;
+ } ValuatorClassRec, *ValuatorClassPtr;
  
 +typedef enum {
 +    TOUCH_GRAB,
@@ -4221,8 +4221,8 @@ Index: xorg-server/test/input.c
  }
  
  static void test_bits_to_byte(int i)
-@@ -1223,6 +1286,101 @@
-     free(v);
+@@ -1199,6 +1262,101 @@
+     }
  }
  
 +static void touch_create(void)
@@ -4323,7 +4323,7 @@ Index: xorg-server/test/input.c
  int main(int argc, char** argv)
  {
      g_test_init(&argc, &argv,NULL);
-@@ -1233,6 +1391,7 @@
+@@ -1209,6 +1367,7 @@
      g_test_add_func("/dix/input/init-valuators", dix_init_valuators);
      g_test_add_func("/dix/input/event-core-conversion", dix_event_to_core_conversion);
      g_test_add_func("/dix/input/event-xi1-conversion", dix_event_to_xi1_conversion);
@@ -4331,8 +4331,7 @@ Index: xorg-server/test/input.c
      g_test_add_func("/dix/input/check-grab-values", dix_check_grab_values);
      g_test_add_func("/dix/input/xi2-struct-sizes", xi2_struct_sizes);
      g_test_add_func("/dix/input/grab_matching", dix_grab_matching);
-@@ -1240,7 +1399,10 @@
-     g_test_add_func("/include/byte_padding_macros", include_byte_padding_macros);
+@@ -1216,6 +1375,9 @@
      g_test_add_func("/include/bit_test_macros", include_bit_test_macros);
      g_test_add_func("/Xi/xiproperty/register-unregister", xi_unregister_handlers);
      g_test_add_func("/dix/input/valuator-alloc", dix_valuator_alloc);

commit 79ef102c3adf7cae8982b05320109d0439e6587c
Author: Jon TURNEY <jon.turney@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@dronecode.org.uk>
    Signed-off-by: Jeremy Huddleston <jeremyhu@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@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@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@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@oracle.com>
    Signed-off-by: Cyril Brulebois <kibi@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;

commit 9fab8b475de99848866c07bde962a5f6ed01b987
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Fri Apr 15 14:06:20 2011 +1000

    input: Only release SD buttons for explicit floating/reattachment (#36146)
    
    Grabbing an SD device temporary floats the device but we must not release
    the buttons. Introduced in
    
        commit 9d23459415b84606ee4f38bb2d19054c432c8552
        Author: Peter Hutterer <peter.hutterer@who-t.net>
        Date:   Fri Feb 25 11:08:19 2011 +1000
    
        dix: release all buttons and keys before reattaching a device (#34182)
    
    X.Org Bug 36146 <http://bugs.freedesktop.org/show_bug.cgi?id=36146>
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
    (cherry picked from commit bf2059b07a97e5e579c13c2c9d49707093427dc2)
    
    Conflicts:
    
    	dix/devices.c

diff --git a/Xi/xichangehierarchy.c b/Xi/xichangehierarchy.c
index 21c74ed..15eb5c9 100644
--- a/Xi/xichangehierarchy.c
+++ b/Xi/xichangehierarchy.c
@@ -353,6 +353,7 @@ detach_slave(ClientPtr client, xXIDetachSlaveInfo *c, int flags[MAXDEVICES])
         goto unwind;
     }
 
+    ReleaseButtonsAndKeys(dev);
     AttachDevice(client, dev, NULL);
     flags[dev->id] |= XISlaveDetached;
 
@@ -404,6 +405,7 @@ attach_slave(ClientPtr client, xXIAttachSlaveInfo *c,
         goto unwind;
     }
 
+    ReleaseButtonsAndKeys(dev);
     AttachDevice(client, dev, newmaster);
     flags[dev->id] |= XISlaveAttached;
 
diff --git a/dix/devices.c b/dix/devices.c
index 827c328..aa391a1 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -2410,7 +2410,7 @@ RecalculateMasterButtons(DeviceIntPtr slave)
  * Generate release events for all keys/button currently down on this
  * device.
  */
-static void
+void
 ReleaseButtonsAndKeys(DeviceIntPtr dev)
 {
     EventListPtr        eventlist = InitEventList(GetMaximumEventsNum());
@@ -2479,8 +2479,6 @@ AttachDevice(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr master)
         free(dev->spriteInfo->sprite);
     }
 
-    ReleaseButtonsAndKeys(dev);
-
     oldmaster = dev->u.master;
     dev->u.master = master;
 
diff --git a/include/input.h b/include/input.h
index 908e595..95aae43 100644
--- a/include/input.h
+++ b/include/input.h
@@ -495,6 +495,8 @@ extern _X_EXPORT int GetMotionHistory(
     ScreenPtr pScreen,
     BOOL core);
 
+extern void ReleaseButtonsAndKeys(DeviceIntPtr dev);
+
 extern int AttachDevice(ClientPtr client,
                         DeviceIntPtr slave,
                         DeviceIntPtr master);

commit 160a412e36fd945119e4c10f5d22682fcd0cc637
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Fri Feb 25 11:08:19 2011 +1000

    dix: release all buttons and keys before reattaching a device (#34182)
    
    Testcase:
      xinput float <keyboard name>
    
    results in the keyboard's enter key being repeated as the device is detached
    while the key is still physically down. To avoid this, release all keys and
    buttons before reattaching the device.
    
    X.Org Bug 34182 <http://bugs.freedesktop.org/show_bug.cgi?id=34182>
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: Fernando Carrijo <fcarrijo@freedesktop.org>
    (cherry picked from commit 9d23459415b84606ee4f38bb2d19054c432c8552)
    (cherry picked from commit 81fbb96c54f78a7cd96433294ee003c7ef6a772a)

diff --git a/dix/devices.c b/dix/devices.c
index fed05f5..827c328 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -2407,6 +2407,46 @@ RecalculateMasterButtons(DeviceIntPtr slave)
 }
 
 /**
+ * Generate release events for all keys/button currently down on this
+ * device.
+ */
+static void
+ReleaseButtonsAndKeys(DeviceIntPtr dev)
+{
+    EventListPtr        eventlist = InitEventList(GetMaximumEventsNum());
+    ButtonClassPtr      b = dev->button;
+    KeyClassPtr         k = dev->key;
+    int                 i, j, nevents;
+
+    if (!eventlist) /* no release events for you */
+        return;
+
+    /* Release all buttons */
+    for (i = 0; b && i < b->numButtons; i++)
+    {
+        if (BitIsOn(b->down, i))
+        {
+            nevents = GetPointerEvents(eventlist, dev, ButtonRelease, i, 0, NULL);
+            for (j = 0; j < nevents; j++)
+                mieqProcessDeviceEvent(dev, (InternalEvent*)(eventlist+j)->event, NULL);
+        }
+    }
+
+    /* Release all keys */
+    for (i = 0; k && i < MAP_LENGTH; i++)
+    {
+        if (BitIsOn(k->down, i))
+        {
+            nevents = GetKeyboardEvents(eventlist, dev, KeyRelease, i);
+            for (j = 0; j < nevents; j++)
+                mieqProcessDeviceEvent(dev, (InternalEvent*)(eventlist+j)->event, NULL);
+        }
+    }
+
+    FreeEventList(eventlist, GetMaximumEventsNum());
+}
+
+/**
  * Attach device 'dev' to device 'master'.
  * Client is set to the client that issued the request, or NULL if it comes
  * from some internal automatic pairing.
@@ -2439,6 +2479,8 @@ AttachDevice(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr master)
         free(dev->spriteInfo->sprite);
     }
 
+    ReleaseButtonsAndKeys(dev);
+
     oldmaster = dev->u.master;
     dev->u.master = master;
 

commit c9336d13a6b231edf16412706c52318947fcd000
Author: Jeremy Huddleston <jeremyhu@apple.com>
Date:   Fri Jun 17 10:11:15 2011 -0700

    configure.ac: Bump version to 1.10.2.901 (1.10.3 RC1)
    
    Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>

diff --git a/configure.ac b/configure.ac
index 398d16f..9aa8211 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,8 +26,8 @@ dnl
 dnl Process this file with autoconf to create configure.
 
 AC_PREREQ(2.57)
-AC_INIT([xorg-server], 1.10.2, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
-RELEASE_DATE="2011-05-28"
+AC_INIT([xorg-server], 1.10.2.901, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
+RELEASE_DATE="2011-06-17"
 AC_CONFIG_SRCDIR([Makefile.am])
 AM_INIT_AUTOMAKE([foreign dist-bzip2])
 AM_MAINTAINER_MODE

commit 0abfba08a080747b1a6310c19f3bea74a6460363
Author: Jeremy Huddleston <jeremyhu@apple.com>
Date:   Thu Jun 2 20:04:04 2011 -0700

    XQuartz: GLX: Use _glapi_create_table_from_handle to create out dispatch table
    
    This will allow XQuartz built on older systems to pickup capabilities on
    newer systems and prevent runtime failures when building on newer systems and
    running on older ones.
    
    Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
    
    This commit squashes three cherry-picks:
    (cherry picked from commit 3fa5d27e46ea8af55dcaaad7a99973c38bd11967)
    (cherry picked from commit feab04397de2684568dedaaaa8f299cac9f44f8b)
    (cherry picked from commit 34e2598f0ad247071bd6a4312d9014d6e3b2305a)

diff --git a/hw/xquartz/GL/indirect.c b/hw/xquartz/GL/indirect.c
index db4fe83..c46ba9d 100644
--- a/hw/xquartz/GL/indirect.c
+++ b/hw/xquartz/GL/indirect.c
@@ -2,7 +2,7 @@
  * GLX implementation that uses Apple's OpenGL.framework
  * (Indirect rendering path -- it's also used for some direct mode code too)
  *
- * Copyright (c) 2007, 2008, 2009 Apple Inc.
+ * Copyright (c) 2007-2011 Apple Inc.
  * Copyright (c) 2004 Torrey T. Lyons. All Rights Reserved.
  * Copyright (c) 2002 Greg Parker. All Rights Reserved.
  *
@@ -35,126 +35,28 @@
 #include <dix-config.h>
 #endif
 
-#include "dri.h"
-
 #include <AvailabilityMacros.h>
 
-#define GL_GLEXT_WUNDEF_SUPPORT
+#include <dlfcn.h>
 
 #include <OpenGL/OpenGL.h>
-#include <OpenGL/gl.h>
-#include <OpenGL/glext.h>
-#include <OpenGL/CGLContext.h>
-
-/* These next few GL_EXT pre-processing blocks are to explicitly define 
- * these symbols to 0 if they are not set by OpenGL.framework.  This
- * prevents the X11 glext.h from setting them to 1.
- */
-
-#ifndef GL_EXT_fragment_shader
-#define GL_EXT_fragment_shader 0
-#endif
-
-#ifndef GL_EXT_blend_equation_separate
-#define GL_EXT_blend_equation_separate 0
-#endif
-
-#ifndef GL_EXT_blend_func_separate
-#define GL_EXT_blend_func_separate 0
-#endif
-
-#ifndef GL_EXT_depth_bounds_test
-#define GL_EXT_depth_bounds_test 0
-#endif
-
-#ifndef GL_EXT_compiled_vertex_array
-#define GL_EXT_compiled_vertex_array 0
-#endif
-
-#ifndef GL_EXT_cull_vertex
-#define GL_EXT_cull_vertex 0
-#endif
-
-#ifndef GL_EXT_fog_coord
-#define GL_EXT_fog_coord 0
-#endif
-
-#ifndef GL_EXT_framebuffer_blit
-#define GL_EXT_framebuffer_blit 0
-#endif
-
-#ifndef GL_EXT_framebuffer_object
-#define GL_EXT_framebuffer_object 0
-#endif
-
-#ifndef GL_EXT_gpu_program_parameters
-#define GL_EXT_gpu_program_parameters 0
-#endif
-
-#ifndef GL_EXT_multi_draw_arrays
-#define GL_EXT_multi_draw_arrays 0
-#endif
-
-#ifndef GL_EXT_point_parameters
-#define GL_EXT_point_parameters 0
-#endif
-
-#ifndef GL_EXT_polygon_offset
-#define GL_EXT_polygon_offset 0
-#endif
-
-#ifndef GL_EXT_secondary_color
-#define GL_EXT_secondary_color 0
-#endif
-
-#ifndef GL_EXT_stencil_two_side
-#define GL_EXT_stencil_two_side 0
-#endif
-
-#ifndef GL_EXT_timer_query
-#define GL_EXT_timer_query 0
-#endif
-
-#ifndef GL_EXT_vertex_array
-#define GL_EXT_vertex_array 0
-#endif
-
-/* Tiger PPC doesn't have the associated symbols, but glext.h says it does.  Liars!
- * http://trac.macports.org/ticket/20638
- */
-#if defined(__ppc__) && MAC_OS_X_VERSION_MIN_REQUIRED < 1050
-#undef GL_EXT_gpu_program_parameters
-#define GL_EXT_gpu_program_parameters 0
-#endif
+#include <OpenGL/gl.h>     /* Just to prevent glxserver.h from loading mesa's and colliding with OpenGL.h */
 
+#include <X11/Xproto.h>
 #include <GL/glxproto.h>
-#include <windowstr.h>
-#include <resource.h>
-#include <GL/glxint.h>
-#include <GL/glxtokens.h>
-#include <scrnintstr.h>
+
 #include <glxserver.h>
-#include <glxscreens.h>
-#include <glxdrawable.h>
-#include <glxcontext.h>
-#include <glxext.h>
 #include <glxutil.h>
-#include <glxscreens.h>
-#include <GL/internal/glcore.h>
-#include "x-hash.h"
-#include "x-list.h"
-
-//#include "capabilities.h"
-#include "visualConfigs.h"
 
 typedef unsigned long long GLuint64EXT;
 typedef long long GLint64EXT;
 #include <dispatch.h>
-#include <Xplugin.h>
 #include <glapi.h>
-#include <glapitable.h>
 
-__GLXprovider * GlxGetDRISWrastProvider (void);
+#include "x-hash.h"
+
+#include "visualConfigs.h"
+#include "dri.h"
 
 // Write debugging output, or not
 #ifdef GLAQUA_DEBUG
@@ -163,6 +65,8 @@ __GLXprovider * GlxGetDRISWrastProvider (void);
 #define GLAQUA_DEBUG_MSG(a, ...)
 #endif
 
+__GLXprovider * GlxGetDRISWrastProvider (void);
+
 static void setup_dispatch_table(void);
 GLuint __glFloorLog2(GLuint val);
 void warn_func(void * p1, char *format, ...);
@@ -681,959 +585,36 @@ GLuint __glFloorLog2(GLuint val)
     return c;
 }
 
+#ifndef OPENGL_FRAMEWORK_PATH
+#define OPENGL_FRAMEWORK_PATH "/System/Library/Frameworks/OpenGL.framework/OpenGL"
+#endif
+
 static void setup_dispatch_table(void) {
     static struct _glapi_table *disp = NULL;
+    static void *handle;
+    const char *opengl_framework_path;
 
     if(disp)  {
         _glapi_set_dispatch(disp);
         return;
     }
 
-    disp=calloc(1,sizeof(struct _glapi_table));
-    assert(disp);
-
-    /* to update:
-     * for f in $(grep 'define SET_' ../../../glx/dispatch.h  | cut -f2 -d' ' | cut -f1 -d\( | sort -u); do grep -q $f indirect.c || echo $f ; done | grep -v by_offset | sed 's:SET_\(.*\)$:SET_\1(disp, gl\1)\;:' | pbcopy
-     */
-
-    SET_Accum(disp, glAccum);
-    SET_AlphaFunc(disp, glAlphaFunc);
-    SET_AreTexturesResident(disp, glAreTexturesResident);
-    SET_ArrayElement(disp, glArrayElement);
-    SET_Begin(disp, glBegin);
-    SET_BindTexture(disp, glBindTexture);
-    SET_Bitmap(disp, glBitmap);
-    SET_BlendColor(disp, glBlendColor);
-    SET_BlendEquation(disp, glBlendEquation);
-    SET_BlendFunc(disp, glBlendFunc);
-    SET_CallList(disp, glCallList);
-    SET_CallLists(disp, glCallLists);
-    SET_Clear(disp, glClear);
-    SET_ClearAccum(disp, glClearAccum);
-    SET_ClearColor(disp, glClearColor);
-    SET_ClearDepth(disp, glClearDepth);
-    SET_ClearIndex(disp, glClearIndex);
-    SET_ClearStencil(disp, glClearStencil);
-    SET_ClipPlane(disp, glClipPlane);
-    SET_Color3b(disp, glColor3b);
-    SET_Color3bv(disp, glColor3bv);
-    SET_Color3d(disp, glColor3d);
-    SET_Color3dv(disp, glColor3dv);
-    SET_Color3f(disp, glColor3f);
-    SET_Color3fv(disp, glColor3fv);
-    SET_Color3i(disp, glColor3i);
-    SET_Color3iv(disp, glColor3iv);
-    SET_Color3s(disp, glColor3s);
-    SET_Color3sv(disp, glColor3sv);
-    SET_Color3ub(disp, glColor3ub);
-    SET_Color3ubv(disp, glColor3ubv);
-    SET_Color3ui(disp, glColor3ui);
-    SET_Color3uiv(disp, glColor3uiv);
-    SET_Color3us(disp, glColor3us);
-    SET_Color3usv(disp, glColor3usv);
-    SET_Color4b(disp, glColor4b);
-    SET_Color4bv(disp, glColor4bv);
-    SET_Color4d(disp, glColor4d);
-    SET_Color4dv(disp, glColor4dv);
-    SET_Color4f(disp, glColor4f);
-    SET_Color4fv(disp, glColor4fv);
-    SET_Color4i(disp, glColor4i);
-    SET_Color4iv(disp, glColor4iv);
-    SET_Color4s(disp, glColor4s);
-    SET_Color4sv(disp, glColor4sv);
-    SET_Color4ub(disp, glColor4ub);
-    SET_Color4ubv(disp, glColor4ubv);
-    SET_Color4ui(disp, glColor4ui);
-    SET_Color4uiv(disp, glColor4uiv);
-    SET_Color4us(disp, glColor4us);
-    SET_Color4usv(disp, glColor4usv);
-    SET_ColorMask(disp, glColorMask);
-    SET_ColorMaterial(disp, glColorMaterial);
-    SET_ColorPointer(disp, glColorPointer);
-    SET_ColorSubTable(disp, glColorSubTable);
-    SET_ColorTable(disp, glColorTable);
-    SET_ColorTableParameterfv(disp, glColorTableParameterfv);
-    SET_ColorTableParameteriv(disp, glColorTableParameteriv);
-    SET_ConvolutionFilter1D(disp, glConvolutionFilter1D);
-    SET_ConvolutionFilter2D(disp, glConvolutionFilter2D);
-    SET_ConvolutionParameterf(disp, glConvolutionParameterf);
-    SET_ConvolutionParameterfv(disp, glConvolutionParameterfv);
-    SET_ConvolutionParameteri(disp, glConvolutionParameteri);
-    SET_ConvolutionParameteriv(disp, glConvolutionParameteriv);
-    SET_CopyColorSubTable(disp, glCopyColorSubTable);
-    SET_CopyColorTable(disp, glCopyColorTable);
-    SET_CopyConvolutionFilter1D(disp, glCopyConvolutionFilter1D);
-    SET_CopyConvolutionFilter2D(disp, glCopyConvolutionFilter2D);
-    SET_CopyPixels(disp, glCopyPixels);
-    SET_CopyTexImage1D(disp, glCopyTexImage1D);
-    SET_CopyTexImage2D(disp, glCopyTexImage2D);
-    SET_CopyTexSubImage1D(disp, glCopyTexSubImage1D);
-    SET_CopyTexSubImage2D(disp, glCopyTexSubImage2D);
-    SET_CopyTexSubImage3D(disp, glCopyTexSubImage3D);
-    SET_CullFace(disp, glCullFace);
-    SET_DeleteLists(disp, glDeleteLists);
-    SET_DeleteTextures(disp, glDeleteTextures);
-    SET_DepthFunc(disp, glDepthFunc);
-    SET_DepthMask(disp, glDepthMask);
-    SET_DepthRange(disp, glDepthRange);


Reply to: