diff options
| author | Andrew Innes | 1999-05-11 13:38:10 +0000 |
|---|---|---|
| committer | Andrew Innes | 1999-05-11 13:38:10 +0000 |
| commit | ce6059daf36f47352d89a0bb146c8e8361c49d30 (patch) | |
| tree | d87488b9b4b2851a77bdac2db8e987493f7b3135 | |
| parent | e72da895c02f4528c02ef3753a847f6797112f3d (diff) | |
| download | emacs-ce6059daf36f47352d89a0bb146c8e8361c49d30.tar.gz emacs-ce6059daf36f47352d89a0bb146c8e8361c49d30.zip | |
(x_to_w32_charset): Reinstall VIETNAMESE_CHARSET
definition.
(w32_wnd_proc): Reinstall debugging output.
(w32_wnd_proc): Reinstall SetForegroundWindow change.
(syms_of_w32fns): Reinstall new initializer for
Vw32_phantom_key_code.
(x_to_w32_charset): Do partial matching of charset
names for most non-European charsets, to cope with wildcards or
missing spec dates.
(Fw32_send_sys_command): Post WM_SYSCOMMAND rather than sending it
to avoid deadlock when activating the menu bar.
| -rw-r--r-- | src/w32fns.c | 61 |
1 files changed, 50 insertions, 11 deletions
diff --git a/src/w32fns.c b/src/w32fns.c index c2e1fd318ee..b54e56e3c56 100644 --- a/src/w32fns.c +++ b/src/w32fns.c | |||
| @@ -3706,6 +3706,12 @@ w32_wnd_proc (hwnd, msg, wParam, lParam) | |||
| 3706 | { | 3706 | { |
| 3707 | GetUpdateRect (hwnd, &wmsg.rect, FALSE); | 3707 | GetUpdateRect (hwnd, &wmsg.rect, FALSE); |
| 3708 | w32_clear_rect (f, NULL, &wmsg.rect); | 3708 | w32_clear_rect (f, NULL, &wmsg.rect); |
| 3709 | |||
| 3710 | #if defined (W32_DEBUG_DISPLAY) | ||
| 3711 | DebPrint (("WM_ERASEBKGND: erasing %d,%d-%d,%d\n", | ||
| 3712 | wmsg.rect.left, wmsg.rect.top, wmsg.rect.right, | ||
| 3713 | wmsg.rect.bottom)); | ||
| 3714 | #endif /* W32_DEBUG_DISPLAY */ | ||
| 3709 | } | 3715 | } |
| 3710 | return 1; | 3716 | return 1; |
| 3711 | case WM_PALETTECHANGED: | 3717 | case WM_PALETTECHANGED: |
| @@ -3720,7 +3726,7 @@ w32_wnd_proc (hwnd, msg, wParam, lParam) | |||
| 3720 | } | 3726 | } |
| 3721 | return 0; | 3727 | return 0; |
| 3722 | case WM_PAINT: | 3728 | case WM_PAINT: |
| 3723 | { | 3729 | { |
| 3724 | PAINTSTRUCT paintStruct; | 3730 | PAINTSTRUCT paintStruct; |
| 3725 | RECT update_rect; | 3731 | RECT update_rect; |
| 3726 | 3732 | ||
| @@ -4477,7 +4483,30 @@ w32_wnd_proc (hwnd, msg, wParam, lParam) | |||
| 4477 | return ShowWindow ((HWND) wParam, (WPARAM) lParam); | 4483 | return ShowWindow ((HWND) wParam, (WPARAM) lParam); |
| 4478 | 4484 | ||
| 4479 | case WM_EMACS_SETFOREGROUND: | 4485 | case WM_EMACS_SETFOREGROUND: |
| 4480 | return SetForegroundWindow ((HWND) wParam); | 4486 | { |
| 4487 | HWND foreground_window; | ||
| 4488 | DWORD foreground_thread, retval; | ||
| 4489 | |||
| 4490 | /* On NT 5.0, and apparently Windows 98, it is necessary to | ||
| 4491 | attach to the thread that currently has focus in order to | ||
| 4492 | pull the focus away from it. */ | ||
| 4493 | foreground_window = GetForegroundWindow (); | ||
| 4494 | foreground_thread = GetWindowThreadProcessId (foreground_window, NULL); | ||
| 4495 | if (!foreground_window | ||
| 4496 | || foreground_thread == GetCurrentThreadId () | ||
| 4497 | || !AttachThreadInput (GetCurrentThreadId (), | ||
| 4498 | foreground_thread, TRUE)) | ||
| 4499 | foreground_thread = 0; | ||
| 4500 | |||
| 4501 | retval = SetForegroundWindow ((HWND) wParam); | ||
| 4502 | |||
| 4503 | /* Detach from the previous foreground thread. */ | ||
| 4504 | if (foreground_thread) | ||
| 4505 | AttachThreadInput (GetCurrentThreadId (), | ||
| 4506 | foreground_thread, FALSE); | ||
| 4507 | |||
| 4508 | return retval; | ||
| 4509 | } | ||
| 4481 | 4510 | ||
| 4482 | case WM_EMACS_SETWINDOWPOS: | 4511 | case WM_EMACS_SETWINDOWPOS: |
| 4483 | { | 4512 | { |
| @@ -5345,9 +5374,11 @@ x_to_w32_charset (lpcs) | |||
| 5345 | else if (stricmp (lpcs, "ms-symbol") == 0) return SYMBOL_CHARSET; | 5374 | else if (stricmp (lpcs, "ms-symbol") == 0) return SYMBOL_CHARSET; |
| 5346 | /* Map all Japanese charsets to the Windows Shift-JIS charset. */ | 5375 | /* Map all Japanese charsets to the Windows Shift-JIS charset. */ |
| 5347 | else if (strnicmp (lpcs, "jis", 3) == 0) return SHIFTJIS_CHARSET; | 5376 | else if (strnicmp (lpcs, "jis", 3) == 0) return SHIFTJIS_CHARSET; |
| 5377 | /* Map all GB charsets to the Windows GB2312 charset. */ | ||
| 5378 | else if (strnicmp (lpcs, "gb2312", 6) == 0) return GB2312_CHARSET; | ||
| 5379 | /* Map all Big5 charsets to the Windows Big5 charset. */ | ||
| 5380 | else if (strnicmp (lpcs, "big5", 4) == 0) return CHINESEBIG5_CHARSET; | ||
| 5348 | else if (stricmp (lpcs, "ksc5601.1987") == 0) return HANGEUL_CHARSET; | 5381 | else if (stricmp (lpcs, "ksc5601.1987") == 0) return HANGEUL_CHARSET; |
| 5349 | else if (stricmp (lpcs, "gb2312") == 0) return GB2312_CHARSET; | ||
| 5350 | else if (stricmp (lpcs, "big5") == 0) return CHINESEBIG5_CHARSET; | ||
| 5351 | else if (stricmp (lpcs, "ms-oem") == 0) return OEM_CHARSET; | 5382 | else if (stricmp (lpcs, "ms-oem") == 0) return OEM_CHARSET; |
| 5352 | 5383 | ||
| 5353 | #ifdef EASTEUROPE_CHARSET | 5384 | #ifdef EASTEUROPE_CHARSET |
| @@ -5360,13 +5391,19 @@ x_to_w32_charset (lpcs) | |||
| 5360 | else if (stricmp (lpcs, "iso8859-7") == 0) return GREEK_CHARSET; | 5391 | else if (stricmp (lpcs, "iso8859-7") == 0) return GREEK_CHARSET; |
| 5361 | else if (stricmp (lpcs, "iso8859-8") == 0) return HEBREW_CHARSET; | 5392 | else if (stricmp (lpcs, "iso8859-8") == 0) return HEBREW_CHARSET; |
| 5362 | else if (stricmp (lpcs, "iso8859-9") == 0) return TURKISH_CHARSET; | 5393 | else if (stricmp (lpcs, "iso8859-9") == 0) return TURKISH_CHARSET; |
| 5363 | else if (stricmp (lpcs, "viscii") == 0) return VIETNAMESE_CHARSET; | 5394 | #ifndef VIETNAMESE_CHARSET |
| 5364 | else if (stricmp (lpcs, "vscii") == 0) return VIETNAMESE_CHARSET; | 5395 | #define VIETNAMESE_CHARSET 163 |
| 5365 | else if (stricmp (lpcs, "tis620") == 0) return THAI_CHARSET; | 5396 | #endif |
| 5397 | /* Map all Viscii charsets to the Windows Vietnamese charset. */ | ||
| 5398 | else if (strnicmp (lpcs, "viscii", 6) == 0) return VIETNAMESE_CHARSET; | ||
| 5399 | else if (strnicmp (lpcs, "vscii", 5) == 0) return VIETNAMESE_CHARSET; | ||
| 5400 | /* Map all TIS charsets to the Windows Thai charset. */ | ||
| 5401 | else if (strnicmp (lpcs, "tis620", 6) == 0) return THAI_CHARSET; | ||
| 5366 | else if (stricmp (lpcs, "mac") == 0) return MAC_CHARSET; | 5402 | else if (stricmp (lpcs, "mac") == 0) return MAC_CHARSET; |
| 5367 | else if (stricmp (lpcs, "ksc5601.1992") == 0) return JOHAB_CHARSET; | 5403 | else if (stricmp (lpcs, "ksc5601.1992") == 0) return JOHAB_CHARSET; |
| 5368 | /* For backwards compatibility with previous 20.4 pretests. */ | 5404 | /* For backwards compatibility with previous 20.4 pretests, map |
| 5369 | else if (stricmp (lpcs, "ksc5601") == 0) return HANGEUL_CHARSET; | 5405 | non-specific KSC charsets to the Windows Hangeul charset. */ |
| 5406 | else if (strnicmp (lpcs, "ksc5601", 7) == 0) return HANGEUL_CHARSET; | ||
| 5370 | else if (stricmp (lpcs, "johab") == 0) return JOHAB_CHARSET; | 5407 | else if (stricmp (lpcs, "johab") == 0) return JOHAB_CHARSET; |
| 5371 | #endif | 5408 | #endif |
| 5372 | 5409 | ||
| @@ -6997,7 +7034,7 @@ If optional parameter FRAME is not specified, use selected frame.") | |||
| 6997 | 7034 | ||
| 6998 | CHECK_NUMBER (command, 0); | 7035 | CHECK_NUMBER (command, 0); |
| 6999 | 7036 | ||
| 7000 | SendMessage (FRAME_W32_WINDOW (f), WM_SYSCOMMAND, XINT (command), 0); | 7037 | PostMessage (FRAME_W32_WINDOW (f), WM_SYSCOMMAND, XINT (command), 0); |
| 7001 | 7038 | ||
| 7002 | return Qnil; | 7039 | return Qnil; |
| 7003 | } | 7040 | } |
| @@ -7401,7 +7438,9 @@ Value is a number between 0 and 255.\n\ | |||
| 7401 | Phantom key presses are generated in order to stop the system from\n\ | 7438 | Phantom key presses are generated in order to stop the system from\n\ |
| 7402 | acting on \"Windows\" key events when `w32-pass-lwindow-to-system' or\n\ | 7439 | acting on \"Windows\" key events when `w32-pass-lwindow-to-system' or\n\ |
| 7403 | `w32-pass-rwindow-to-system' is nil."); | 7440 | `w32-pass-rwindow-to-system' is nil."); |
| 7404 | Vw32_phantom_key_code = VK_SPACE; | 7441 | /* Although 255 is technically not a valid key code, it works and |
| 7442 | means that this hack won't interfere with any real key code. */ | ||
| 7443 | Vw32_phantom_key_code = 255; | ||
| 7405 | 7444 | ||
| 7406 | DEFVAR_LISP ("w32-enable-num-lock", | 7445 | DEFVAR_LISP ("w32-enable-num-lock", |
| 7407 | &Vw32_enable_num_lock, | 7446 | &Vw32_enable_num_lock, |