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
This commit is contained in:
Alan Third 2016-07-20 21:59:17 +01:00
parent d35d398bdb
commit a6ae479216
2 changed files with 2 additions and 5 deletions

View file

@ -380,9 +380,9 @@ char const * nstrace_fullscreen_type_name (int);
#endif #endif
#ifdef NS_IMPL_GNUSTEP #ifdef NS_IMPL_GNUSTEP
BOOL applicationDidFinishLaunchingCalled; BOOL applicationDidFinishLaunchingCalled;
#endif
@public @public
int nextappdefined; int nextappdefined;
#endif
} }
- (void)logNotification: (NSNotification *)notification; - (void)logNotification: (NSNotification *)notification;
- (void)antialiasThresholdDidChange:(NSNotification *)notification; - (void)antialiasThresholdDidChange:(NSNotification *)notification;

View file

@ -3918,8 +3918,8 @@ overwriting cursor (usually when cursor on a tab) */
{ {
NSTRACE_WHEN (NSTRACE_GROUP_EVENTS, "ns_send_appdefined(%d)", value); NSTRACE_WHEN (NSTRACE_GROUP_EVENTS, "ns_send_appdefined(%d)", value);
#ifdef NS_IMPL_GNUSTEP
// GNUstep needs postEvent to happen on the main thread. // GNUstep needs postEvent to happen on the main thread.
// Cocoa needs nextEventMatchingMask to happen on the main thread too.
if (! [[NSThread currentThread] isMainThread]) if (! [[NSThread currentThread] isMainThread])
{ {
EmacsApp *app = (EmacsApp *)NSApp; EmacsApp *app = (EmacsApp *)NSApp;
@ -3929,7 +3929,6 @@ overwriting cursor (usually when cursor on a tab) */
waitUntilDone:YES]; waitUntilDone:YES];
return; return;
} }
#endif
/* Only post this event if we haven't already posted one. This will end /* 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 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); ns_send_appdefined (-2);
} }
#ifdef NS_IMPL_GNUSTEP
- (void)sendFromMainThread:(id)unused - (void)sendFromMainThread:(id)unused
{ {
ns_send_appdefined (nextappdefined); ns_send_appdefined (nextappdefined);
} }
#endif
- (void)fd_handler:(id)unused - (void)fd_handler:(id)unused
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------