diff options
| author | Eli Zaretskii | 2012-08-10 10:16:58 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2012-08-10 10:16:58 +0300 |
| commit | 9b855fd632dcbb86576a4a97f5f4196f0c75c102 (patch) | |
| tree | 1c71632d06da43c872ac535459cb54034ca07ff6 /src | |
| parent | 0aa8781fc089f32f11bf28a6f0130678618d82ac (diff) | |
| download | emacs-9b855fd632dcbb86576a4a97f5f4196f0c75c102.tar.gz emacs-9b855fd632dcbb86576a4a97f5f4196f0c75c102.zip | |
Improve commit in 2012-08-10T06:54:37Z!eliz@gnu.org.
src/w32fns.c <w32_unicode_gui>: New static variable.
(globals_of_w32fns): Initialize it according to os_subtype.
(w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
testing os_subtype.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 7 | ||||
| -rw-r--r-- | src/w32fns.c | 15 |
2 files changed, 18 insertions, 4 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 5b0ff7055ba..b8b8ee7b3f4 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2012-08-10 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * w32fns.c <w32_unicode_gui>: New static variable. | ||
| 4 | (globals_of_w32fns): Initialize it according to os_subtype. | ||
| 5 | (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of | ||
| 6 | testing os_subtype. | ||
| 7 | |||
| 1 | 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change) | 8 | 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change) |
| 2 | Eli Zaretskii <eliz@gnu.org> | 9 | Eli Zaretskii <eliz@gnu.org> |
| 3 | 10 | ||
diff --git a/src/w32fns.c b/src/w32fns.c index 62b4272f236..53dcb4bac96 100644 --- a/src/w32fns.c +++ b/src/w32fns.c | |||
| @@ -189,6 +189,8 @@ static int image_cache_refcount, dpyinfo_refcount; | |||
| 189 | 189 | ||
| 190 | static HWND w32_visible_system_caret_hwnd; | 190 | static HWND w32_visible_system_caret_hwnd; |
| 191 | 191 | ||
| 192 | static int w32_unicode_gui; | ||
| 193 | |||
| 192 | /* From w32menu.c */ | 194 | /* From w32menu.c */ |
| 193 | extern HMENU current_popup_menu; | 195 | extern HMENU current_popup_menu; |
| 194 | static int menubar_in_use = 0; | 196 | static int menubar_in_use = 0; |
| @@ -1795,7 +1797,7 @@ static BOOL | |||
| 1795 | w32_init_class (HINSTANCE hinst) | 1797 | w32_init_class (HINSTANCE hinst) |
| 1796 | { | 1798 | { |
| 1797 | 1799 | ||
| 1798 | if (os_subtype == OS_NT) | 1800 | if (w32_unicode_gui) |
| 1799 | { | 1801 | { |
| 1800 | WNDCLASSW uwc; | 1802 | WNDCLASSW uwc; |
| 1801 | INIT_WINDOW_CLASS(uwc); | 1803 | INIT_WINDOW_CLASS(uwc); |
| @@ -2260,7 +2262,7 @@ w32_msg_pump (deferred_msg * msg_buf) | |||
| 2260 | 2262 | ||
| 2261 | msh_mousewheel = RegisterWindowMessage (MSH_MOUSEWHEEL); | 2263 | msh_mousewheel = RegisterWindowMessage (MSH_MOUSEWHEEL); |
| 2262 | 2264 | ||
| 2263 | while ((os_subtype == OS_NT ? GetMessageW : GetMessageA) (&msg, NULL, 0, 0)) | 2265 | while ((w32_unicode_gui ? GetMessageW : GetMessageA) (&msg, NULL, 0, 0)) |
| 2264 | { | 2266 | { |
| 2265 | if (msg.hwnd == NULL) | 2267 | if (msg.hwnd == NULL) |
| 2266 | { | 2268 | { |
| @@ -2355,7 +2357,7 @@ w32_msg_pump (deferred_msg * msg_buf) | |||
| 2355 | } | 2357 | } |
| 2356 | else | 2358 | else |
| 2357 | { | 2359 | { |
| 2358 | if (os_subtype == OS_NT) | 2360 | if (w32_unicode_gui) |
| 2359 | DispatchMessageW (&msg); | 2361 | DispatchMessageW (&msg); |
| 2360 | else | 2362 | else |
| 2361 | DispatchMessageA (&msg); | 2363 | DispatchMessageA (&msg); |
| @@ -3828,7 +3830,7 @@ w32_wnd_proc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) | |||
| 3828 | } | 3830 | } |
| 3829 | 3831 | ||
| 3830 | dflt: | 3832 | dflt: |
| 3831 | return (os_subtype == OS_NT ? DefWindowProcW : DefWindowProcA) (hwnd, msg, wParam, lParam); | 3833 | return (w32_unicode_gui ? DefWindowProcW : DefWindowProcA) (hwnd, msg, wParam, lParam); |
| 3832 | } | 3834 | } |
| 3833 | 3835 | ||
| 3834 | /* The most common default return code for handled messages is 0. */ | 3836 | /* The most common default return code for handled messages is 0. */ |
| @@ -7181,6 +7183,11 @@ globals_of_w32fns (void) | |||
| 7181 | doc: /* The ANSI code page used by the system. */); | 7183 | doc: /* The ANSI code page used by the system. */); |
| 7182 | w32_ansi_code_page = GetACP (); | 7184 | w32_ansi_code_page = GetACP (); |
| 7183 | 7185 | ||
| 7186 | if (os_subtype == OS_NT) | ||
| 7187 | w32_unicode_gui = 1; | ||
| 7188 | else | ||
| 7189 | w32_unicode_gui = 0; | ||
| 7190 | |||
| 7184 | /* MessageBox does not work without this when linked to comctl32.dll 6.0. */ | 7191 | /* MessageBox does not work without this when linked to comctl32.dll 6.0. */ |
| 7185 | InitCommonControls (); | 7192 | InitCommonControls (); |
| 7186 | 7193 | ||