Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 136752 Details for
Bug 200065
[patch] www-clients/mozilla-firefox-2.0.0.9 - Accelerators should not be affected by keyboard group/levelpatch
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
The patch against 2.0.0.9 source tree
mozilla-firefox-2.0.0.9-accel.diff (text/plain), 4.64 KB, created by
tonich
on 2007-11-23 10:38:16 UTC
(
hide
)
Description:
The patch against 2.0.0.9 source tree
Filename:
MIME Type:
Creator:
tonich
Created:
2007-11-23 10:38:16 UTC
Size:
4.64 KB
patch
obsolete
>--- mozilla/widget/src/gtk2/nsWindow.cpp.orig 2007-04-19 22:46:03.000000000 +0400 >+++ mozilla/widget/src/gtk2/nsWindow.cpp 2007-11-23 11:35:57.000000000 +0300 >@@ -1809,6 +1809,14 @@ > LOGFOCUS(("Done with container focus out [%p]\n", (void *)this)); > } > >+inline PRBool >+is_latin_shortcut_key(guint aKeyval) >+{ >+ return ((GDK_0 <= aKeyval && aKeyval <= GDK_9) || >+ (GDK_A <= aKeyval && aKeyval <= GDK_Z) || >+ (GDK_a <= aKeyval && aKeyval <= GDK_z)); >+} >+ > gboolean > nsWindow::OnKeyPressEvent(GtkWidget *aWidget, GdkEventKey *aEvent) > { >@@ -1883,6 +1891,62 @@ > // clear isShift so the character can be inserted in the editor > > if (event.isControl || event.isAlt || event.isMeta) { >+ GdkEventKey tmpEvent = *aEvent; >+ >+ // Fix for bug 69230: >+ // if modifier key is pressed and key pressed is not latin character, >+ // we should try other keyboard layouts to find out correct latin >+ // character corresponding to pressed key; >+ // that way shortcuts like Ctrl+C will work no matter what >+ // keyboard layout is selected >+ // We don't try to fix up punctuation accelerators here, >+ // because their location differs between latin layouts >+ if (!is_latin_shortcut_key(event.charCode)) { >+ // We have a non-latin char, try other keyboard groups >+ GdkKeymapKey *keys; >+ guint *keyvals; >+ gint n_entries; >+ PRUint32 latinCharCode; >+ gint level; >+ >+ if (gdk_keymap_translate_keyboard_state(NULL, >+ tmpEvent.hardware_keycode, >+ (GdkModifierType)tmpEvent.state, >+ tmpEvent.group, >+ NULL, NULL, &level, NULL) >+ && gdk_keymap_get_entries_for_keycode(NULL, >+ tmpEvent.hardware_keycode, >+ &keys, &keyvals, >+ &n_entries)) { >+ gint n; >+ for (n=0; n<n_entries; n++) { >+ if (keys[n].group == tmpEvent.group) { >+ // Skip keys from the same group >+ continue; >+ } >+ if (keys[n].level != level) { >+ // Allow only same level keys >+ continue; >+ } >+ if (is_latin_shortcut_key(keyvals[n])) { >+ // Latin character found >+ if (event.isShift) >+ tmpEvent.keyval = gdk_keyval_to_upper(keyvals[n]); >+ else >+ tmpEvent.keyval = gdk_keyval_to_lower(keyvals[n]); >+ tmpEvent.group = keys[n].group; >+ latinCharCode = nsConvertCharCodeToUnicode(&tmpEvent); >+ if (latinCharCode) { >+ event.charCode = latinCharCode; >+ break; >+ } >+ } >+ } >+ g_free(keys); >+ g_free(keyvals); >+ } >+ } >+ > // make Ctrl+uppercase functional as same as Ctrl+lowercase > // when Ctrl+uppercase(eg.Ctrl+C) is pressed,convert the charCode > // from uppercase to lowercase(eg.Ctrl+c),so do Alt and Meta Key >@@ -1900,14 +1964,11 @@ > // bugs 50255 and 351310) > if (!event.isControl && event.isShift && > (event.charCode < GDK_0 || event.charCode > GDK_9)) { >- GdkKeymapKey k = { aEvent->hardware_keycode, aEvent->group, 0 }; >- guint savedKeyval = aEvent->keyval; >- aEvent->keyval = gdk_keymap_lookup_key(gdk_keymap_get_default(), &k); >- PRUint32 unshiftedCharCode = nsConvertCharCodeToUnicode(aEvent); >+ GdkKeymapKey k = { tmpEvent.hardware_keycode, tmpEvent.group, 0 }; >+ tmpEvent.keyval = gdk_keymap_lookup_key(gdk_keymap_get_default(), &k); >+ PRUint32 unshiftedCharCode = nsConvertCharCodeToUnicode(&tmpEvent); > if (unshiftedCharCode) > event.charCode = unshiftedCharCode; >- else >- aEvent->keyval = savedKeyval; > } > } > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 200065
: 136752