diff options
author | Eli Zaretskii <eliz@gnu.org> | 2012-10-10 19:11:25 +0200 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2012-10-10 19:11:25 +0200 |
commit | 182b170f7ec712b7f89ada65095aae5bb8fe553e (patch) | |
tree | 7f3d70b6c8cfc035b0e753c016a12b69067a4866 /src/w32notify.c | |
parent | b97f22cdad55a0964758cef3a19ce3fa1098657d (diff) |
Support file notifications in a TTY session.
FIXME: file notifications detected only when the Emacs window has focus.
Diffstat (limited to 'src/w32notify.c')
-rw-r--r-- | src/w32notify.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/w32notify.c b/src/w32notify.c index 05c918d8ac..5954763563 100644 --- a/src/w32notify.c +++ b/src/w32notify.c @@ -115,10 +115,6 @@ send_notifications (BYTE *info, DWORD info_size, HANDLE hdir, int *terminate) int done = 0; FRAME_PTR f = SELECTED_FRAME (); - /* Too bad, but PostMessage will not work in non-GUI sessions. - FIXME. */ - if (!FRAME_W32_P (f)) - return; /* A single buffer is used to communicate all notifications to the main thread. Since both the main thread and several watcher @@ -138,11 +134,14 @@ send_notifications (BYTE *info, DWORD info_size, HANDLE hdir, int *terminate) memcpy (file_notifications, info, info_size); notifications_size = info_size; notifications_desc = hdir; - /* If PostMessage fails, the message queue is full. If that - happens, the last thing they will worry about is file - notifications. So we effectively discard the - notification in that case. */ - if (PostMessage (FRAME_W32_WINDOW (f), WM_EMACS_FILENOTIFY, 0, 0)) + if (FRAME_TERMCAP_P (f) + || (FRAME_W32_P (f) + /* If PostMessage fails, the message queue is full. + If that happens, the last thing they will worry + about is file notifications. So we effectively + discard the notification in that case. */ + && PostMessage (FRAME_W32_WINDOW (f), + WM_EMACS_FILENOTIFY, 0, 0))) notification_buffer_in_use = 1; done = 1; } |