summaryrefslogtreecommitdiff
path: root/plat.c
diff options
context:
space:
mode:
authorquou <quou@disroot.org>2024-07-17 21:29:06 +1000
committerquou <quou@disroot.org>2024-07-17 21:29:06 +1000
commitb8d2cf5610f0e0ef96ded0a5de5bda54c10c9552 (patch)
tree4a639008c8cfb9e891c83aaee14ea49fefc7d87f /plat.c
parent9bbef8bd2cc004ca1baa2306a8c42120eb5fdc36 (diff)
Mouse delta
Diffstat (limited to 'plat.c')
-rw-r--r--plat.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/plat.c b/plat.c
index 5fbfb19..da32e29 100644
--- a/plat.c
+++ b/plat.c
@@ -266,6 +266,7 @@ typedef struct {
GC gc;
int w, h;
int rmx, rmy;
+ int omx, omy;
int ms;
unsigned long begin, end;
XImage* bb;
@@ -382,6 +383,7 @@ App* new_app(Heap* mem, int w, int h, const char* n) {
a->w = w;
a->h = h;
i->d = XOpenDisplay(0);
+ i->omx = i->omy = 0;
if (!i->d) {
print_err("Failed to open X11 display.\n");
pbreak(error_platform_error);
@@ -459,6 +461,10 @@ void app_begin(App* a) {
break;
}
}
+ a->dmx = a->mx - i->omx;
+ a->dmy = a->my - i->omy;
+ i->omx = a->mx;
+ i->omy = a->my;
}
void app_rencpy(