2009/6/25 Manoj Srivastava <sriva...@golden-gryphon.com>:
> Hi,
>
>        This was reported by a Debian user. Please retain the CC to
>        464366-forwar...@bugs.debian.org in your response, in order that
>        the Debian BTS has a record.
>
>
> While browsing in the menu, one can use shortcuts (indicated by
> underlined letters) to quickly access items. However, that doesn't work
> for accented letters. For instance in the french locale, &Écran can not
> be accessed through either É, é, E, or e (be it a latin1 or UTF-8
> locale).

The problem is that when checking for a key press for a menu, we
translate the keysym returned as ascii when checking for its validity.
 Accented characters are of course outside of ASCII so no wonder it
wasn't working.  Please test the patch attached -- it's been tested
against FVWM CVS and with my complete limited knowledge of typing
accented chars, seems to work -- and at a pinch, this patch should
apply against the Debian FVWM sources if you're so inclined, but I'd
rather you tried the CVS version.

I used the following to test this:

AddToMenu ppp "Hiß there&ß" Echo hello
AddToMenu ppp "He&llo" Echo hello
AddToMenu ppp "&Écrire" Nop
AddToMenu ppp "Hi&ß there" Echo hello
AddToMenu ppp "He&llo" Echo hello

Pressing "Alt-gr s" toggled between both entries for "Hiß there&ß" --
but being English and not a speaker (or typist) of languages using
accented chars, this is very much a stab in the dark.

Some feedback on this would be appreciated, please.

-- Thomas Adam
Index: fvwm/menubindings.c
===================================================================
RCS file: /home/cvs/fvwm/fvwm/fvwm/menubindings.c,v
retrieving revision 1.13
diff -u -r1.13 menubindings.c
--- fvwm/menubindings.c	23 Nov 2007 10:12:54 -0000	1.13
+++ fvwm/menubindings.c	28 Jun 2009 17:01:19 -0000
@@ -660,7 +660,11 @@
 	/*** Try to match hot keys ***/
 
 	/* Need isascii here - isgraph might coredump! */
-	if (index == 1 && isascii(ikeychar) && isgraph(ikeychar) &&
+	/* TA:  (2009/06/28):  But using isascii() stops accented chars!  In
+	 * either case, this coredump was most likely undefined behaviour seen
+	 * locally at one point.
+	 */
+	if (index == 1 && isgraph(ikeychar) &&
 	    with_control == 0 && with_meta == 0)
 	{
 		/* allow any printable character to be a keysym, but be sure
@@ -692,7 +696,17 @@
 				key = (MI_LABEL(mi)[(int)MI_HOTKEY_COLUMN(mi)])
 					[MI_HOTKEY_COFFSET(mi)];
 				key = tolower(key);
-				if (ikeychar == key)
+
+				/* TA:  But when comparing hotkeys, ensure we
+				 * make the comparison based on the actual
+				 * character, and not the keysyms -- applies
+				 * to the case of non-ascii chars.
+				 */
+				/* TA:  (2009/06/28):  FIXME -- we really
+				 * -have- to find a better way of dealing with
+				 *  different character sets.
+				 */
+				if ((char)ikeychar == (char)key)
 				{
 					if (++countHotkey == 1)
 					{

Reply via email to