diff options
author | Alan Third <alan@idiocy.org> | 2018-06-23 15:26:26 +0100 |
---|---|---|
committer | Alan Third <alan@idiocy.org> | 2020-03-22 15:31:45 +0000 |
commit | 3316e78c120f69aa3ac12ff7345a79dd09654c9a (patch) | |
tree | 95dab41336265e82d71bc45c621733bfdbe06a74 /src/emacs.c | |
parent | 41f54289058ec42829cd19f7c469b2e4e325b830 (diff) | |
download | emacs-scratch/ns/next.tar.gz |
Run NSApp loop in its own threadscratch/ns/next
* src/emacs.c (main) [HAVE_NS]: Rename to emacs_main.
* src/lisp.h (emacs_main) [HAVE_NS]: Define function.
* src/nsfns.m (Fns_do_applescript): Remove runloop.
(Fx_create_frame): Initialize the frame on the main thread.
* src/nsterm.h ([EmacsApp initLispThread:withArgv:]): New method.
([EmacsApp fd_handler:]):
([EmacsApp timeout_handler:]):
([EmacsApp sendFromMainThread:]): Remove function definitions.
([EmacsApp initLispThread:]): New function.
([EmacsThread initWithArgc:Argv:]):
([EmacsThread sendEmacsEvent:NSEvent:frameOrWindow:]): New functions.
* src/nsterm.m (EV_TRAILER): Reduce to a single function.
(EV_TRAILER2): Remove.
(ns_init_events):
(ns_finish_events):
(hold_event):
(ns_send_appdefined):
(ns_run_loop_break):
([EmacsApp timeout_handler:]):
([EmacsApp sendFromMainThread:]):
([EmacsApp fd_handler:]): Remove functions.
(ns_check_menu_open):
([EmacsApp newFrame:]):
([EmacsApp openFile:]):
([EmacsApp terminate:]):
([EmacsApp fulfillService:withArg:]):
([EmacsView changeFont:]):
([EmacsView keyDown:]):
([EmacsView insertText:]):
([EmacsView setmarkedtext:selectedRange:]):
([EmacsView deleteWorkingText:]):
([EmacsView doCommandBySelector:]):
([EmacsView mouseDown:]):
([EmacsView mouseMoved:]):
([EmacsView windowShouldClose:]):
([EmacsView windowDidResize:]):
([EmacsView windowDidBecomeKey]):
([EmacsView windowDidResignKey:]):
([EmacsView windowDidMove:]):
([EmacsView windowDidDeminiaturize:]):
([EmacsView windowDidExpose:]):
([EmacsView windowDidMiniaturize:]):
([EmacsView menuDown:]):
([EmacsView toolbarClicked:]):
([EmacsView toggleToolbar:]):
([EmacsView performDragOperation:]):
([EmacsScroller sendScrollEventAtLoc:fromEvent:]): Change event handling.
([EmacsApp applicationDidFinishLaunching:]):
([EmacsApp applicationDidResignActive:]): Remove call to ns_send_appdefined.
(ns_read_socket): Change event handling, use thread local runloop.
(ns_select): Remove unused fd_handler and runloop related code.
(ns_term_init): Move some NS initialisation code to new
main function and remove fd_handler related code.
([EmacsApp sendEvent:]): Stop run loop from exiting.
([EmacsApp initLispThread:withArgv:]): New method.
([EmacsThread initWithArgc:Argv:]):
([EmacsThread processEmacsEvent:]):
([EmacsThread sendEmacsEvent:NSEvent:frameOrWindow:]): New functions.
(main): New function to initialise NS stuff and run emacs_main in its
own thread.
* src/systhread.c (sys_cond_broadcast): Remove NS runloop related
code.
Diffstat (limited to 'src/emacs.c')
-rw-r--r-- | src/emacs.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/emacs.c b/src/emacs.c index ea9c4cd79dc..ad64ffa08f2 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -924,7 +924,11 @@ load_pdump (int argc, char **argv) #endif /* HAVE_PDUMPER */ int +#ifdef HAVE_NS +emacs_main (int argc, char **argv) +#else main (int argc, char **argv) +#endif { /* Variable near the bottom of the stack, and aligned appropriately for pointers. */ |