Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5343,6 +5343,7 @@ public <T, E extends Exception> T syncCall(SwtCallable<T, E> callable) throws E
* @exception SWTException <ul>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_NO_HANDLES if a handle could not be obtained for timer creation</li>
* </ul>
*
* @see #asyncExec
Expand Down Expand Up @@ -5390,14 +5391,13 @@ public void timerExec (int milliseconds, Runnable runnable) {
}
NSNumber userInfo = NSNumber.numberWithInt(index);
NSTimer timer = NSTimer.scheduledTimerWithTimeInterval(milliseconds / 1000.0, timerDelegate, OS.sel_timerProc_, userInfo, false);
if (timer == null) SWT.error (SWT.ERROR_NO_HANDLES);
NSRunLoop runLoop = NSRunLoop.currentRunLoop();
runLoop.addTimer(timer, OS.NSModalPanelRunLoopMode);
runLoop.addTimer(timer, OS.NSEventTrackingRunLoopMode);
timer.retain();
if (timer != null) {
nsTimers [index] = timer;
timerList [index] = runnable;
}
nsTimers [index] = timer;
timerList [index] = runnable;
}

long timerProc (long id, long sel, long timerID) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5655,6 +5655,7 @@ public boolean sleep () {
* @exception SWTException <ul>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_NO_HANDLES if a handle could not be obtained for timer creation</li>
* </ul>
*
* @see #asyncExec
Expand Down Expand Up @@ -5696,10 +5697,9 @@ public void timerExec (int milliseconds, Runnable runnable) {
} else {
timerId = GDK.gdk_threads_add_timeout (milliseconds, timerProc, index);
}
if (timerId != 0) {
timerIds [index] = timerId;
timerList [index] = runnable;
}
if (timerId == 0) SWT.error (SWT.ERROR_NO_HANDLES);
timerIds [index] = timerId;
timerList [index] = runnable;
}

long timerProc (long i) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4961,6 +4961,7 @@ public <T, E extends Exception> T syncCall(SwtCallable<T, E> callable) throws E
* @exception SWTException <ul>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_NO_HANDLES if a handle could not be obtained for timer creation</li>
* </ul>
*
* @see #asyncExec
Expand Down Expand Up @@ -5002,10 +5003,9 @@ public void timerExec (int milliseconds, Runnable runnable) {
}
}
long newTimerID = OS.SetTimer (hwndMessage, timerId, milliseconds, 0);
if (newTimerID != 0) {
timerList [index] = runnable;
timerIds [index] = newTimerID;
}
if (newTimerID == 0) SWT.error (SWT.ERROR_NO_HANDLES);
timerList [index] = runnable;
timerIds [index] = newTimerID;
}

boolean translateAccelerator (MSG msg, Control control) {
Expand Down
Loading