summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2011-05-25 09:40:51 -0600
committerKeith Packard <keithp@keithp.com>2011-05-25 09:40:51 -0600
commit4725d6b0dbb6371af4a1b2fbef851dcfe155514a (patch)
treeba2066acbb5dd1228f295fda4e009792c70ae148
parent1b2d17748f0154da142e9b421d4f6a46e4e5a18c (diff)
parentb5d828789c092c994722a896c252212e2b3614ab (diff)
Merge remote-tracking branch 'whot/for-keith'
-rw-r--r--dix/devices.c9
-rw-r--r--dix/events.c7
-rw-r--r--dix/inpututils.c2
-rw-r--r--hw/kdrive/ephyr/ephyr.c25
-rw-r--r--hw/kdrive/ephyr/ephyrinit.c7
-rw-r--r--hw/xfree86/common/xf86Module.h2
-rw-r--r--hw/xfree86/common/xf86Xinput.c21
-rw-r--r--hw/xfree86/man/xorg.conf.man10
-rw-r--r--hw/xfree86/parser/InputClass.c21
-rw-r--r--hw/xfree86/parser/xf86Parser.h1
-rw-r--r--hw/xfree86/parser/xf86tokens.h1
-rw-r--r--hw/xwin/winkeybd.c6
-rw-r--r--hw/xwin/winmouse.c4
-rw-r--r--include/input.h6
-rw-r--r--include/inputstr.h2
-rw-r--r--mi/mieq.c1
16 files changed, 94 insertions, 31 deletions
diff --git a/dix/devices.c b/dix/devices.c
index 9a4498b9f..0ccf25277 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -1361,15 +1361,6 @@ InitPointerAccelerationScheme(DeviceIntPtr dev,
}
Bool
-InitAbsoluteClassDeviceStruct(DeviceIntPtr dev)
-{
- /* This is an API-preserving noop. Instructions: Kill when no more drivers
- * call it. The infrastructure behind hasn't really been used, so any calls
- * are likely just a declaration that the device is absolute. */
- return FALSE;
-}
-
-Bool
InitFocusClassDeviceStruct(DeviceIntPtr dev)
{
FocusClassPtr focc;
diff --git a/dix/events.c b/dix/events.c
index 14f6f909e..b60c29952 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -112,6 +112,7 @@ Equipment Corporation.
#include <X11/Xproto.h>
#include "windowstr.h"
#include "inputstr.h"
+#include "inpututils.h"
#include "scrnintstr.h"
#include "cursorstr.h"
@@ -2195,7 +2196,7 @@ DeliverEventsToWindow(DeviceIntPtr pDev, WindowPtr pWin, xEvent
*/
if (!grab && ActivateImplicitGrab(pDev, client, pWin, pEvents, deliveryMask))
/* grab activated */;
- else if ((type == MotionNotify))
+ else if (type == MotionNotify)
pDev->valuator->motionHintWindow = pWin;
else if (type == DeviceMotionNotify || type == DeviceButtonPress)
CheckDeviceGrabAndHintWindow (pWin, type,
@@ -2832,7 +2833,7 @@ CheckMotion(DeviceEvent *ev, DeviceIntPtr pDev)
WindowPtr prevSpriteWin, newSpriteWin;
SpritePtr pSprite = pDev->spriteInfo->sprite;
- verify_internal_event(ev);
+ verify_internal_event((InternalEvent *)ev);
prevSpriteWin = pSprite->win;
@@ -5906,7 +5907,7 @@ PickPointer(ClientPtr client)
if (!client->clientPtr)
{
- DeviceIntPtr it = inputInfo.devices;
+ it = inputInfo.devices;
while (it)
{
if (IsMaster(it) && it->spriteInfo->spriteOwner)
diff --git a/dix/inpututils.c b/dix/inpututils.c
index aeace6ef8..49e175822 100644
--- a/dix/inpututils.c
+++ b/dix/inpututils.c
@@ -574,7 +574,7 @@ void verify_internal_event(const InternalEvent *ev)
for (i = 0; i < sizeof(xEvent); i++, data++)
{
- ErrorF("%02hx ", *data);
+ ErrorF("%02hhx ", *data);
if ((i % 8) == 7)
ErrorF("\n");
diff --git a/hw/kdrive/ephyr/ephyr.c b/hw/kdrive/ephyr/ephyr.c
index 8096a24cc..ac8e5bef9 100644
--- a/hw/kdrive/ephyr/ephyr.c
+++ b/hw/kdrive/ephyr/ephyr.c
@@ -52,6 +52,7 @@ Bool ephyrNoDRI=FALSE ;
Bool ephyrNoXV=FALSE ;
static int mouseState = 0;
+static Rotation ephyrRandr = RR_Rotate_0;
typedef struct _EphyrInputPrivate {
Bool enabled;
@@ -249,7 +250,11 @@ ephyrMapFramebuffer (KdScreenInfo *screen)
EPHYR_LOG("screen->width: %d, screen->height: %d index=%d",
screen->width, screen->height, screen->mynum);
- KdComputePointerMatrix (&m, scrpriv->randr, screen->width, screen->height);
+ /*
+ * Use the rotation last applied to ourselves (in the Xephyr case the fb
+ * coordinate system moves independently of the pointer coordiante system).
+ */
+ KdComputePointerMatrix (&m, ephyrRandr, screen->width, screen->height);
KdSetPointerMatrix (&m);
priv->bytes_per_line = ((screen->width * screen->fb.bitsPerPixel + 31) >> 5) << 2;
@@ -530,7 +535,15 @@ ephyrRandRSetConfig (ScreenPtr pScreen,
* Set new configuration
*/
- scrpriv->randr = KdAddRotation (screen->randr, randr);
+ /*
+ * We need to store the rotation value for pointer coords transformation;
+ * though initially the pointer and fb rotation are identical, when we map
+ * the fb, the screen will be reinitialized and return into an unrotated
+ * state (presumably the HW is taking care of the rotation of the fb), but the
+ * pointer still needs to be transformed.
+ */
+ ephyrRandr = KdAddRotation (screen->randr, randr);
+ scrpriv->randr = ephyrRandr;
ephyrUnmapFramebuffer (screen);
@@ -1058,6 +1071,14 @@ MouseInit (KdPointerInfo *pi)
pi->nButtons = 32;
free(pi->name);
pi->name = strdup("Xephyr virtual mouse");
+
+ /*
+ * Must transform pointer coords since the pointer position
+ * relative to the Xephyr window is controlled by the host server and
+ * remains constant regardless of any rotation applied to the Xephyr screen.
+ */
+ pi->transformCoordinates = TRUE;
+
ephyrMouse = pi;
return Success;
}
diff --git a/hw/kdrive/ephyr/ephyrinit.c b/hw/kdrive/ephyr/ephyrinit.c
index 27cab3b63..2deb7b81d 100644
--- a/hw/kdrive/ephyr/ephyrinit.c
+++ b/hw/kdrive/ephyr/ephyrinit.c
@@ -358,13 +358,18 @@ ephyrDeviceCursorInitialize(DeviceIntPtr pDev, ScreenPtr pScreen)
return TRUE;
}
+static void
+ephyrDeviceCursorCleanup(DeviceIntPtr pDev, ScreenPtr pScreen)
+{
+}
+
miPointerSpriteFuncRec EphyrPointerSpriteFuncs = {
ephyrRealizeCursor,
ephyrUnrealizeCursor,
ephyrSetCursor,
ephyrMoveCursor,
ephyrDeviceCursorInitialize,
- NULL
+ ephyrDeviceCursorCleanup
};
diff --git a/hw/xfree86/common/xf86Module.h b/hw/xfree86/common/xf86Module.h
index 94f17e980..2a5c805c4 100644
--- a/hw/xfree86/common/xf86Module.h
+++ b/hw/xfree86/common/xf86Module.h
@@ -83,7 +83,7 @@ typedef enum {
*/
#define ABI_ANSIC_VERSION SET_ABI_VERSION(0, 4)
#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(11, 0)
-#define ABI_XINPUT_VERSION SET_ABI_VERSION(12, 2)
+#define ABI_XINPUT_VERSION SET_ABI_VERSION(13, 0)
#define ABI_EXTENSION_VERSION SET_ABI_VERSION(5, 0)
#define ABI_FONT_VERSION SET_ABI_VERSION(0, 6)
diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c
index e7e1ce1f0..26051ad7f 100644
--- a/hw/xfree86/common/xf86Xinput.c
+++ b/hw/xfree86/common/xf86Xinput.c
@@ -470,6 +470,20 @@ match_path_pattern(const char *attr, const char *pattern)
#endif
/*
+ * If no Layout section is found, xf86ServerLayout.id becomes "(implicit)"
+ * It is convenient that "" in patterns means "no explicit layout"
+ */
+static int
+match_string_implicit(const char *attr, const char *pattern)
+{
+ if (strlen(pattern)) {
+ return strcmp(attr, pattern);
+ } else {
+ return strcmp(attr,"(implicit)");
+ }
+}
+
+/*
* Match an attribute against a list of NULL terminated arrays of patterns.
* If a pattern in each list entry is matched, return TRUE.
*/
@@ -564,6 +578,13 @@ InputClassMatches(const XF86ConfInputClassPtr iclass, const InputInfoPtr idev,
return FALSE;
}
+ /* MatchLayout string */
+ if (!list_is_empty(&iclass->match_layout)) {
+ if (!MatchAttrToken(xf86ConfigLayout.id,
+ &iclass->match_layout, match_string_implicit))
+ return FALSE;
+ }
+
/* MatchIs* booleans */
if (iclass->is_keyboard.set &&
iclass->is_keyboard.val != !!(attrs->flags & ATTR_KEYBOARD))
diff --git a/hw/xfree86/man/xorg.conf.man b/hw/xfree86/man/xorg.conf.man
index 4bec31695..f406f82bb 100644
--- a/hw/xfree86/man/xorg.conf.man
+++ b/hw/xfree86/man/xorg.conf.man
@@ -1140,6 +1140,16 @@ matches the
pattern. A match is found if at least one of the tags given in
.RI \*q matchtag \*q
matches at least one of the tags assigned by the backend.
+.TP 7
+.BI "MatchLayout \*q" matchlayout \*q
+Check the case-sensitive string
+.RI \*q matchlayout \*q
+against the currently active
+.B ServerLayout
+section. The empty string "" matches an implicit layout which appears
+if no named
+.B ServerLayout
+sections have been found.
.PP
The second type of entry is used to match device types. These entries take a
boolean argument similar to
diff --git a/hw/xfree86/parser/InputClass.c b/hw/xfree86/parser/InputClass.c
index 9f88e7ee4..3f801700e 100644
--- a/hw/xfree86/parser/InputClass.c
+++ b/hw/xfree86/parser/InputClass.c
@@ -52,6 +52,7 @@ xf86ConfigSymTabRec InputClassTab[] =
{MATCH_USBID, "matchusbid"},
{MATCH_DRIVER, "matchdriver"},
{MATCH_TAG, "matchtag"},
+ {MATCH_LAYOUT, "matchlayout"},
{MATCH_IS_KEYBOARD, "matchiskeyboard"},
{MATCH_IS_POINTER, "matchispointer"},
{MATCH_IS_JOYSTICK, "matchisjoystick"},
@@ -94,6 +95,7 @@ xf86parseInputClassSection(void)
list_init(&ptr->match_usbid);
list_init(&ptr->match_driver);
list_init(&ptr->match_tag);
+ list_init(&ptr->match_layout);
while ((token = xf86getToken(InputClassTab)) != ENDSECTION) {
switch (token) {
@@ -169,6 +171,12 @@ xf86parseInputClassSection(void)
add_group_entry(&ptr->match_tag,
xstrtokenize(val.str, TOKEN_SEP));
break;
+ case MATCH_LAYOUT:
+ if (xf86getSubToken(&(ptr->comment)) != STRING)
+ Error(QUOTE_MSG, "MatchLayout");
+ add_group_entry(&ptr->match_layout,
+ xstrtokenize(val.str, TOKEN_SEP));
+ break;
case MATCH_IS_KEYBOARD:
if (xf86getSubToken(&(ptr->comment)) != STRING)
Error(QUOTE_MSG, "MatchIsKeyboard");
@@ -307,6 +315,13 @@ xf86printInputClassSection (FILE * cf, XF86ConfInputClassPtr ptr)
*cur);
fprintf(cf, "\"\n");
}
+ list_for_each_entry(group, &ptr->match_layout, entry) {
+ fprintf(cf, "\tMatchLayout \"");
+ for (cur = group->values; *cur; cur++)
+ fprintf(cf, "%s%s", cur == group->values ? "" : TOKEN_SEP,
+ *cur);
+ fprintf(cf, "\"\n");
+ }
if (ptr->is_keyboard.set)
fprintf(cf, "\tIsKeyboard \"%s\"\n",
@@ -392,6 +407,12 @@ xf86freeInputClassList (XF86ConfInputClassPtr ptr)
free(*list);
free(group);
}
+ list_for_each_entry_safe(group, next, &ptr->match_layout, entry) {
+ list_del(&group->entry);
+ for (list = group->values; *list; list++)
+ free(*list);
+ free(group);
+ }
TestFree(ptr->comment);
xf86optionListFree(ptr->option_lst);
diff --git a/hw/xfree86/parser/xf86Parser.h b/hw/xfree86/parser/xf86Parser.h
index 4f279f18d..a8785c5fa 100644
--- a/hw/xfree86/parser/xf86Parser.h
+++ b/hw/xfree86/parser/xf86Parser.h
@@ -358,6 +358,7 @@ typedef struct
struct list match_usbid;
struct list match_driver;
struct list match_tag;
+ struct list match_layout;
xf86TriState is_keyboard;
xf86TriState is_pointer;
xf86TriState is_joystick;
diff --git a/hw/xfree86/parser/xf86tokens.h b/hw/xfree86/parser/xf86tokens.h
index 468a2ffa2..abcafcf8e 100644
--- a/hw/xfree86/parser/xf86tokens.h
+++ b/hw/xfree86/parser/xf86tokens.h
@@ -282,6 +282,7 @@ typedef enum {
MATCH_USBID,
MATCH_DRIVER,
MATCH_TAG,
+ MATCH_LAYOUT,
MATCH_IS_KEYBOARD,
MATCH_IS_POINTER,
MATCH_IS_JOYSTICK,
diff --git a/hw/xwin/winkeybd.c b/hw/xwin/winkeybd.c
index 2fa6b3f6e..a3112fffe 100644
--- a/hw/xwin/winkeybd.c
+++ b/hw/xwin/winkeybd.c
@@ -472,8 +472,6 @@ winKeybdReleaseKeys (void)
void
winSendKeyEvent (DWORD dwKey, Bool fDown)
{
- InternalEvent* events;
-
/*
* When alt-tabing between screens we can get phantom key up messages
* Here we only pass them through it we think we should!
@@ -485,8 +483,8 @@ winSendKeyEvent (DWORD dwKey, Bool fDown)
QueueKeyboardEvents(g_pwinKeyboard, fDown ? KeyPress : KeyRelease, dwKey + MIN_KEYCODE, NULL);
- winDebug("winSendKeyEvent: dwKey: %d, fDown: %d, nEvents %d\n",
- dwKey, fDown, nevents);
+ winDebug("winSendKeyEvent: dwKey: %d, fDown: %d\n",
+ dwKey, fDown);
}
BOOL winCheckKeyPressed(WPARAM wParam, LPARAM lParam)
diff --git a/hw/xwin/winmouse.c b/hw/xwin/winmouse.c
index b1b0657cf..752334a31 100644
--- a/hw/xwin/winmouse.c
+++ b/hw/xwin/winmouse.c
@@ -244,8 +244,8 @@ winMouseButtonsSendEvent (int iEventType, int iButton)
POINTER_RELATIVE, &mask);
#if CYGDEBUG
- ErrorF("winMouseButtonsSendEvent: iEventType: %d, iButton: %d, nEvents %d\n",
- iEventType, iButton, nevents);
+ ErrorF("winMouseButtonsSendEvent: iEventType: %d, iButton: %d\n",
+ iEventType, iButton);
#endif
}
diff --git a/include/input.h b/include/input.h
index 4de4ff52c..56847ed8d 100644
--- a/include/input.h
+++ b/include/input.h
@@ -305,12 +305,6 @@ extern _X_EXPORT Bool InitPointerAccelerationScheme(
DeviceIntPtr /*dev*/,
int /*scheme*/);
-/**
- * This is not implemented and just returns FALSE.
- */
-extern _X_EXPORT _X_DEPRECATED Bool InitAbsoluteClassDeviceStruct(
- DeviceIntPtr /*device*/);
-
extern _X_EXPORT Bool InitFocusClassDeviceStruct(
DeviceIntPtr /*device*/);
diff --git a/include/inputstr.h b/include/inputstr.h
index bc0accc87..00f72c260 100644
--- a/include/inputstr.h
+++ b/include/inputstr.h
@@ -371,7 +371,6 @@ typedef struct _ClassesRec {
ButtonClassPtr button;
FocusClassPtr focus;
ProximityClassPtr proximity;
- void* _pad0; /* keep ABI during AbsoluteClass removal */
KbdFeedbackPtr kbdfeed;
PtrFeedbackPtr ptrfeed;
IntegerFeedbackPtr intfeed;
@@ -496,7 +495,6 @@ typedef struct _DeviceIntRec {
ButtonClassPtr button;
FocusClassPtr focus;
ProximityClassPtr proximity;
- void* _pad0; /* keep ABI, was pointer to abs class */
KbdFeedbackPtr kbdfeed;
PtrFeedbackPtr ptrfeed;
IntegerFeedbackPtr intfeed;
diff --git a/mi/mieq.c b/mi/mieq.c
index 031b11ab2..fc3738a41 100644
--- a/mi/mieq.c
+++ b/mi/mieq.c
@@ -43,6 +43,7 @@ in this Software without prior written authorization from The Open Group.
# include "windowstr.h"
# include "pixmapstr.h"
# include "inputstr.h"
+# include "inpututils.h"
# include "mi.h"
# include "mipointer.h"
# include "scrnintstr.h"