summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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(