diff options
| author | Andrew Choi | 2002-08-11 00:26:24 +0000 |
|---|---|---|
| committer | Andrew Choi | 2002-08-11 00:26:24 +0000 |
| commit | 8030369ccb5c871d3ce11b96c220f318bc741ed8 (patch) | |
| tree | b2989661fb58dd8d3c70d7c915a98dd444dee1c1 /src/mac.c | |
| parent | 1e7c162fa46946be3686f97470dd2b1f4eb0ab7d (diff) | |
| download | emacs-8030369ccb5c871d3ce11b96c220f318bc741ed8.tar.gz emacs-8030369ccb5c871d3ce11b96c220f318bc741ed8.zip | |
2002-08-10 Andrew Choi <akochoi@shaw.ca>
* mac.c (sys_select) [MAC_OSX]: New function.
* macterm.c (MakeMeTheFrontProcess): New function.
(mac_initialize): Call MakeMeTheFrontProcess.
* s/darwin.h: Define select to sys_select.
Diffstat (limited to 'src/mac.c')
| -rw-r--r-- | src/mac.c | 24 |
1 files changed, 24 insertions, 0 deletions
| @@ -2745,6 +2745,30 @@ and t is the same as `SECONDARY'. */) | |||
| 2745 | return Qnil; | 2745 | return Qnil; |
| 2746 | } | 2746 | } |
| 2747 | 2747 | ||
| 2748 | #ifdef MAC_OSX | ||
| 2749 | #undef select | ||
| 2750 | |||
| 2751 | extern int inhibit_window_system; | ||
| 2752 | |||
| 2753 | /* When Emacs is started from the Finder, SELECT always immediately | ||
| 2754 | returns as if input is present when file descriptor 0 is polled for | ||
| 2755 | input. Strangely, when Emacs is run as a GUI application from the | ||
| 2756 | command line, it blocks in the same situation. This `wrapper' of | ||
| 2757 | the system call SELECT corrects this discrepancy. */ | ||
| 2758 | int | ||
| 2759 | sys_select (n, rfds, wfds, efds, timeout) | ||
| 2760 | int n; | ||
| 2761 | SELECT_TYPE *rfds; | ||
| 2762 | SELECT_TYPE *wfds; | ||
| 2763 | SELECT_TYPE *efds; | ||
| 2764 | struct timeval *timeout; | ||
| 2765 | { | ||
| 2766 | if (!inhibit_window_system && rfds && FD_ISSET (0, rfds)) | ||
| 2767 | return 1; | ||
| 2768 | else | ||
| 2769 | return select (n, rfds, wfds, efds, timeout); | ||
| 2770 | } | ||
| 2771 | #endif /* MAC_OSX */ | ||
| 2748 | 2772 | ||
| 2749 | void | 2773 | void |
| 2750 | syms_of_mac () | 2774 | syms_of_mac () |