Skip to content

Commit

Permalink
enable event loop by default on macOS
Browse files Browse the repository at this point in the history
only for the Pd app, not for libpd
  • Loading branch information
Spacechild1 committed Feb 6, 2022
1 parent 042a3bf commit 101f601
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mac/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,9 @@ the UI thread must be the main thread, otherwise it won't receive any input even
to a secondary thread and runs a Cocoa event loop on the main thread.

Unfortunately, some externals like 'Gem' or 'ophelia' already run their own (polling)
event loop and expect the scheduler to run on the main thread. To maintain backwards
compatibility we can't enable the event loop by default, instead users must request
it explicitly with the "-eventloop" flag.
event loop and expect the scheduler to run on the main thread. If you want to use
these externals, you have to disable the event loop, either by unchecking
"Enable event loop" in the "Startup" dialog or by starting Pd with "-noeventloop".

For now, the event loop is only implemented for macOS, because there it is essential.
Win32 and X11, on the other hand, don't have any notion of a "main thread", so externals
Expand Down
5 changes: 5 additions & 0 deletions src/s_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,11 @@ int sys_main(int argc, const char **argv)
const char *prefsfile = "";
sys_externalschedlib = 0;
sys_extraflags = 0;
#ifdef __APPLE__
/* on macOS we enable the event loop by default,
* but only for the Pd app (not for libpd). */
sys_eventloop = 1;
#endif
#ifdef PD_DEBUG
fprintf(stderr, "Pd: COMPILED FOR DEBUGGING\n");
#endif
Expand Down

0 comments on commit 101f601

Please # to comment.