Commit 9b855fd6 authored by Eli Zaretskii's avatar Eli Zaretskii
Browse files

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.
parent 0aa8781f
2012-08-10 Eli Zaretskii <eliz@gnu.org>
* 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.
2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change) 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
Eli Zaretskii <eliz@gnu.org> Eli Zaretskii <eliz@gnu.org>
   
......
...@@ -189,6 +189,8 @@ static int image_cache_refcount, dpyinfo_refcount; ...@@ -189,6 +189,8 @@ static int image_cache_refcount, dpyinfo_refcount;
static HWND w32_visible_system_caret_hwnd; static HWND w32_visible_system_caret_hwnd;
static int w32_unicode_gui;
/* From w32menu.c */ /* From w32menu.c */
extern HMENU current_popup_menu; extern HMENU current_popup_menu;
static int menubar_in_use = 0; static int menubar_in_use = 0;
...@@ -1795,7 +1797,7 @@ static BOOL ...@@ -1795,7 +1797,7 @@ static BOOL
w32_init_class (HINSTANCE hinst) w32_init_class (HINSTANCE hinst)
{ {
if (os_subtype == OS_NT) if (w32_unicode_gui)
{ {
WNDCLASSW uwc; WNDCLASSW uwc;
INIT_WINDOW_CLASS(uwc); INIT_WINDOW_CLASS(uwc);
...@@ -2260,7 +2262,7 @@ w32_msg_pump (deferred_msg * msg_buf) ...@@ -2260,7 +2262,7 @@ w32_msg_pump (deferred_msg * msg_buf)
msh_mousewheel = RegisterWindowMessage (MSH_MOUSEWHEEL); 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) if (msg.hwnd == NULL)
{ {
...@@ -2355,7 +2357,7 @@ w32_msg_pump (deferred_msg * msg_buf) ...@@ -2355,7 +2357,7 @@ w32_msg_pump (deferred_msg * msg_buf)
} }
else else
{ {
if (os_subtype == OS_NT) if (w32_unicode_gui)
DispatchMessageW (&msg); DispatchMessageW (&msg);
else else
DispatchMessageA (&msg); DispatchMessageA (&msg);
...@@ -3828,7 +3830,7 @@ w32_wnd_proc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) ...@@ -3828,7 +3830,7 @@ w32_wnd_proc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
} }
dflt: 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. */ /* The most common default return code for handled messages is 0. */
...@@ -7181,6 +7183,11 @@ globals_of_w32fns (void) ...@@ -7181,6 +7183,11 @@ globals_of_w32fns (void)
doc: /* The ANSI code page used by the system. */); doc: /* The ANSI code page used by the system. */);
w32_ansi_code_page = GetACP (); 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. */ /* MessageBox does not work without this when linked to comctl32.dll 6.0. */
InitCommonControls (); InitCommonControls ();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment