bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#10299: Emacs doesn't handle Unicode characters in keyboard layout on


From: Stefan Monnier
Subject: bug#10299: Emacs doesn't handle Unicode characters in keyboard layout on MS Windows
Date: Mon, 16 Jan 2012 09:03:17 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux)

Note: I know very little about w32.

> -      SetWindowText (FRAME_W32_WINDOW (f), SDATA (name));
> +      if (os_subtype == OS_NT)
> +        SetWindowTextW (FRAME_W32_WINDOW (f), SDATA (name));
> +      else
> +        SetWindowText (FRAME_W32_WINDOW (f), SDATA (name));

Can we move the test elsewhere by defining (or #defining) our own
SetWindowText which uses either of the two?

> @@ -1785,20 +1791,39 @@
>  static BOOL
>  w32_init_class (HINSTANCE hinst)
>  {
> -  WNDCLASS wc;
> -
> -  wc.style = CS_HREDRAW | CS_VREDRAW;
> -  wc.lpfnWndProc = (WNDPROC) w32_wnd_proc;
> -  wc.cbClsExtra = 0;
> -  wc.cbWndExtra = WND_EXTRA_BYTES;
> -  wc.hInstance = hinst;
> -  wc.hIcon = LoadIcon (hinst, EMACS_CLASS);
> -  wc.hCursor = w32_load_cursor (IDC_ARROW);
> -  wc.hbrBackground = NULL; /* GetStockObject (WHITE_BRUSH);  */
> -  wc.lpszMenuName = NULL;
> -  wc.lpszClassName = EMACS_CLASS;
> -
> -  return (RegisterClass (&wc));
> +  WNDCLASSW uwc;
> +  WNDCLASS  wc;
> +
> +  if (os_subtype == OS_NT)
> +    {
> +      uwc.style = CS_HREDRAW | CS_VREDRAW;
> +      uwc.lpfnWndProc = (WNDPROC) w32_wnd_proc;
> +      uwc.cbClsExtra = 0;
> +      uwc.cbWndExtra = WND_EXTRA_BYTES;
> +      uwc.hInstance = hinst;
> +      uwc.hIcon = LoadIcon (hinst, EMACS_CLASS);
> +      uwc.hCursor = w32_load_cursor (IDC_ARROW);
> +      uwc.hbrBackground = NULL; /* GetStockObject (WHITE_BRUSH);  */
> +      uwc.lpszMenuName = NULL;
> +      uwc.lpszClassName = L"Emacs";
> +
> +      return (RegisterClassW (&uwc));
> +    }
> +  else
> +    {
> +      wc.style = CS_HREDRAW | CS_VREDRAW;
> +      wc.lpfnWndProc = (WNDPROC) w32_wnd_proc;
> +      wc.cbClsExtra = 0;
> +      wc.cbWndExtra = WND_EXTRA_BYTES;
> +      wc.hInstance = hinst;
> +      wc.hIcon = LoadIcon (hinst, EMACS_CLASS);
> +      wc.hCursor = w32_load_cursor (IDC_ARROW);
> +      wc.hbrBackground = NULL; /* GetStockObject (WHITE_BRUSH);  */
> +      wc.lpszMenuName = NULL;
> +      wc.lpszClassName = EMACS_CLASS;
> +
> +      return (RegisterClass (&wc));
> +    }
>  }

The two var declarations (WNDCLASSW uwc and WNDCLASS wc) should be moved
within their respective branch.  And it'd be better if we could share
some code between the two branches, e.g. using a macro.


        Stefan





reply via email to

[Prev in Thread] Current Thread [Next in Thread]