diff --git a/src/ChangeLog b/src/ChangeLog index 06f3a9403e3..fd840e0c07b 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,8 @@ 2014-05-26 Jan Djärv + * nsfns.m (Fns_do_applescript): Surround NSApp run + with calls to ns_init_events, ns_finish_events (Bug#17424). + * nsterm.h (ns_init_events, ns_finish_events): Declare. * nsterm.m (ns_init_events, ns_finish_events): New functions. diff --git a/src/nsfns.m b/src/nsfns.m index 0f2c2e693f7..00a488079c4 100644 --- a/src/nsfns.m +++ b/src/nsfns.m @@ -2094,10 +2094,8 @@ and GNUstep implementations ("distributor-specific release [[NSAppleScript alloc] initWithSource: [NSString stringWithUTF8String: SSDATA (script)]]; - ns_init_events (); returnDescriptor = [scriptObject executeAndReturnError: &errorDict]; [scriptObject release]; - ns_finish_events (); *result = Qnil; if (returnDescriptor != NULL) @@ -2158,6 +2156,7 @@ and GNUstep implementations ("distributor-specific release Lisp_Object result; int status; NSEvent *nxev; + struct input_event ev; CHECK_STRING (script); check_window_system (NULL); @@ -2185,8 +2184,10 @@ and GNUstep implementations ("distributor-specific release // If there are other events, the event loop may exit. Keep running // until the script has been handled. */ + ns_init_events (&ev); while (! NILP (as_script)) [NSApp run]; + ns_finish_events (); status = as_status; as_status = 0;