Merge from emacs-24; up to 2012-12-26T22:30:58Z!yamaoka@jpl.org
[bpt/emacs.git] / src / xgselect.c
index 2c8e967..0b5ad6a 100644 (file)
@@ -26,6 +26,7 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #include <glib.h>
 #include <errno.h>
 #include "xterm.h"
+#include "frame.h"
 
 int
 xg_select (int fds_lim, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds,
@@ -43,7 +44,7 @@ xg_select (int fds_lim, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds,
   int i, nfds, tmo_in_millisec;
   USE_SAFE_ALLOCA;
 
-  if (! (x_in_use
+  if (! (window_system_available (NULL)
         && g_main_context_pending (context = g_main_context_default ())))
     return pselect (fds_lim, rfds, wfds, efds, timeout, sigmask);