From: Eli Zaretskii Date: Fri, 10 Aug 2012 07:16:58 +0000 (+0300) Subject: Improve commit in 2012-08-10T06:54:37Z!eliz@gnu.org. X-Git-Tag: emacs-24.2.90~744 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9b855fd632dcbb86576a4a97f5f4196f0c75c102;p=emacs.git Improve commit in 2012-08-10T06:54:37Z!eliz@gnu.org. src/w32fns.c : 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. --- diff --git a/src/ChangeLog b/src/ChangeLog index 5b0ff7055ba..b8b8ee7b3f4 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2012-08-10 Eli Zaretskii + + * w32fns.c : 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. + 2012-08-10 Joakim HÃ¥rsman (tiny change) Eli Zaretskii 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; static HWND w32_visible_system_caret_hwnd; +static int w32_unicode_gui; + /* From w32menu.c */ extern HMENU current_popup_menu; static int menubar_in_use = 0; @@ -1795,7 +1797,7 @@ static BOOL w32_init_class (HINSTANCE hinst) { - if (os_subtype == OS_NT) + if (w32_unicode_gui) { WNDCLASSW uwc; INIT_WINDOW_CLASS(uwc); @@ -2260,7 +2262,7 @@ w32_msg_pump (deferred_msg * msg_buf) msh_mousewheel = RegisterWindowMessage (MSH_MOUSEWHEEL); - while ((os_subtype == OS_NT ? GetMessageW : GetMessageA) (&msg, NULL, 0, 0)) + while ((w32_unicode_gui ? GetMessageW : GetMessageA) (&msg, NULL, 0, 0)) { if (msg.hwnd == NULL) { @@ -2355,7 +2357,7 @@ w32_msg_pump (deferred_msg * msg_buf) } else { - if (os_subtype == OS_NT) + if (w32_unicode_gui) DispatchMessageW (&msg); else DispatchMessageA (&msg); @@ -3828,7 +3830,7 @@ w32_wnd_proc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) } dflt: - return (os_subtype == OS_NT ? DefWindowProcW : DefWindowProcA) (hwnd, msg, wParam, lParam); + return (w32_unicode_gui ? DefWindowProcW : DefWindowProcA) (hwnd, msg, wParam, lParam); } /* The most common default return code for handled messages is 0. */ @@ -7181,6 +7183,11 @@ globals_of_w32fns (void) doc: /* The ANSI code page used by the system. */); w32_ansi_code_page = GetACP (); + if (os_subtype == OS_NT) + w32_unicode_gui = 1; + else + w32_unicode_gui = 0; + /* MessageBox does not work without this when linked to comctl32.dll 6.0. */ InitCommonControls ();