aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlan Third2016-07-20 21:59:17 +0100
committerAlan Third2016-08-03 17:19:12 +0100
commita6ae47921603da8c28354c120e84507b44a761e5 (patch)
tree8e30fabfc13aa4b70863983dcc6b4f8ff5ca7e2b /src
parentd35d398bdbeb393f3ebf17918d82c7573562f01e (diff)
downloademacs-a6ae47921603da8c28354c120e84507b44a761e5.tar.gz
emacs-a6ae47921603da8c28354c120e84507b44a761e5.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/nsterm.h2
-rw-r--r--src/nsterm.m5
2 files changed, 2 insertions, 5 deletions
diff --git a/src/nsterm.h b/src/nsterm.h
index 0aea9cca112..4b246bd3d0f 100644
--- a/src/nsterm.h
+++ b/src/nsterm.h
@@ -380,9 +380,9 @@ char const * nstrace_fullscreen_type_name (int);
380#endif 380#endif
381#ifdef NS_IMPL_GNUSTEP 381#ifdef NS_IMPL_GNUSTEP
382 BOOL applicationDidFinishLaunchingCalled; 382 BOOL applicationDidFinishLaunchingCalled;
383#endif
383@public 384@public
384 int nextappdefined; 385 int nextappdefined;
385#endif
386} 386}
387- (void)logNotification: (NSNotification *)notification; 387- (void)logNotification: (NSNotification *)notification;
388- (void)antialiasThresholdDidChange:(NSNotification *)notification; 388- (void)antialiasThresholdDidChange:(NSNotification *)notification;
diff --git a/src/nsterm.m b/src/nsterm.m
index e6a10b89f81..4d9d10559ea 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -3918,8 +3918,8 @@ ns_send_appdefined (int value)
3918{ 3918{
3919 NSTRACE_WHEN (NSTRACE_GROUP_EVENTS, "ns_send_appdefined(%d)", value); 3919 NSTRACE_WHEN (NSTRACE_GROUP_EVENTS, "ns_send_appdefined(%d)", value);
3920 3920
3921#ifdef NS_IMPL_GNUSTEP
3922 // GNUstep needs postEvent to happen on the main thread. 3921 // GNUstep needs postEvent to happen on the main thread.
3922 // Cocoa needs nextEventMatchingMask to happen on the main thread too.
3923 if (! [[NSThread currentThread] isMainThread]) 3923 if (! [[NSThread currentThread] isMainThread])
3924 { 3924 {
3925 EmacsApp *app = (EmacsApp *)NSApp; 3925 EmacsApp *app = (EmacsApp *)NSApp;
@@ -3929,7 +3929,6 @@ ns_send_appdefined (int value)
3929 waitUntilDone:YES]; 3929 waitUntilDone:YES];
3930 return; 3930 return;
3931 } 3931 }
3932#endif
3933 3932
3934 /* Only post this event if we haven't already posted one. This will end 3933 /* Only post this event if we haven't already posted one. This will end
3935 the [NXApp run] main loop after having processed all events queued at 3934 the [NXApp run] main loop after having processed all events queued at
@@ -5542,12 +5541,10 @@ not_in_argv (NSString *arg)
5542 ns_send_appdefined (-2); 5541 ns_send_appdefined (-2);
5543} 5542}
5544 5543
5545#ifdef NS_IMPL_GNUSTEP
5546- (void)sendFromMainThread:(id)unused 5544- (void)sendFromMainThread:(id)unused
5547{ 5545{
5548 ns_send_appdefined (nextappdefined); 5546 ns_send_appdefined (nextappdefined);
5549} 5547}
5550#endif
5551 5548
5552- (void)fd_handler:(id)unused 5549- (void)fd_handler:(id)unused
5553/* -------------------------------------------------------------------------- 5550/* --------------------------------------------------------------------------