summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorquou <quou@disroot.org>2024-07-27 16:21:19 +1000
committerquou <quou@disroot.org>2024-07-27 16:21:19 +1000
commit636f4f366b9a0f1f365f9b5132273f90fab0d353 (patch)
treee1eef1e80884db2c1783386ba830b14d2e96d2aa
parent4cacaad9e392bf5fe63a90019411f21a72db0e7a (diff)
fix x11 mouse stuff
-rw-r--r--plat.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/plat.c b/plat.c
index 5f77e8a..6c10b29 100644
--- a/plat.c
+++ b/plat.c
@@ -463,6 +463,7 @@ App* new_app(Heap* mem, int w, int h, const char* n) {
a->h = h;
i->d = XOpenDisplay(0);
i->omx = i->omy = 0;
+ i->ms = 1;
if (!i->d) {
print_err("Failed to open X11 display.\n");
pbreak(error_platform_error);
@@ -565,6 +566,20 @@ void app_begin(App* a) {
a->dmy = a->my - i->omy;
i->omx = a->mx;
i->omy = a->my;
+ if (!i->ms) {
+ XWarpPointer(
+ d,
+ i->wi,
+ i->wi,
+ 0,
+ 0,
+ 0,
+ 0,
+ i->w / 2,
+ i->h / 2
+ );
+ XSync(d, False);
+ }
}
void app_rencpy(