xserver: Branch 'master' - 2 commits

Jeremy Huddleston jeremyhu at kemper.freedesktop.org
Thu Mar 27 19:16:54 PDT 2008


 hw/xquartz/darwinEvents.c |    3 
 hw/xquartz/darwinXinput.c |  186 ++++++++++++++--------------------------------
 2 files changed, 62 insertions(+), 127 deletions(-)

New commits:
commit c1d37efe9aae5f2895b3437418f7e4bb2eb3400f
Author: Ben Byer <bbyer at bushing.apple.com>
Date:   Tue Mar 25 19:25:00 2008 -0700

    xquartz: copy in new stubs from Xi/stubs.c to replace our old
    Xinput stubs.  Hey, it's a start.
    (cherry picked from commit 566412b4aece24ae6af8c7c835986b685aa456a2)

diff --git a/hw/xquartz/darwinXinput.c b/hw/xquartz/darwinXinput.c
index e62ec0a..50ba656 100644
--- a/hw/xquartz/darwinXinput.c
+++ b/hw/xquartz/darwinXinput.c
@@ -1,8 +1,7 @@
-
 /*
- * X server support of the XINPUT extension for Darwin
+ * X server support of the XINPUT extension for xquartz
  *
- * This is currently a copy of mi/stubs.c, but eventually this
+ * This is currently a copy of Xi/stubs.c, but eventually this
  * should include more complete XINPUT support.
  */
 
@@ -52,100 +51,17 @@ SOFTWARE.
 
 ********************************************************/
 
+#define	 NEED_EVENTS
 #ifdef HAVE_DIX_CONFIG_H
 #include <dix-config.h>
 #endif
 
-#define	 NEED_EVENTS
 #include <X11/X.h>
 #include <X11/Xproto.h>
 #include "inputstr.h"
 #include <X11/extensions/XI.h>
 #include <X11/extensions/XIproto.h>
 #include "XIstubs.h"
-#include "chgkbd.h"
-
-/***********************************************************************
- *
- * Caller:	ProcXChangeKeyboardDevice
- *
- * This procedure does the implementation-dependent portion of the work
- * needed to change the keyboard device.
- *
- * The X keyboard device has a FocusRec.  If the device that has been 
- * made into the new X keyboard did not have a FocusRec, 
- * ProcXChangeKeyboardDevice will allocate one for it.
- *
- * If you do not want clients to be able to focus the old X keyboard
- * device, call DeleteFocusClassDeviceStruct to free the FocusRec.
- *
- * If you support input devices with keys that you do not want to be 
- * used as the X keyboard, you need to check for them here and return 
- * a BadDevice error.
- *
- * The default implementation is to do nothing (assume you do want
- * clients to be able to focus the old X keyboard).  The commented-out
- * sample code shows what you might do if you don't want the default.
- *
- */
-
-int ChangeKeyboardDevice (DeviceIntPtr old_dev, DeviceIntPtr new_dev) {
-    /***********************************************************************
-     DeleteFocusClassDeviceStruct(old_dev);	 * defined in xchgptr.c *
-    **********************************************************************/
-    return BadMatch;
-}
-
-
-/***********************************************************************
- *
- * Caller:	ProcXChangePointerDevice
- *
- * This procedure does the implementation-dependent portion of the work
- * needed to change the pointer device.
- *
- * The X pointer device does not have a FocusRec.  If the device that
- * has been made into the new X pointer had a FocusRec, 
- * ProcXChangePointerDevice will free it.
- *
- * If you want clients to be able to focus the old pointer device that
- * has now become accessible through the input extension, you need to 
- * add a FocusRec to it here.
- *
- * The XChangePointerDevice protocol request also allows the client
- * to choose which axes of the new pointer device are used to move 
- * the X cursor in the X- and Y- directions.  If the axes are different
- * than the default ones, you need to keep track of that here.
- *
- * If you support input devices with valuators that you do not want to be 
- * used as the X pointer, you need to check for them here and return a 
- * BadDevice error.
- *
- * The default implementation is to do nothing (assume you don't want
- * clients to be able to focus the old X pointer).  The commented-out
- * sample code shows what you might do if you don't want the default.
- *
- */
-
-int
-ChangePointerDevice (
-    DeviceIntPtr	old_dev,
-    DeviceIntPtr	new_dev,
-    unsigned char	x,
-    unsigned char	y)
-    {
-    /***********************************************************************
-    InitFocusClassDeviceStruct(old_dev);	* allow focusing old ptr*
-
-    x_axis = x;					* keep track of new x-axis*
-    y_axis = y;					* keep track of new y-axis*
-    if (x_axis != 0 || y_axis != 1)
-	axes_changed = TRUE;			* remember axes have changed*
-    else
-	axes_changed = FALSE;
-    *************************************************************************/
-    return BadMatch;
-    }
 
 /***********************************************************************
  *
@@ -161,11 +77,9 @@ ChangePointerDevice (
  */
 
 void
-CloseInputDevice (d, client)
-    DeviceIntPtr d;
-    ClientPtr client;
-    {
-    }
+CloseInputDevice(DeviceIntPtr d, ClientPtr client)
+{
+}
 
 /***********************************************************************
  *
@@ -194,8 +108,8 @@ CloseInputDevice (d, client)
  */
 
 void
-AddOtherInputDevices ()
-    {
+AddOtherInputDevices(void)
+{
     /**********************************************************************
      for each uninitialized device, do something like: 
 
@@ -209,7 +123,7 @@ AddOtherInputDevices ()
     dev->inited = ((*dev->deviceProc)(dev, DEVICE_INIT) == Success);
     ************************************************************************/
 
-    }
+}
 
 /***********************************************************************
  *
@@ -234,12 +148,9 @@ AddOtherInputDevices ()
  */
 
 void
-OpenInputDevice (dev, client, status)
-    DeviceIntPtr dev;
-    ClientPtr client;
-    int *status;
-    {
-    }
+OpenInputDevice(DeviceIntPtr dev, ClientPtr client, int *status)
+{
+}
 
 /****************************************************************************
  *
@@ -254,13 +165,10 @@ OpenInputDevice (dev, client, status)
  */
 
 int
-SetDeviceMode (client, dev, mode)
-    register	ClientPtr	client;
-    DeviceIntPtr dev;
-    int		mode;
-    {
+SetDeviceMode(ClientPtr client, DeviceIntPtr dev, int mode)
+{
     return BadMatch;
-    }
+}
 
 /****************************************************************************
  *
@@ -275,15 +183,11 @@ SetDeviceMode (client, dev, mode)
  */
 
 int
-SetDeviceValuators (client, dev, valuators, first_valuator, num_valuators)
-    register	ClientPtr	client;
-    DeviceIntPtr dev;
-    int		*valuators;
-    int		first_valuator;
-    int		num_valuators;
-    {
+SetDeviceValuators(ClientPtr client, DeviceIntPtr dev,
+		   int *valuators, int first_valuator, int num_valuators)
+{
     return BadMatch;
-    }
+}
 
 /****************************************************************************
  *
@@ -294,16 +198,44 @@ SetDeviceValuators (client, dev, valuators, first_valuator, num_valuators)
  */
 
 int
-ChangeDeviceControl (client, dev, control)
-    register	ClientPtr	client;
-    DeviceIntPtr dev;
-    xDeviceCtl	*control;
-    {
-    switch (control->control)
-	{
-	case DEVICE_RESOLUTION:
-	    return (BadMatch);
-	default:
-	    return (BadMatch);
-	}
+ChangeDeviceControl(ClientPtr client, DeviceIntPtr dev,
+		    xDeviceCtl * control)
+{
+    switch (control->control) {
+    case DEVICE_RESOLUTION:
+	return (BadMatch);
+    case DEVICE_ABS_CALIB:
+    case DEVICE_ABS_AREA:
+        return (BadMatch);
+    case DEVICE_CORE:
+        return (BadMatch);
+    default:
+	return (BadMatch);
     }
+}
+
+
+/****************************************************************************
+ *
+ * Caller: configAddDevice (and others)
+ *
+ * Add a new device with the specified options.
+ *
+ */
+int
+NewInputDeviceRequest(InputOption *options, DeviceIntPtr *pdev)
+{
+    return BadValue;
+}
+
+/****************************************************************************
+ *
+ * Caller: configRemoveDevice (and others)
+ *
+ * Remove the specified device previously added.
+ *
+ */
+void
+DeleteInputDeviceRequest(DeviceIntPtr dev)
+{
+}
commit c4a616a741e15865ce0ff98781c6f1dca4d62887
Author: Ben Byer <bbyer at bushing.apple.com>
Date:   Mon Mar 24 22:43:10 2008 -0700

    prevent "fake mouse clicks" from generating spurious extra events
    (cherry picked from commit bd85a24969427e41389688663ead2d4dd41c9999)

diff --git a/hw/xquartz/darwinEvents.c b/hw/xquartz/darwinEvents.c
index 827fd81..22d8957 100644
--- a/hw/xquartz/darwinEvents.c
+++ b/hw/xquartz/darwinEvents.c
@@ -391,10 +391,12 @@ void DarwinSendPointerEvents(int ev_type, int ev_button, int pointer_x, int poin
       DarwinSimulateMouseClick(pointer_x, pointer_y, 2, darwinFakeMouse2Mask);
       darwinFakeMouseButtonDown = 2;
       darwinFakeMouseButtonMask = darwinFakeMouse2Mask;
+      return;
     } else if ((old_flags & darwinFakeMouse3Mask) == darwinFakeMouse3Mask) {
       DarwinSimulateMouseClick(pointer_x, pointer_y, 3, darwinFakeMouse3Mask);
       darwinFakeMouseButtonDown = 3;
       darwinFakeMouseButtonMask = darwinFakeMouse3Mask;
+      return;
     }
   }
   if (ev_type == ButtonRelease && darwinFakeButtons && darwinFakeMouseButtonDown) {
@@ -406,6 +408,7 @@ void DarwinSendPointerEvents(int ev_type, int ev_button, int pointer_x, int poin
     // Bring modifiers back up to date
     DarwinUpdateModifiers(KeyPress, darwinFakeMouseButtonMask & old_flags);
     darwinFakeMouseButtonMask = 0;
+    return;
   } 
 
   num_events = GetPointerEvents(darwinEvents, darwinPointer, ev_type, ev_button, 


More information about the xorg-commit mailing list