ref: 0f15b6c38e0e0df3bd0a40b1d16647740065a8cf
parent: 153799f1f8551685cb3851f9052a8e23890f709f
author: halfwit <michaelmisch1985@gmail.com>
date: Sat Oct 10 05:42:21 PDT 2020
Make sure everything is correct for mouse.c
--- a/mouse.c
+++ b/mouse.c
@@ -53,20 +53,20 @@
int n;
/* Magic numbers here are the size of a message from /dev/mouse and its offsets */
- if((n = c9read(x9di.ctx, &x9di.mouse.tag, 0, x9di.mouse->wroff, 1 + 4 * 12)) <= 0)
+ if((n = c9read(x9di.ctx, &x9di.mouse->tag, 0, x9di.mouse->wroff, 1 + 4 * 12)) <= 0)
return 0;
if (n != 1 + 4 * 12)
FatalError("Bad mouse event");
- if (buf[0] == 'r') {
+ if (x9di.mouse->rdbuf[0] == 'r') {
x9devResize();
return 0;
}
- *x = atoi(x9di.mouse->rdbuf + 1 + 0 * 12) - screen->r.x;
- *y = atoi(x9di.mouse->rdbuf + 1 + 1 * 12) - screen->r.y;
- *b = atoi(x9di.mouse->rdbuf + 1 + 2 * 12);
+ *x = atoi(x9di.mouse->rdbuf[1 + 0 * 12]) - screen->r.min.x;
+ *y = atoi(x9di.mouse->rdbuf[1 + 1 * 12]) - screen->r.min.y;
+ *b = atoi(x9di.mouse->rdbuf[1 + 2 * 12]);
return 1;
}
--- a/screen.c
+++ b/screen.c
@@ -55,7 +55,7 @@
}
-static void
+void
x9devResize(void)
{
if (getwindow(_display, Refnone) < 0)
--- a/x9dev.c
+++ b/x9dev.c
@@ -27,6 +27,8 @@
#include "x9dev.h"
+extern x9devInfo x9di;
+
void
x9devInfoInit(void)
{
--- a/x9dev.h
+++ b/x9dev.h
@@ -56,7 +56,7 @@
#define Msize 8192
#define NUMFORMATS (sizeof(formats)/sizeof((formats)[0]))
-typedef (void*) nil;
+typedef void* nil;
/* NOOPs for now */
#define x9devSaveScreen (void *) NoopDDA
@@ -110,6 +110,7 @@
Bool x9checkmod(unsigned int, DeviceIntPtr);
Bool x9devScreenInit(ScreenPtr, int, char **);
void x9devInfoInit(void);
+void x9devResize(void);
int x9devKeybdProc(DeviceIntPtr, int);
int x9devMouseProc(DeviceIntPtr, int);
int x9devMouseHandle(void);