Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fdb80e3

Browse files
7408647nphkahler
authored andcommitted
Fix: macOS points not draggable
On macOS 26, interactive dragging could appear “stuck” because the one-shot NSTimer was registered only for the run loop’s default mode. During mouse drags AppKit runs the main run loop in an event-tracking mode, where default-mode timers don’t fire. Register the timer in NSRunLoopCommonModes so it continues firing during tracking and interactive updates keep running.
1 parent a509d66 commit fdb80e3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/platform/guimac.mm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,9 @@ void RunAfter(unsigned milliseconds) override {
176176
if(timer != NULL) {
177177
[timer invalidate];
178178
}
179-
timer = [NSTimer scheduledTimerWithTimeInterval:(milliseconds / 1000.0)
179+
timer = [NSTimer timerWithTimeInterval:(milliseconds / 1000.0)
180180
invocation:invocation repeats:NO];
181+
[[NSRunLoop currentRunLoop] addTimer:timer forMode:NSRunLoopCommonModes];
181182
}
182183

183184
~TimerImplCocoa() {

0 commit comments

Comments
 (0)