aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Weissflog <floooh@gmail.com>2021-02-25 17:07:37 +0100
committerAndre Weissflog <floooh@gmail.com>2021-02-25 17:07:42 +0100
commitfeab36e67fde490bdd08d5e174f524b52aad5cd0 (patch)
tree18b68796308ab2aef4995739736cf768db6268a5
parent4cd2da815a93faba4dd5368b23048ae528b63ddc (diff)
sokol_app.h macOS: use NSEventTrackingRunLoopMode for event polling
See #486.
-rw-r--r--sokol_app.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/sokol_app.h b/sokol_app.h
index a30fc9bf..e9f90787 100644
--- a/sokol_app.h
+++ b/sokol_app.h
@@ -3293,7 +3293,9 @@ _SOKOL_PRIVATE void _sapp_macos_poll_input_events() {
NSEventMaskDirectTouch;
@autoreleasepool {
for (;;) {
- NSEvent* event = [NSApp nextEventMatchingMask:mask untilDate:nil inMode:NSDefaultRunLoopMode dequeue:YES];
+ // NOTE: using NSDefaultRunLoopMode here causes stuttering in the GL backend,
+ // see: https://github.com/floooh/sokol/issues/486
+ NSEvent* event = [NSApp nextEventMatchingMask:mask untilDate:nil inMode:NSEventTrackingRunLoopMode dequeue:YES];
if (event == nil) {
break;
}