diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2024-04-01 17:58:04 +0800 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2024-04-01 17:58:04 +0800 |
commit | 3af419ed0f0bf23320f8a7ac3479e2c50c353cde (patch) | |
tree | fa45f6aee9812f8684ca888823c89cdcc89e6ddb /src/w32xfns.c | |
parent | 101801ca13632ae17b486f690701b9cb36868676 (diff) | |
parent | 87be53846bfbf5a6387cb5a40105bd0fc5b48b38 (diff) | |
download | emacs-3af419ed0f0bf23320f8a7ac3479e2c50c353cde.tar.gz |
Merge upstream Git snapshot into athena/unstable
Diffstat (limited to 'src/w32xfns.c')
-rw-r--r-- | src/w32xfns.c | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/src/w32xfns.c b/src/w32xfns.c index fa7d5fbdb61..b248697e658 100644 --- a/src/w32xfns.c +++ b/src/w32xfns.c @@ -23,6 +23,20 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */ #include <windows.h> #include <windowsx.h> +#ifdef WINDOWSNT +/* Override API version to get the required functionality. */ +# undef _WIN32_WINNT +# define _WIN32_WINNT 0x0501 +/* mingw.org's MinGW headers mistakenly omit this enumeration: */ +# ifndef MINGW_W64 +typedef enum _WTS_VIRTUAL_CLASS { + WTSVirtualClientData, + WTSVirtualFileHandle +} WTS_VIRTUAL_CLASS; +# endif +#include <wtsapi32.h> /* for WM_WTSSESSION_CHANGE, WTS_SESSION_LOCK */ +#endif /* WINDOWSNT */ + #include "lisp.h" #include "frame.h" #include "w32term.h" @@ -413,8 +427,18 @@ drain_message_queue (void) while (PeekMessage (&msg, NULL, 0, 0, PM_REMOVE)) { - if (msg.message == WM_EMACS_FILENOTIFY) - retval = 1; + switch (msg.message) + { +#ifdef WINDOWSNT + case WM_WTSSESSION_CHANGE: + if (msg.wParam == WTS_SESSION_LOCK) + reset_w32_kbdhook_state (); + break; +#endif + case WM_EMACS_FILENOTIFY: + retval = 1; + break; + } TranslateMessage (&msg); DispatchMessage (&msg); } |