diff options
| author | Eli Zaretskii | 2012-10-07 16:50:29 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2012-10-07 16:50:29 +0200 |
| commit | d263a63399d2b9d20ff2fc963b7d01817c3d3368 (patch) | |
| tree | 82c4fd8abd789c7f9020e506f2bae37cd56ca415 /src | |
| parent | 557337e9a22da64445d64bb9577d178e4d7024d7 (diff) | |
| download | emacs-d263a63399d2b9d20ff2fc963b7d01817c3d3368.tar.gz emacs-d263a63399d2b9d20ff2fc963b7d01817c3d3368.zip | |
Add a comment with overview of how Emacs input works on MS-Windows.
Diffstat (limited to 'src')
| -rw-r--r-- | src/w32fns.c | 21 | ||||
| -rw-r--r-- | src/w32term.c | 3 |
2 files changed, 24 insertions, 0 deletions
diff --git a/src/w32fns.c b/src/w32fns.c index 6d5d6822354..0dbeb232db9 100644 --- a/src/w32fns.c +++ b/src/w32fns.c | |||
| @@ -2246,6 +2246,27 @@ unregister_hot_keys (HWND hwnd) | |||
| 2246 | } | 2246 | } |
| 2247 | } | 2247 | } |
| 2248 | 2248 | ||
| 2249 | /* Here's an overview of how Emacs input works on MS-Windows. | ||
| 2250 | |||
| 2251 | System messages are read and processed by w32_msg_pump below. This | ||
| 2252 | function runs in a separate thread. It handles a small number of | ||
| 2253 | custom WM_EMACS_* messages (posted by the main thread, look for | ||
| 2254 | PostMessage calls), and dispatches the rest to w32_wnd_proc, which | ||
| 2255 | is the main window procedure for the entire Emacs application. | ||
| 2256 | |||
| 2257 | w32_wnd_proc also runs in the same separate input thread. It | ||
| 2258 | handles some messages, mostly those that need GDI calls, by itself. | ||
| 2259 | For the others, it calls my_post_msg, which inserts the messages | ||
| 2260 | into the input queue serviced by w32_read_socket. | ||
| 2261 | |||
| 2262 | w32_read_socket runs in the main (a.k.a. "Lisp") thread, and is | ||
| 2263 | called synchronously from keyboard.c when it is known or suspected | ||
| 2264 | that some input is available. w32_read_socket either handles | ||
| 2265 | messages immediately, or converts them messages into Emacs input | ||
| 2266 | events and stuffs them into kbd_buffer, where kbd_buffer_get_event | ||
| 2267 | can get at them and process them when read_char and its callers | ||
| 2268 | require input. */ | ||
| 2269 | |||
| 2249 | /* Main message dispatch loop. */ | 2270 | /* Main message dispatch loop. */ |
| 2250 | 2271 | ||
| 2251 | static void | 2272 | static void |
diff --git a/src/w32term.c b/src/w32term.c index 1cc8bd2adef..517813672c4 100644 --- a/src/w32term.c +++ b/src/w32term.c | |||
| @@ -4138,6 +4138,9 @@ static char dbcs_lead = 0; | |||
| 4138 | This routine is called by the SIGIO handler. | 4138 | This routine is called by the SIGIO handler. |
| 4139 | We return as soon as there are no more events to be read. | 4139 | We return as soon as there are no more events to be read. |
| 4140 | 4140 | ||
| 4141 | For an overview of how Emacs input works on MS-Windows, see the | ||
| 4142 | commentary before w32_msg_pump in w32fns.c. | ||
| 4143 | |||
| 4141 | We return the number of characters stored into the buffer, | 4144 | We return the number of characters stored into the buffer, |
| 4142 | thus pretending to be `read'. | 4145 | thus pretending to be `read'. |
| 4143 | 4146 | ||