summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortim <tim@capstone09.cs.pdx.edu>2011-02-08 18:46:27 -0800
committertim <tim@capstone09.cs.pdx.edu>2011-02-08 18:46:27 -0800
commit598794c4de2c00e952a44f840976d61e41f5e46b (patch)
treea051119454df444a248606706a28659aa1073fbe
parent7347714cee7b9259312af993e68cd6d4347532ce (diff)
parentb093ac73332a1bb926994c8fea217f410f59183c (diff)
Merge branch 'master' of github.com:colinhect/xf86-video-nested
-rw-r--r--src/xNestedMouse.c9
-rw-r--r--src/xNestedMouse.h25
-rw-r--r--src/xlibclient.c14
3 files changed, 48 insertions, 0 deletions
diff --git a/src/xNestedMouse.c b/src/xNestedMouse.c
index daf4956..8970d27 100644
--- a/src/xNestedMouse.c
+++ b/src/xNestedMouse.c
@@ -192,3 +192,12 @@ void Load_Nested_Mouse(pointer module) {
xf86Msg(X_INFO, "NESTED MOUSE LOADING\n");
xf86AddInputDriver(&NESTEDMOUSE, module, 0);
}
+
+void NestedPostInputEvent(NestedInputEvent event) {
+
+ if (event.type == NestedMouseMotion) {
+ xf86Msg(X_ERROR, "Received nested mouse motion event: %i %i\n", event.data.mouseMotion.x, event.data.mouseMotion.y);
+ } else {
+ xf86Msg(X_ERROR, "Received unknown nested event: %i\n", event.type);
+ }
+}
diff --git a/src/xNestedMouse.h b/src/xNestedMouse.h
index 53d4ad5..4b7a07d 100644
--- a/src/xNestedMouse.h
+++ b/src/xNestedMouse.h
@@ -1 +1,26 @@
+
+#define NestedMouseMotion 1
+#define NestedKeyPress 2
+
+typedef struct {
+ int x;
+ int y;
+} NestedMouseMotionData;
+
+typedef struct {
+ char key;
+} NestedKeyPressData;
+
+typedef union {
+ NestedMouseMotionData mouseMotion;
+ NestedKeyPressData keyPress;
+} NestedInputData;
+
+typedef struct {
+ int type;
+ NestedInputData data;
+} NestedInputEvent;
+
void Load_Nested_Mouse(pointer module);
+
+void NestedPostInputEvent(NestedInputEvent event);
diff --git a/src/xlibclient.c b/src/xlibclient.c
index ddb57f5..9a15a6b 100644
--- a/src/xlibclient.c
+++ b/src/xlibclient.c
@@ -34,6 +34,8 @@
#include "client.h"
+#include "xNestedMouse.h"
+
struct NestedClientPrivate {
Display *display;
int screenNumber;
@@ -266,6 +268,17 @@ NestedClientTimerCallback(NestedClientPrivatePtr pPriv) {
}
if (ev.type == MotionNotify) {
+
+ // Create a nested input event and send it to the input driver.
+ NestedInputEvent nev;
+ nev.type = NestedMouseMotion;
+
+ nev.data.mouseMotion.x = ((XMotionEvent*)&ev)->x;
+ nev.data.mouseMotion.y = ((XMotionEvent*)&ev)->y;
+
+ NestedPostInputEvent(nev);
+
+ /*
XDrawString(pPriv->display, pPriv->window,
DefaultGC(pPriv->display, pPriv->screenNumber),
((XMotionEvent*)&ev)->x, ((XMotionEvent*)&ev)->y,
@@ -274,6 +287,7 @@ NestedClientTimerCallback(NestedClientPrivatePtr pPriv) {
DefaultGC(pPriv->display, pPriv->screenNumber),
((XMotionEvent*)&ev)->x_root,
((XMotionEvent*)&ev)->y_root, msg2, strlen(msg2));
+ */
}
if (ev.type == EnterNotify) {