summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2013-11-14 17:02:04 +0900
committerKeith Packard <keithp@keithp.com>2013-11-14 17:02:04 +0900
commit29240e5cbf6e7f875b128fc7bfc4d56b2350835a (patch)
tree585ad5a6aa09d41f8cccef8d1362da72c591c833 /hw
parent0492deb8f8238b7782e5a706ec6219d88aa1091d (diff)
parent8ff7e32c3ef7b0c13c4ab9664f651e9782d35a85 (diff)
Merge remote-tracking branch 'whot/for-keith'
Diffstat (limited to 'hw')
-rw-r--r--hw/kdrive/ephyr/ephyr.c9
-rw-r--r--hw/kdrive/ephyr/hostx.c4
-rw-r--r--hw/kdrive/src/kdrive.c3
-rw-r--r--hw/kdrive/src/kdrive.h1
-rw-r--r--hw/kdrive/src/kinput.c10
5 files changed, 19 insertions, 8 deletions
diff --git a/hw/kdrive/ephyr/ephyr.c b/hw/kdrive/ephyr/ephyr.c
index 91e949d79..ef4b3210c 100644
--- a/hw/kdrive/ephyr/ephyr.c
+++ b/hw/kdrive/ephyr/ephyr.c
@@ -959,7 +959,14 @@ ephyrProcessMouseMotion(xcb_generic_event_t *xev)
}
EPHYR_LOG("final (x,y):(%d,%d)\n", x, y);
#endif
- KdEnqueuePointerEvent(ephyrMouse, mouseState, x, y, 0);
+
+ /* convert coords into desktop-wide coordinates.
+ * fill_pointer_events will convert that back to
+ * per-screen coordinates where needed */
+ x += screen->pScreen->x;
+ y += screen->pScreen->y;
+
+ KdEnqueuePointerEvent(ephyrMouse, mouseState | KD_POINTER_DESKTOP, x, y, 0);
}
}
diff --git a/hw/kdrive/ephyr/hostx.c b/hw/kdrive/ephyr/hostx.c
index ee9ae455c..3e01a4770 100644
--- a/hw/kdrive/ephyr/hostx.c
+++ b/hw/kdrive/ephyr/hostx.c
@@ -304,8 +304,8 @@ hostx_init(void)
| XCB_EVENT_MASK_STRUCTURE_NOTIFY;
EPHYR_DBG("mark");
-
- if ((HostX.conn = xcb_connect(NULL, &HostX.screen)) == NULL) {
+ HostX.conn = xcb_connect(NULL, &HostX.screen);
+ if (xcb_connection_has_error(HostX.conn)) {
fprintf(stderr, "\nXephyr cannot open host display. Is DISPLAY set?\n");
exit(1);
}
diff --git a/hw/kdrive/src/kdrive.c b/hw/kdrive/src/kdrive.c
index f8949bec3..382968420 100644
--- a/hw/kdrive/src/kdrive.c
+++ b/hw/kdrive/src/kdrive.c
@@ -328,7 +328,8 @@ KdParseScreen(KdScreenInfo * screen, const char *arg)
screen->height = pixels;
screen->height_mm = mm;
}
- if (delim != 'x' && delim != '@' && delim != 'X' && delim != 'Y')
+ if (delim != 'x' && delim != '@' && delim != 'X' && delim != 'Y' &&
+ (delim != '\0' || i == 0))
return;
}
diff --git a/hw/kdrive/src/kdrive.h b/hw/kdrive/src/kdrive.h
index d5d0799df..296d611ed 100644
--- a/hw/kdrive/src/kdrive.h
+++ b/hw/kdrive/src/kdrive.h
@@ -506,6 +506,7 @@ KdEnqueueKeyboardEvent(KdKeyboardInfo * ki, unsigned char scan_code,
#define KD_BUTTON_4 0x08
#define KD_BUTTON_5 0x10
#define KD_BUTTON_8 0x80
+#define KD_POINTER_DESKTOP 0x40000000
#define KD_MOUSE_DELTA 0x80000000
void
diff --git a/hw/kdrive/src/kinput.c b/hw/kdrive/src/kinput.c
index d845830cc..a9a9fa583 100644
--- a/hw/kdrive/src/kinput.c
+++ b/hw/kdrive/src/kinput.c
@@ -1895,6 +1895,8 @@ KdEnqueuePointerEvent(KdPointerInfo * pi, unsigned long flags, int rx, int ry,
}
else {
dixflags = POINTER_ABSOLUTE;
+ if (flags & KD_POINTER_DESKTOP)
+ dixflags |= POINTER_DESKTOP;
if (x != pi->dixdev->last.valuators[0] ||
y != pi->dixdev->last.valuators[1])
_KdEnqueuePointerEvent(pi, MotionNotify, x, y, z, 0, dixflags,
@@ -2028,25 +2030,25 @@ KdCursorOffScreen(ScreenPtr *ppScreen, int *x, int *y)
dx = KdScreenOrigin(pNewScreen)->x - KdScreenOrigin(pScreen)->x;
dy = KdScreenOrigin(pNewScreen)->y - KdScreenOrigin(pScreen)->y;
if (*x < 0) {
- if (dx <= 0 && -dx < best_x) {
+ if (dx < 0 && -dx < best_x) {
best_x = -dx;
n_best_x = n;
}
}
else if (*x >= pScreen->width) {
- if (dx >= 0 && dx < best_x) {
+ if (dx > 0 && dx < best_x) {
best_x = dx;
n_best_x = n;
}
}
if (*y < 0) {
- if (dy <= 0 && -dy < best_y) {
+ if (dy < 0 && -dy < best_y) {
best_y = -dy;
n_best_y = n;
}
}
else if (*y >= pScreen->height) {
- if (dy >= 0 && dy < best_y) {
+ if (dy > 0 && dy < best_y) {
best_y = dy;
n_best_y = n;
}