Mercurial > emacs
comparison src/mac.c @ 46856:eba75fedd593
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.
author | Andrew Choi <akochoi@shaw.ca> |
---|---|
date | Sun, 11 Aug 2002 00:26:24 +0000 |
parents | 3d4689375228 |
children | aff9c7fcedb0 |
comparison
equal
deleted
inserted
replaced
46855:f3a9fdb839d2 | 46856:eba75fedd593 |
---|---|
2743 return val; | 2743 return val; |
2744 } | 2744 } |
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 () |
2751 { | 2775 { |
2752 QCLIPBOARD = intern ("CLIPBOARD"); | 2776 QCLIPBOARD = intern ("CLIPBOARD"); |