Merge from emacs-24; up to 2012-12-25T11:37:21Z!dmantipov@yandex.ru
[bpt/emacs.git] / src / w32xfns.c
index cb45257..03611e1 100644 (file)
@@ -1,5 +1,6 @@
 /* Functions taken directly from X sources for use with the Microsoft Windows API.
-   Copyright (C) 1989, 1992-1995, 1999, 2001-2012  Free Software Foundation, Inc.
+   Copyright (C) 1989, 1992-1995, 1999, 2001-2013 Free Software
+   Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -315,16 +316,22 @@ prepend_msg (W32Msg *lpmsg)
   return (TRUE);
 }
 
-/* Process all messages in the current thread's queue.  */
-void
+/* Process all messages in the current thread's queue.  Value is 1 if
+   one of these messages was WM_EMACS_FILENOTIFY, zero otherwise.  */
+int
 drain_message_queue (void)
 {
   MSG msg;
+  int retval = 0;
+
   while (PeekMessage (&msg, NULL, 0, 0, PM_REMOVE))
     {
+      if (msg.message == WM_EMACS_FILENOTIFY)
+       retval = 1;
       TranslateMessage (&msg);
       DispatchMessage (&msg);
     }
+  return retval;
 }
 
 /* x_sync is a no-op on W32.  */