summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Huddleston <jeremyhu@freedesktop.org>2008-12-10 15:04:59 -0800
committerJeremy Huddleston <jeremyhu@freedesktop.org>2008-12-10 15:04:59 -0800
commite45877e05eb650ba0d6920133d084edf936f6580 (patch)
treedd8f2d6407ab384a56a925aa1b89a3af30a0869e
parent8065953ea8c3b7d10c775f6b7fec629bb5a2c83c (diff)
parent523aae1fa6d8002e55e85aee49f113b7eb9a6df3 (diff)
Merge commit 'origin/server-1.6-branch' into xorg-server-1.6-apple
-rw-r--r--Xi/exevents.c2
-rw-r--r--Xi/xiproperty.c2
-rw-r--r--configure.ac25
-rw-r--r--dix/getevents.c6
-rw-r--r--glx/Makefile.am4
-rw-r--r--hw/dmx/input/dmxinputinit.c2
-rw-r--r--hw/xfree86/common/xf86Config.c5
-rw-r--r--hw/xfree86/common/xf86InPriv.h2
-rw-r--r--hw/xfree86/common/xf86Init.c8
-rw-r--r--hw/xfree86/common/xf86Xinput.c29
-rw-r--r--hw/xfree86/common/xf86Xinput.h4
-rw-r--r--hw/xfree86/doc/man/xorg.conf.man.pre2
-rw-r--r--hw/xfree86/modes/xf86Crtc.c38
-rw-r--r--hw/xfree86/modes/xf86Crtc.h36
-rw-r--r--hw/xfree86/modes/xf86RandR12.c233
-rw-r--r--hw/xfree86/modes/xf86Rotate.c2
-rw-r--r--include/exevents.h2
-rw-r--r--randr/randrstr.h19
-rw-r--r--randr/rrcrtc.c158
-rw-r--r--randr/rrdispatch.c2
-rw-r--r--randr/rrsdispatch.c68
-rw-r--r--xkb/ddxCtrls.c20
22 files changed, 607 insertions, 62 deletions
diff --git a/Xi/exevents.c b/Xi/exevents.c
index 00a6b2151..a976802a2 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -150,7 +150,7 @@ XIGetDevice(xEvent* xE)
int rc;
int id;
- id = ((deviceKeyButtonPointer*)xE)->deviceid;
+ id = ((deviceKeyButtonPointer*)xE)->deviceid & ~MORE_EVENTS;
rc = dixLookupDevice(&pDev, id, serverClient, DixUnknownAccess);
if (rc != Success)
diff --git a/Xi/xiproperty.c b/Xi/xiproperty.c
index 2ff5cae9f..01db856bf 100644
--- a/Xi/xiproperty.c
+++ b/Xi/xiproperty.c
@@ -121,7 +121,7 @@ XIRegisterPropertyHandler(DeviceIntPtr dev,
}
void
-XIUnRegisterPropertyHandler(DeviceIntPtr dev, long id)
+XIUnregisterPropertyHandler(DeviceIntPtr dev, long id)
{
XIPropertyHandlerPtr curr, prev = NULL;
diff --git a/configure.ac b/configure.ac
index c7dc10dc1..486dad869 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,7 +26,7 @@ dnl
dnl Process this file with autoconf to create configure.
AC_PREREQ(2.57)
-AC_INIT([xorg-server], 1.5.99.2, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
+AC_INIT([xorg-server], 1.5.99.3, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
AC_CONFIG_SRCDIR([Makefile.am])
AM_INIT_AUTOMAKE([dist-bzip2 foreign])
AM_MAINTAINER_MODE
@@ -312,7 +312,6 @@ case $host_cpu in
i*86)
I386_VIDEO=yes
case $host_os in
- *linux*) DEFAULT_INT10=vm86 ;;
*freebsd*) AC_DEFINE(USE_DEV_IO) ;;
*dragonfly*) AC_DEFINE(USE_DEV_IO) ;;
*netbsd*) AC_DEFINE(USE_I386_IOPL)
@@ -870,6 +869,28 @@ if test "x$DRI" = xyes || test "x$DRI2" = xyes; then
AC_SUBST(LIBDRM_LIBS)
fi
+if test "x$DRI2" = xyes; then
+ save_CFLAGS=$CFLAGS
+ CFLAGS="$GL_CFLAGS $LIBDRM_CFLAGS -Wall"
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <GL/gl.h>
+#include <GL/internal/dri_interface.h>
+#ifndef __DRI_DRI2
+#error DRI2 extension not available.
+#endif]])],
+ [HAVE_DRI2EXTENSION=yes],
+ [HAVE_DRI2EXTENSION=no])
+ CFLAGS=$save_CFLAGS
+ if test "x$HAVE_DRI2EXTENSION" = xyes; then
+ AC_DEFINE(DRI2_AIGLX, 1, [Build DRI2 AIGLX loader])
+ DRI2_AIGLX=yes
+ else
+ AC_MSG_NOTICE([DRI2 AIGLX disabled, __DRI_DRI2 not defined in dri_interface.h.])
+ DRI2_AIGLX=no
+ fi
+fi
+AM_CONDITIONAL(DRI2_AIGLX, test "x$DRI2_AIGLX" == xyes)
+
+
AM_CONDITIONAL(XINERAMA, [test "x$XINERAMA" = xyes])
if test "x$XINERAMA" = xyes; then
AC_DEFINE(XINERAMA, 1, [Support Xinerama extension])
diff --git a/dix/getevents.c b/dix/getevents.c
index 82be5e9bc..9592d4cc5 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -728,9 +728,9 @@ static int
countValuatorEvents(int num_valuators)
{
if (num_valuators) {
- if ((num_valuators / 6) + 1 > MAX_VALUATOR_EVENTS)
- num_valuators = MAX_VALUATOR_EVENTS;
- return (num_valuators / 6) + 1;
+ if (((num_valuators - 1) / 6) + 1 > MAX_VALUATOR_EVENTS)
+ num_valuators = MAX_VALUATOR_EVENTS * 6;
+ return ((num_valuators - 1)/ 6) + 1;
} else
return 0;
}
diff --git a/glx/Makefile.am b/glx/Makefile.am
index 8c705a74f..bec35bf21 100644
--- a/glx/Makefile.am
+++ b/glx/Makefile.am
@@ -24,7 +24,7 @@ INCLUDES = \
-I$(top_srcdir)/hw/xfree86/dri \
-I$(top_srcdir)/mi
-if DRI2
+if DRI2_AIGLX
INCLUDES += -I$(top_srcdir)/hw/xfree86/dri2
endif
@@ -53,7 +53,7 @@ libglxdri_la_SOURCES = \
extension_string.c \
extension_string.h
-if DRI2
+if DRI2_AIGLX
libglxdri_la_SOURCES += glxdri2.c
endif
diff --git a/hw/dmx/input/dmxinputinit.c b/hw/dmx/input/dmxinputinit.c
index a0eb80fe9..77f8ed5fc 100644
--- a/hw/dmx/input/dmxinputinit.c
+++ b/hw/dmx/input/dmxinputinit.c
@@ -865,7 +865,7 @@ static void dmxInputScanForExtensions(DMXInputInfo *dmxInput, int doXI)
/* Print out information about the XInput Extension. */
handler = XSetExtensionErrorHandler(dmxInputExtensionErrorHandler);
- ext = XQueryInputVersion(display, XI_2_Major, XI_2_Minor);
+ ext = XGetExtensionVersion(display, INAME);
XSetExtensionErrorHandler(handler);
if (!ext || ext == (XExtensionVersion *)NoSuchExtension) {
diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index 977100896..f530ec4be 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -2460,13 +2460,14 @@ checkInput(serverLayoutPtr layout, Bool implicit_layout) {
while(*dev)
{
if (strcmp((*dev)->driver, "kbd") == 0 ||
- strcmp((*dev)->driver, "mouse") == 0)
+ strcmp((*dev)->driver, "mouse") == 0 ||
+ strcmp((*dev)->driver, "vmmouse") == 0)
{
IDevPtr *current;
if (!warned)
{
xf86Msg(X_WARNING, "AllowEmptyInput is on, devices using "
- "drivers 'kbd' or 'mouse' will be disabled.\n");
+ "drivers 'kbd', 'mouse' or 'vmmouse' will be disabled.\n");
warned = TRUE;
}
diff --git a/hw/xfree86/common/xf86InPriv.h b/hw/xfree86/common/xf86InPriv.h
index 62e4820cb..3838d6940 100644
--- a/hw/xfree86/common/xf86InPriv.h
+++ b/hw/xfree86/common/xf86InPriv.h
@@ -38,7 +38,7 @@ extern InputDriverPtr *xf86InputDriverList;
extern int xf86NumInputDrivers;
/* xf86Xinput.c */
-void xf86ActivateDevice(InputInfoPtr pInfo);
+int xf86ActivateDevice(InputInfoPtr pInfo);
/* xf86Helper.c */
InputDriverPtr xf86LookupInputDriver(const char *name);
diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
index 922e7b35d..236c00ba2 100644
--- a/hw/xfree86/common/xf86Init.c
+++ b/hw/xfree86/common/xf86Init.c
@@ -1315,6 +1315,8 @@ InitInput(argc, argv)
xf86Info.vtRequestsPending = FALSE;
+ mieqInit();
+
/* Call the PreInit function for each input device instance. */
for (pDev = xf86ConfigLayout.inputs; pDev && *pDev; pDev++) {
/* Replace obsolete keyboard driver with kbd */
@@ -1322,10 +1324,10 @@ InitInput(argc, argv)
strcpy((*pDev)->driver, "kbd");
}
- xf86NewInputDevice(*pDev, &dev, TRUE);
+ /* If one fails, the others will too */
+ if (xf86NewInputDevice(*pDev, &dev, TRUE) == BadAlloc)
+ break;
}
-
- mieqInit();
}
/*
diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c
index 2cb41e599..9558b7742 100644
--- a/hw/xfree86/common/xf86Xinput.c
+++ b/hw/xfree86/common/xf86Xinput.c
@@ -287,12 +287,13 @@ xf86ProcessCommonOptions(LocalDevicePtr local,
/***********************************************************************
*
* xf86ActivateDevice --
- *
+ *
* Initialize an input device.
*
+ * Returns TRUE on success, or FALSE otherwise.
***********************************************************************
*/
-_X_EXPORT void
+_X_EXPORT int
xf86ActivateDevice(LocalDevicePtr local)
{
DeviceIntPtr dev;
@@ -301,8 +302,13 @@ xf86ActivateDevice(LocalDevicePtr local)
dev = AddInputDevice(serverClient, local->device_control, TRUE);
if (dev == NULL)
- FatalError("Too many input devices");
-
+ {
+ xf86Msg(X_ERROR, "Too many input devices. Ignoring %s\n",
+ local->name);
+ local->dev = NULL;
+ return FALSE;
+ }
+
local->atom = MakeAtom(local->type_name,
strlen(local->type_name),
TRUE);
@@ -334,6 +340,8 @@ xf86ActivateDevice(LocalDevicePtr local)
xf86Msg(X_INFO, "XINPUT: Adding extended input device \"%s\" (type: %s)\n",
local->name, local->type_name);
}
+
+ return TRUE;
}
@@ -470,6 +478,13 @@ AddOtherInputDevices()
/**
* Create a new input device, activate and enable it.
*
+ * Possible return codes:
+ * BadName .. a bad driver name was supplied.
+ * BadImplementation ... The driver does not have a PreInit function. This
+ * is a driver bug.
+ * BadMatch .. device initialization failed.
+ * BadAlloc .. too many input devices
+ *
* @param idev The device, already set up with identifier, driver, and the
* options.
* @param pdev Pointer to the new device, if Success was reported.
@@ -519,7 +534,11 @@ xf86NewInputDevice(IDevPtr idev, DeviceIntPtr *pdev, BOOL enable)
goto unwind;
}
- xf86ActivateDevice(pInfo);
+ if (!xf86ActivateDevice(pInfo))
+ {
+ rval = BadAlloc;
+ goto unwind;
+ }
dev = pInfo->dev;
ActivateDevice(dev);
diff --git a/hw/xfree86/common/xf86Xinput.h b/hw/xfree86/common/xf86Xinput.h
index 28a331594..2ca2073f9 100644
--- a/hw/xfree86/common/xf86Xinput.h
+++ b/hw/xfree86/common/xf86Xinput.h
@@ -170,9 +170,7 @@ void xf86PostKeyEvent(DeviceIntPtr device, unsigned int key_code, int is_down,
...);
void xf86PostKeyboardEvent(DeviceIntPtr device, unsigned int key_code,
int is_down);
-void xf86ActivateDevice(LocalDevicePtr local);
-Bool xf86CheckButton(int button, int down);
-void xf86SwitchCoreDevice(LocalDevicePtr device, DeviceIntPtr core);
+int xf86ActivateDevice(LocalDevicePtr local);
LocalDevicePtr xf86FirstLocalDevice(void);
int xf86ScaleAxis(int Cx, int Sxhigh, int Sxlow, int Rxhigh, int Rxlow);
void xf86XInputSetScreen(LocalDevicePtr local, int screen_number, int x, int y);
diff --git a/hw/xfree86/doc/man/xorg.conf.man.pre b/hw/xfree86/doc/man/xorg.conf.man.pre
index 4f1ba003b..d9a4b35f6 100644
--- a/hw/xfree86/doc/man/xorg.conf.man.pre
+++ b/hw/xfree86/doc/man/xorg.conf.man.pre
@@ -662,7 +662,7 @@ the X server to load. Disabled by default.
If enabled, don't add the standard keyboard and mouse drivers, if there are no
input devices in the config file. Enabled by default if AutoAddDevices and
AutoEnableDevices is enabled, otherwise disabled.
-If AllowEmptyInput is on, devices using the kbd or mouse driver are ignored.
+If AllowEmptyInput is on, devices using the kbd, mouse or vmmouse driver are ignored.
.TP 7
.BI "Option \*qAutoAddDevices\*q \*q" boolean \*q
If this option is disabled, then no devices will be added from HAL events.
diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index fe9d7b067..97176200e 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -96,6 +96,7 @@ xf86CrtcCreate (ScrnInfoPtr scrn,
crtc = xcalloc (sizeof (xf86CrtcRec), 1);
if (!crtc)
return NULL;
+ crtc->version = XF86_CRTC_VERSION;
crtc->scrn = scrn;
crtc->funcs = funcs;
#ifdef RANDR_12_INTERFACE
@@ -112,6 +113,8 @@ xf86CrtcCreate (ScrnInfoPtr scrn,
crtc->filter_width = 0;
crtc->filter_height = 0;
crtc->transform_in_use = FALSE;
+ crtc->transformPresent = FALSE;
+ crtc->desiredTransformPresent = FALSE;
memset (&crtc->bounds, '\0', sizeof (crtc->bounds));
if (xf86_config->crtc)
@@ -241,6 +244,8 @@ xf86CrtcSetModeTransform (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotati
RRTransformPtr transform, int x, int y)
{
ScrnInfoPtr scrn = crtc->scrn;
+ /* During ScreenInit() scrn->pScreen is still NULL */
+ ScreenPtr pScreen = screenInfo.screens[scrn->scrnIndex];
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
int i;
Bool ret = FALSE;
@@ -254,9 +259,9 @@ xf86CrtcSetModeTransform (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotati
if (crtc->funcs->set_mode_major)
return crtc->funcs->set_mode_major(crtc, mode, rotation, x, y);
-
+
crtc->enabled = xf86CrtcInUse (crtc);
-
+
if (!crtc->enabled)
{
/* XXX disable crtc? */
@@ -290,6 +295,11 @@ xf86CrtcSetModeTransform (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotati
} else
crtc->transformPresent = FALSE;
+ /* xf86CrtcFitsScreen() relies on these values being correct. */
+ /* This should ensure the values are always set at modeset time. */
+ pScreen->width = scrn->virtualX;
+ pScreen->height = scrn->virtualY;
+
/* Shift offsets that move us out of virtual size */
if (x + mode->HDisplay > xf86_config->maxWidth ||
y + mode->VDisplay > xf86_config->maxHeight)
@@ -314,8 +324,14 @@ xf86CrtcSetModeTransform (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotati
crtc->x, crtc->y);
}
- /* XXX short-circuit changes to base location only */
-
+ if (crtc->funcs->set_origin &&
+ memcmp (mode, &saved_mode, sizeof(saved_mode)) == 0 &&
+ saved_rotation == rotation) {
+ crtc->funcs->set_origin (crtc, crtc->x, crtc->y);
+ ret = TRUE;
+ goto done;
+ }
+
/* Pass our mode to the outputs and the CRTC to give them a chance to
* adjust it according to limitations or output properties, and also
* a chance to reject the mode entirely.
@@ -404,6 +420,20 @@ xf86CrtcSetMode (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation,
return xf86CrtcSetModeTransform (crtc, mode, rotation, NULL, x, y);
}
+/**
+ * Pans the screen, does not change the mode
+ */
+_X_EXPORT void
+xf86CrtcSetOrigin (xf86CrtcPtr crtc, int x, int y)
+{
+ crtc->x = x;
+ crtc->y = y;
+ if (crtc->funcs->set_origin)
+ crtc->funcs->set_origin (crtc, x, y);
+ else
+ xf86CrtcSetMode (crtc, &crtc->mode, crtc->rotation, x, y);
+}
+
/*
* Output functions
*/
diff --git a/hw/xfree86/modes/xf86Crtc.h b/hw/xfree86/modes/xf86Crtc.h
index 4b6f7d2a1..5e47e6f2b 100644
--- a/hw/xfree86/modes/xf86Crtc.h
+++ b/hw/xfree86/modes/xf86Crtc.h
@@ -213,9 +213,16 @@ typedef struct _xf86CrtcFuncs {
Bool
(*set_mode_major)(xf86CrtcPtr crtc, DisplayModePtr mode,
Rotation rotation, int x, int y);
+
+ /**
+ * Callback for panning. Doesn't change the mode.
+ */
+ void
+ (*set_origin)(xf86CrtcPtr crtc, int x, int y);
+
} xf86CrtcFuncsRec, *xf86CrtcFuncsPtr;
-#define XF86_CRTC_VERSION 1
+#define XF86_CRTC_VERSION 2
struct _xf86Crtc {
/**
@@ -321,6 +328,15 @@ struct _xf86Crtc {
* Bounding box in screen space
*/
BoxRec bounds;
+ /**
+ * Panning:
+ * TotalArea: total panning area, larger than CRTC's size
+ * TrackingArea: Area of the pointer for which the CRTC is panned
+ * border: Borders of the displayed CRTC area which induces panning if the pointer reaches them
+ */
+ BoxRec panningTotalArea;
+ BoxRec panningTrackingArea;
+ INT16 panningBorder[4];
};
typedef struct _xf86OutputFuncs {
@@ -678,6 +694,9 @@ Bool
xf86CrtcSetMode (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation,
int x, int y);
+void
+xf86CrtcSetOrigin (xf86CrtcPtr crtc, int x, int y);
+
/*
* Assign crtc rotation during mode set
*/
@@ -867,4 +886,19 @@ xf86_unwrap_crtc_notify(ScreenPtr pScreen, xf86_crtc_notify_proc_ptr old);
void
xf86_crtc_notify(ScreenPtr pScreen);
+/**
+ * Panning
+ */
+Bool
+xf86_crtc_get_panning(ScrnInfoPtr pScrn,
+ BoxPtr totalArea,
+ BoxPtr TrackingArea,
+ INT16 *border);
+
+Bool
+xf86_crtc_set_panning(ScrnInfoPtr pScrn,
+ BoxPtr totalArea,
+ BoxPtr TrackingArea,
+ INT16 *border);
+
#endif /* _XF86CRTC_H_ */
diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c
index 9d7750fbd..362229c2f 100644
--- a/hw/xfree86/modes/xf86RandR12.c
+++ b/hw/xfree86/modes/xf86RandR12.c
@@ -51,6 +51,8 @@ typedef struct _xf86RandR12Info {
int mmHeight;
int maxX;
int maxY;
+ int pointerX;
+ int pointerY;
Rotation rotation; /* current mode */
Rotation supported_rotations; /* driver supported */
} XF86RandRInfoRec, *XF86RandRInfoPtr;
@@ -86,6 +88,143 @@ xf86RandR12ModeRefresh (DisplayModePtr mode)
return (int) (mode->Clock * 1000.0 / mode->HTotal / mode->VTotal + 0.5);
}
+/* Adapt panning area; return TRUE if panning area was valid without adaption */
+static int
+xf86RandR13VerifyPanningArea (xf86CrtcPtr crtc, int screenWidth, int screenHeight)
+{
+ int ret = TRUE;
+
+ if (crtc->version < 2)
+ return FALSE;
+
+ if (crtc->panningTotalArea.x2 <= crtc->panningTotalArea.x1) {
+ /* Panning in X is disabled */
+ if (crtc->panningTotalArea.x1 || crtc->panningTotalArea.x2)
+ /* Illegal configuration -> fail/disable */
+ ret = FALSE;
+ crtc->panningTotalArea.x1 = crtc->panningTotalArea.x2 = 0;
+ crtc->panningTrackingArea.x1 = crtc->panningTrackingArea.x2 = 0;
+ crtc->panningBorder[0] = crtc->panningBorder[2] = 0;
+ } else {
+ /* Panning in X is enabled */
+ if (crtc->panningTotalArea.x1 < 0) {
+ /* Panning region outside screen -> move inside */
+ crtc->panningTotalArea.x2 -= crtc->panningTotalArea.x1;
+ crtc->panningTotalArea.x1 = 0;
+ ret = FALSE;
+ }
+ if (crtc->panningTotalArea.x2 < crtc->panningTotalArea.x1 + crtc->mode.HDisplay) {
+ /* Panning region smaller than displayed area -> crop to displayed area */
+ crtc->panningTotalArea.x2 = crtc->panningTotalArea.x1 + crtc->mode.HDisplay;
+ ret = FALSE;
+ }
+ if (crtc->panningTotalArea.x2 > screenWidth) {
+ /* Panning region larger than screen -> move inside, then crop to screen */
+ crtc->panningTotalArea.x1 -= crtc->panningTotalArea.x2 - screenWidth;
+ crtc->panningTotalArea.x2 = screenWidth;
+ ret = FALSE;
+ if (crtc->panningTotalArea.x1 < 0)
+ crtc->panningTotalArea.x1 = 0;
+ }
+ if (crtc->panningBorder[0] + crtc->panningBorder[2] > crtc->mode.HDisplay) {
+ /* Borders too large -> set to 0 */
+ crtc->panningBorder[0] = crtc->panningBorder[2] = 0;
+ ret = FALSE;
+ }
+ }
+
+ if (crtc->panningTotalArea.y2 <= crtc->panningTotalArea.y1) {
+ /* Panning in Y is disabled */
+ if (crtc->panningTotalArea.y1 || crtc->panningTotalArea.y2)
+ /* Illegal configuration -> fail/disable */
+ ret = FALSE;
+ crtc->panningTotalArea.y1 = crtc->panningTotalArea.y2 = 0;
+ crtc->panningTrackingArea.y1 = crtc->panningTrackingArea.y2 = 0;
+ crtc->panningBorder[1] = crtc->panningBorder[3] = 0;
+ } else {
+ /* Panning in Y is enabled */
+ if (crtc->panningTotalArea.y1 < 0) {
+ /* Panning region outside screen -> move inside */
+ crtc->panningTotalArea.y2 -= crtc->panningTotalArea.y1;
+ crtc->panningTotalArea.y1 = 0;
+ ret = FALSE;
+ }
+ if (crtc->panningTotalArea.y2 < crtc->panningTotalArea.y1 + crtc->mode.VDisplay) {
+ /* Panning region smaller than displayed area -> crop to displayed area */
+ crtc->panningTotalArea.y2 = crtc->panningTotalArea.y1 + crtc->mode.VDisplay;
+ ret = FALSE;
+ }
+ if (crtc->panningTotalArea.y2 > screenHeight) {
+ /* Panning region larger than screen -> move inside, then crop to screen */
+ crtc->panningTotalArea.y1 -= crtc->panningTotalArea.y2 - screenHeight;
+ crtc->panningTotalArea.y2 = screenHeight;
+ ret = FALSE;
+ if (crtc->panningTotalArea.y1 < 0)
+ crtc->panningTotalArea.y1 = 0;
+ }
+ if (crtc->panningBorder[1] + crtc->panningBorder[3] > crtc->mode.VDisplay) {
+ /* Borders too large -> set to 0 */
+ crtc->panningBorder[1] = crtc->panningBorder[3] = 0;
+ ret = FALSE;
+ }
+ }
+
+ return ret;
+}
+
+static void
+xf86RandR13Pan (xf86CrtcPtr crtc, int x, int y)
+{
+ int newX, newY;
+ int width, height;
+
+ if (crtc->version < 2)
+ return;
+
+ if (! crtc->enabled ||
+ (crtc->panningTotalArea.x2 <= crtc->panningTotalArea.x1 &&
+ crtc->panningTotalArea.y2 <= crtc->panningTotalArea.y1))
+ return;
+
+ newX = crtc->x;
+ newY = crtc->y;
+ width = crtc->mode.HDisplay;
+ height = crtc->mode.VDisplay;
+
+ if ((crtc->panningTrackingArea.x2 <= crtc->panningTrackingArea.x1 ||
+ (x >= crtc->panningTrackingArea.x1 && x < crtc->panningTrackingArea.x2)) &&
+ (crtc->panningTrackingArea.y2 <= crtc->panningTrackingArea.y1 ||
+ (y >= crtc->panningTrackingArea.y1 && y < crtc->panningTrackingArea.y2))) {
+ if (crtc->panningTotalArea.x2 > crtc->panningTotalArea.x1) {
+ if (x < crtc->x + crtc->panningBorder[0])
+ newX = x - crtc->panningBorder[0];
+ if (x >= crtc->x + width - crtc->panningBorder[2])
+ newX = x - width + crtc->panningBorder[2] + 1;
+ }
+ if (crtc->panningTotalArea.y2 > crtc->panningTotalArea.y1) {
+ if (y < crtc->y + crtc->panningBorder[1])
+ newY = y - crtc->panningBorder[1];
+ if (y >= crtc->y + height - crtc->panningBorder[3])
+ newY = y - height + crtc->panningBorder[3] + 1;
+ }
+ }
+ /* Validate against [xy]1 after [xy]2, to be sure that results are > 0 for [xy]1 > 0 */
+ if (crtc->panningTotalArea.x2 > crtc->panningTotalArea.x1) {
+ if (newX >= crtc->panningTotalArea.x2 - width)
+ newX = crtc->panningTotalArea.x2 - width - 1;
+ if (newX < crtc->panningTotalArea.x1)
+ newX = crtc->panningTotalArea.x1;
+ }
+ if (crtc->panningTotalArea.y2 > crtc->panningTotalArea.y1) {
+ if (newY >= crtc->panningTotalArea.y2 - height)
+ newY = crtc->panningTotalArea.y2 - height - 1;
+ if (newY < crtc->panningTotalArea.y1)
+ newY = crtc->panningTotalArea.y1;
+ }
+ if (newX != crtc->x || newY != crtc->y)
+ xf86CrtcSetOrigin (crtc, newX, newY);
+}
+
static Bool
xf86RandR12GetInfo (ScreenPtr pScreen, Rotation *rotations)
{
@@ -332,6 +471,7 @@ xf86RandR12ScreenSetSize (ScreenPtr pScreen,
WindowPtr pRoot = WindowTable[pScreen->myNum];
PixmapPtr pScrnPix = (*pScreen->GetScreenPixmap)(pScreen);
Bool ret = FALSE;
+ int c;
#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(7,0,0,0,0)
if (xf86RandR12Key) {
@@ -352,6 +492,23 @@ xf86RandR12ScreenSetSize (ScreenPtr pScreen,
goto finish;
ret = TRUE;
+ /* Update panning information */
+ for (c = 0; c < config->num_crtc; c++) {
+ xf86CrtcPtr crtc = config->crtc[c];
+ if (crtc->panningTotalArea.x2 > crtc->panningTotalArea.x1 ||
+ crtc->panningTotalArea.y2 > crtc->panningTotalArea.y1) {
+ if (crtc->panningTotalArea.x2 > crtc->panningTrackingArea.x1)
+ crtc->panningTotalArea.x2 += width - pScreen->width;
+ if (crtc->panningTotalArea.y2 > crtc->panningTrackingArea.y1)
+ crtc->panningTotalArea.y2 += height - pScreen->height;
+ if (crtc->panningTrackingArea.x2 > crtc->panningTrackingArea.x1)
+ crtc->panningTrackingArea.x2 += width - pScreen->width;
+ if (crtc->panningTrackingArea.y2 > crtc->panningTrackingArea.y1)
+ crtc->panningTrackingArea.y2 += height - pScreen->height;
+ xf86RandR13VerifyPanningArea (crtc, width, height);
+ xf86RandR13Pan (crtc, randrp->pointerX, randrp->pointerY);
+ }
+ }
pScreen->width = pScrnPix->drawable.width = width;
pScreen->height = pScrnPix->drawable.height = height;
@@ -762,6 +919,7 @@ xf86RandR12CrtcSet (ScreenPtr pScreen,
int num_randr_outputs,
RROutputPtr *randr_outputs)
{
+ XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen);
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
xf86CrtcPtr crtc = randr_crtc->devPrivate;
@@ -841,6 +999,8 @@ xf86RandR12CrtcSet (ScreenPtr pScreen,
xfree(save_crtcs);
return FALSE;
}
+ xf86RandR13VerifyPanningArea (crtc, pScreen->width, pScreen->height);
+ xf86RandR13Pan (crtc, randrp->pointerX, randrp->pointerY);
/*
* Save the last successful setting for EnterVT
*/
@@ -1187,6 +1347,77 @@ xf86RandR12TellChanged (ScreenPtr pScreen)
static void
xf86RandR12PointerMoved (int scrnIndex, int x, int y)
{
+ ScreenPtr pScreen = screenInfo.screens[scrnIndex];
+ ScrnInfoPtr pScrn = XF86SCRNINFO(pScreen);
+ xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
+ XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen);
+ int c;
+
+ randrp->pointerX = x;
+ randrp->pointerY = y;
+ for (c = 0; c < config->num_crtc; c++)
+ xf86RandR13Pan (config->crtc[c], x, y);
+}
+
+static Bool
+xf86RandR13GetPanning (ScreenPtr pScreen,
+ RRCrtcPtr randr_crtc,
+ BoxPtr totalArea,
+ BoxPtr trackingArea,
+ INT16 *border)
+{
+ xf86CrtcPtr crtc = randr_crtc->devPrivate;
+
+ if (crtc->version < 2)
+ return FALSE;
+ if (totalArea)
+ memcpy (totalArea, &crtc->panningTotalArea, sizeof(BoxRec));
+ if (trackingArea)
+ memcpy (trackingArea, &crtc->panningTrackingArea, sizeof(BoxRec));
+ if (border)
+ memcpy (border, crtc->panningBorder, 4*sizeof(INT16));
+
+ return TRUE;
+}
+
+static Bool
+xf86RandR13SetPanning (ScreenPtr pScreen,
+ RRCrtcPtr randr_crtc,
+ BoxPtr totalArea,
+ BoxPtr trackingArea,
+ INT16 *border)
+{
+ XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen);
+ xf86CrtcPtr crtc = randr_crtc->devPrivate;
+ BoxRec oldTotalArea;
+ BoxRec oldTrackingArea;
+ INT16 oldBorder[4];
+
+
+ if (crtc->version < 2)
+ return FALSE;
+
+ memcpy (&oldTotalArea, &crtc->panningTotalArea, sizeof(BoxRec));
+ memcpy (&oldTrackingArea, &crtc->panningTrackingArea, sizeof(BoxRec));
+ memcpy (oldBorder, crtc->panningBorder, 4*sizeof(INT16));
+
+ if (totalArea)
+ memcpy (&crtc->panningTotalArea, totalArea, sizeof(BoxRec));
+ if (trackingArea)
+ memcpy (&crtc->panningTrackingArea, trackingArea, sizeof(BoxRec));
+ if (border)
+ memcpy (crtc->panningBorder, border, 4*sizeof(INT16));
+
+ if (xf86RandR13VerifyPanningArea (crtc, pScreen->width, pScreen->height)) {
+ xf86RandR13Pan (crtc, randrp->pointerX, randrp->pointerY);
+ return TRUE;
+ } else {
+ /* Restore old settings */
+ memcpy (&crtc->panningTotalArea, &oldTotalArea, sizeof(BoxRec));
+ memcpy (&crtc->panningTrackingArea, &oldTrackingArea, sizeof(BoxRec));
+ memcpy (crtc->panningBorder, oldBorder, 4*sizeof(INT16));
+ return FALSE;
+ }
}
static Bool
@@ -1203,6 +1434,8 @@ xf86RandR12Init12 (ScreenPtr pScreen)
rp->rrOutputValidateMode = xf86RandR12OutputValidateMode;
#if RANDR_13_INTERFACE
rp->rrOutputGetProperty = xf86RandR13OutputGetProperty;
+ rp->rrGetPanning = xf86RandR13GetPanning;
+ rp->rrSetPanning = xf86RandR13SetPanning;
#endif
rp->rrModeDestroy = xf86RandR12ModeDestroy;
rp->rrSetConfig = NULL;
diff --git a/hw/xfree86/modes/xf86Rotate.c b/hw/xfree86/modes/xf86Rotate.c
index 07189a5ba..d7f7b3b78 100644
--- a/hw/xfree86/modes/xf86Rotate.c
+++ b/hw/xfree86/modes/xf86Rotate.c
@@ -464,7 +464,7 @@ xf86CrtcRotate (xf86CrtcPtr crtc)
/* mark shadowed area as damaged so it will be repainted */
xf86CrtcDamageShadow (crtc);
}
-
+
if (!xf86_config->rotation_damage)
{
/* Create damage structure */
diff --git a/include/exevents.h b/include/exevents.h
index 8788295bf..7459b5c24 100644
--- a/include/exevents.h
+++ b/include/exevents.h
@@ -240,7 +240,7 @@ extern long XIRegisterPropertyHandler(
Atom property)
);
-extern void XIUnRegisterPropertyHandler(
+extern _X_EXPORT void XIUnregisterPropertyHandler(
DeviceIntPtr dev,
long id
);
diff --git a/randr/randrstr.h b/randr/randrstr.h
index 64206e88d..f6aa5c7ec 100644
--- a/randr/randrstr.h
+++ b/randr/randrstr.h
@@ -190,6 +190,17 @@ typedef void (*RRModeDestroyProcPtr) (ScreenPtr pScreen,
typedef Bool (*RROutputGetPropertyProcPtr) (ScreenPtr pScreen,
RROutputPtr output,
Atom property);
+typedef Bool (*RRGetPanningProcPtr) (ScreenPtr pScrn,
+ RRCrtcPtr crtc,
+ BoxPtr totalArea,
+ BoxPtr trackingArea,
+ INT16 *border);
+typedef Bool (*RRSetPanningProcPtr) (ScreenPtr pScrn,
+ RRCrtcPtr crtc,
+ BoxPtr totalArea,
+ BoxPtr trackingArea,
+ INT16 *border);
+
#endif /* RANDR_13_INTERFACE */
typedef Bool (*RRGetInfoProcPtr) (ScreenPtr pScreen, Rotation *rotations);
@@ -239,6 +250,8 @@ typedef struct _rrScrPriv {
#endif
#if RANDR_13_INTERFACE
RROutputGetPropertyProcPtr rrOutputGetProperty;
+ RRGetPanningProcPtr rrGetPanning;
+ RRSetPanningProcPtr rrSetPanning;
#endif
/*
@@ -686,6 +699,12 @@ ProcRRSetCrtcTransform (ClientPtr client);
int
ProcRRGetCrtcTransform (ClientPtr client);
+int
+ProcRRGetPanning (ClientPtr client);
+
+int
+ProcRRSetPanning (ClientPtr client);
+
/* rrdispatch.c */
Bool
RRClientKnowsRates (ClientPtr pClient);
diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c
index 5d270ce12..99f7d1ea1 100644
--- a/randr/rrcrtc.c
+++ b/randr/rrcrtc.c
@@ -978,6 +978,158 @@ sendReply:
}
int
+ProcRRGetPanning (ClientPtr client)
+{
+ REQUEST(xRRGetPanningReq);
+ xRRGetPanningReply rep;
+ RRCrtcPtr crtc;
+ ScreenPtr pScreen;
+ rrScrPrivPtr pScrPriv;
+ BoxRec total;
+ BoxRec tracking;
+ INT16 border[4];
+ int n;
+
+ REQUEST_SIZE_MATCH(xRRGetPanningReq);
+ crtc = LookupCrtc(client, stuff->crtc, DixReadAccess);
+
+ if (!crtc)
+ return RRErrorBase + BadRRCrtc;
+
+ /* All crtcs must be associated with screens before client
+ * requests are processed
+ */
+ pScreen = crtc->pScreen;
+ pScrPriv = rrGetScrPriv(pScreen);
+
+ if (!pScrPriv || !pScrPriv->rrGetPanning)
+ return RRErrorBase + BadRRCrtc;
+
+ rep.type = X_Reply;
+ rep.status = RRSetConfigSuccess;
+ rep.sequenceNumber = client->sequence;
+ rep.length = 1;
+ rep.timestamp = pScrPriv->lastSetTime.milliseconds;
+
+ if (! pScrPriv->rrGetPanning (pScreen, crtc, &total, &tracking, border))
+ return RRErrorBase + BadRRCrtc;
+
+ rep.left = total.x1;
+ rep.top = total.y1;
+ rep.width = total.x2 - total.x1;
+ rep.height = total.y2 - total.y1;
+ rep.track_left = tracking.x1;
+ rep.track_top = tracking.y1;
+ rep.track_width = tracking.x2 - tracking.x1;
+ rep.track_height = tracking.y2 - tracking.y1;
+ rep.border_left = border[0];
+ rep.border_top = border[1];
+ rep.border_right = border[2];
+ rep.border_bottom = border[3];
+
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber, n);
+ swapl(&rep.length, n);
+ swaps(&rep.timestamp, n);
+ swaps(&rep.left, n);
+ swaps(&rep.top, n);
+ swaps(&rep.width, n);
+ swaps(&rep.height, n);
+ swaps(&rep.track_left, n);
+ swaps(&rep.track_top, n);
+ swaps(&rep.track_width, n);
+ swaps(&rep.track_height, n);
+ swaps(&rep.border_left, n);
+ swaps(&rep.border_top, n);
+ swaps(&rep.border_right, n);
+ swaps(&rep.border_bottom, n);
+ }
+ WriteToClient(client, sizeof(xRRGetPanningReply), (char *)&rep);
+ return client->noClientException;
+}
+
+int
+ProcRRSetPanning (ClientPtr client)
+{
+ REQUEST(xRRSetPanningReq);
+ xRRSetPanningReply rep;
+ RRCrtcPtr crtc;
+ ScreenPtr pScreen;
+ rrScrPrivPtr pScrPriv;
+ TimeStamp time;
+ BoxRec total;
+ BoxRec tracking;
+ INT16 border[4];
+ int n;
+
+ REQUEST_SIZE_MATCH(xRRSetPanningReq);
+ crtc = LookupCrtc(client, stuff->crtc, DixReadAccess);
+
+ if (!crtc)
+ return RRErrorBase + BadRRCrtc;
+
+
+ /* All crtcs must be associated with screens before client
+ * requests are processed
+ */
+ pScreen = crtc->pScreen;
+ pScrPriv = rrGetScrPriv(pScreen);
+
+ if (!pScrPriv) {
+ time = currentTime;
+ rep.status = RRSetConfigFailed;
+ goto sendReply;
+ }
+
+ time = ClientTimeToServerTime(stuff->timestamp);
+
+ /*
+ * Make sure the requested set-time is not older than
+ * the last set-time
+ */
+ if (CompareTimeStamps (time, pScrPriv->lastSetTime) < 0)
+ {
+ rep.status = RRSetConfigInvalidTime;
+ goto sendReply;
+ }
+
+ if (!pScrPriv->rrGetPanning)
+ return RRErrorBase + BadRRCrtc;
+
+ total.x1 = stuff->left;
+ total.y1 = stuff->top;
+ total.x2 = stuff->width - total.x1;
+ total.y2 = stuff->height - total.y1;
+ tracking.x1 = stuff->track_left;
+ tracking.y1 = stuff->track_top;
+ tracking.x2 = stuff->track_width - tracking.x1;
+ tracking.y2 = stuff->track_height - tracking.y1;
+ border[0] = stuff->border_left;
+ border[1] = stuff->border_top;
+ border[2] = stuff->border_right;
+ border[3] = stuff->border_bottom;
+
+ if (! pScrPriv->rrSetPanning (pScreen, crtc, &total, &tracking, border))
+ return BadMatch;
+
+ rep.status = RRSetConfigSuccess;
+
+sendReply:
+ rep.type = X_Reply;
+ rep.sequenceNumber = client->sequence;
+ rep.length = 0;
+ rep.newTimestamp = pScrPriv->lastSetTime.milliseconds;
+
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber, n);
+ swapl(&rep.length, n);
+ swaps(&rep.newTimestamp, n);
+ }
+ WriteToClient(client, sizeof(xRRSetPanningReply), (char *)&rep);
+ return client->noClientException;
+}
+
+int
ProcRRGetCrtcGammaSize (ClientPtr client)
{
REQUEST(xRRGetCrtcGammaSizeReq);
@@ -1150,8 +1302,7 @@ transform_filter_encode (ClientPtr client, char *output,
if (client->swapped) {
swaps (nbytesFilter, n);
swaps (nparamsFilter, n);
- SwapLongs ((CARD32 *) (output + nbytes),
- nparams * sizeof (xFixed));
+ SwapLongs ((CARD32 *) (output + nbytes), nparams);
}
nbytes += nparams * sizeof (xFixed);
return nbytes;
@@ -1162,7 +1313,7 @@ transform_encode (ClientPtr client, xRenderTransform *wire, PictTransform *pict)
{
xRenderTransform_from_PictTransform (wire, pict);
if (client->swapped)
- SwapLongs ((CARD32 *) wire, sizeof (xRenderTransform));
+ SwapLongs ((CARD32 *) wire, sizeof (xRenderTransform) >> 2);
}
int
@@ -1214,5 +1365,6 @@ ProcRRGetCrtcTransform (ClientPtr client)
swapl (&reply->length, n);
}
WriteToClient (client, sizeof (xRRGetCrtcTransformReply) + nextra, (char *) reply);
+ xfree(reply);
return client->noClientException;
}
diff --git a/randr/rrdispatch.c b/randr/rrdispatch.c
index 64af6ce2a..0cc0bca98 100644
--- a/randr/rrdispatch.c
+++ b/randr/rrdispatch.c
@@ -215,5 +215,7 @@ int (*ProcRandrVector[RRNumberRequests])(ClientPtr) = {
ProcRRGetScreenResourcesCurrent, /* 25 */
ProcRRSetCrtcTransform, /* 26 */
ProcRRGetCrtcTransform, /* 27 */
+ ProcRRGetPanning, /* 28 */
+ ProcRRSetPanning, /* 29 */
};
diff --git a/randr/rrsdispatch.c b/randr/rrsdispatch.c
index 5a6dab5bf..3ff9f3f85 100644
--- a/randr/rrsdispatch.c
+++ b/randr/rrsdispatch.c
@@ -367,21 +367,73 @@ SProcRRSetCrtcGamma (ClientPtr client)
static int
SProcRRSetCrtcTransform (ClientPtr client)
{
+ int n, nparams;
+ char *filter;
+ CARD32 *params;
REQUEST(xRRSetCrtcTransformReq);
-
- REQUEST_SIZE_MATCH(xRRSetCrtcTransformReq);
- (void) stuff;
- return BadImplementation;
+
+ REQUEST_AT_LEAST_SIZE(xRRSetCrtcTransformReq);
+ swaps(&stuff->length, n);
+ swapl(&stuff->crtc, n);
+ SwapLongs((CARD32 *)&stuff->transform, (sizeof(xRenderTransform)) >> 2);
+ swaps(&stuff->nbytesFilter, n);
+ filter = (char *)(stuff + 1);
+ params = (CARD32 *) (filter + ((stuff->nbytesFilter + 3) & ~3));
+ nparams = ((CARD32 *) stuff + client->req_len) - params;
+ if (nparams < 0)
+ return BadLength;
+
+ SwapLongs(params, nparams);
+ return (*ProcRandrVector[stuff->randrReqType]) (client);
}
static int
SProcRRGetCrtcTransform (ClientPtr client)
{
+ int n;
REQUEST(xRRGetCrtcTransformReq);
-
+
REQUEST_SIZE_MATCH(xRRGetCrtcTransformReq);
- (void) stuff;
- return BadImplementation;
+ swaps(&stuff->length, n);
+ swapl(&stuff->crtc, n);
+ return (*ProcRandrVector[stuff->randrReqType]) (client);
+}
+
+static int
+SProcRRGetPanning (ClientPtr client)
+{
+ int n;
+ REQUEST(xRRGetPanningReq);
+
+ REQUEST_SIZE_MATCH(xRRGetPanningReq);
+ swaps(&stuff->length, n);
+ swapl(&stuff->crtc, n);
+ return (*ProcRandrVector[stuff->randrReqType]) (client);
+}
+
+static int
+SProcRRSetPanning (ClientPtr client)
+{
+ int n;
+ REQUEST(xRRSetPanningReq);
+
+ REQUEST_SIZE_MATCH(xRRSetPanningReq);
+ swaps(&stuff->length, n);
+ swapl(&stuff->crtc, n);
+ swapl(&stuff->timestamp, n);
+ swaps(&stuff->left, n);
+ swaps(&stuff->top, n);
+ swaps(&stuff->width, n);
+ swaps(&stuff->height, n);
+ swaps(&stuff->track_left, n);
+ swaps(&stuff->track_top, n);
+ swaps(&stuff->track_width, n);
+ swaps(&stuff->track_height, n);
+ swaps(&stuff->border_left, n);
+ swaps(&stuff->border_top, n);
+ swaps(&stuff->border_right, n);
+ swaps(&stuff->border_bottom, n);
+ return (*ProcRandrVector[stuff->randrReqType]) (client);
}
int (*SProcRandrVector[RRNumberRequests])(ClientPtr) = {
@@ -418,5 +470,7 @@ int (*SProcRandrVector[RRNumberRequests])(ClientPtr) = {
SProcRRGetScreenResources, /* 25 GetScreenResourcesCurrent */
SProcRRSetCrtcTransform, /* 26 */
SProcRRGetCrtcTransform, /* 27 */
+ SProcRRGetPanning, /* 28 */
+ SProcRRSetPanning, /* 29 */
};
diff --git a/xkb/ddxCtrls.c b/xkb/ddxCtrls.c
index 34ea0bd3f..be269c2af 100644
--- a/xkb/ddxCtrls.c
+++ b/xkb/ddxCtrls.c
@@ -57,27 +57,7 @@ int realRepeat;
int
XkbDDXUsesSoftRepeat(DeviceIntPtr pXDev)
{
-#ifndef XKB_ALWAYS_USES_SOFT_REPEAT
- if (pXDev && pXDev->kbdfeed ) {
- if (pXDev->kbdfeed->ctrl.autoRepeat) {
- if (pXDev->key && pXDev->key->xkbInfo) {
- XkbDescPtr xkb;
- xkb= pXDev->key->xkbInfo->desc;
- if ((xkb->ctrls->repeat_delay == 660) &&
- (xkb->ctrls->repeat_interval == 40) &&
- ((xkb->ctrls->enabled_ctrls&(XkbSlowKeysMask|
- XkbBounceKeysMask|
- XkbMouseKeysMask))==0)) {
- return 0;
- }
- return ((xkb->ctrls->enabled_ctrls&XkbRepeatKeysMask)!=0);
- }
- }
- }
- return 0;
-#else
return 1;
-#endif
}
void