Commit a6ae4792 authored by Alan Third's avatar Alan Third
Browse files

Post AppDefined events from the main thread ONLY (bug#23934)

* src/nsterm.h: Make nextappdefined var not just GNUStep.
* src/nsterm.c (ns_send_appdefined, sendFromMainThread): Remove GNUStep
parent d35d398b
......@@ -380,9 +380,9 @@ char const * nstrace_fullscreen_type_name (int);
#endif
#ifdef NS_IMPL_GNUSTEP
BOOL applicationDidFinishLaunchingCalled;
#endif
@public
int nextappdefined;
#endif
}
- (void)logNotification: (NSNotification *)notification;
- (void)antialiasThresholdDidChange:(NSNotification *)notification;
......
......@@ -3918,8 +3918,8 @@ overwriting cursor (usually when cursor on a tab) */
{
NSTRACE_WHEN (NSTRACE_GROUP_EVENTS, "ns_send_appdefined(%d)", value);
#ifdef NS_IMPL_GNUSTEP
// GNUstep needs postEvent to happen on the main thread.
// Cocoa needs nextEventMatchingMask to happen on the main thread too.
if (! [[NSThread currentThread] isMainThread])
{
EmacsApp *app = (EmacsApp *)NSApp;
......@@ -3929,7 +3929,6 @@ overwriting cursor (usually when cursor on a tab) */
waitUntilDone:YES];
return;
}
#endif
/* Only post this event if we haven't already posted one. This will end
the [NXApp run] main loop after having processed all events queued at
......@@ -5542,12 +5541,10 @@ - (void)timeout_handler: (NSTimer *)timedEntry
ns_send_appdefined (-2);
}
#ifdef NS_IMPL_GNUSTEP
- (void)sendFromMainThread:(id)unused
{
ns_send_appdefined (nextappdefined);
}
#endif
- (void)fd_handler:(id)unused
/* --------------------------------------------------------------------------
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment