Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(63)

Unified Diff: chrome/browser/ui/gtk/bubble/bubble_gtk.cc

Issue 8015002: Browser crash when pressing Ctrl+D Ctrl+W (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/gtk/bubble/bubble_gtk.cc
===================================================================
--- chrome/browser/ui/gtk/bubble/bubble_gtk.cc (revision 102679)
+++ chrome/browser/ui/gtk/bubble/bubble_gtk.cc (working copy)
@@ -409,6 +409,36 @@
case GDK_w:
// Close on C-w and forward the accelerator
if (modifier & GDK_CONTROL_MASK) {
+ gdk_keymap_get_entries_for_keyval(NULL,
+ keyval,
+ &keys,
+ &n_keys);
+ if (n_keys) {
+ // Forward the accelerator to root window the bubble is anchored
+ // to for further processing
+ msg.type = GDK_KEY_PRESS;
+ msg.window = GTK_WIDGET(toplevel_window_)->window;
+ msg.send_event = TRUE;
+ msg.time = GDK_CURRENT_TIME;
+ msg.state = modifier | GDK_MOD2_MASK;
+ msg.keyval = keyval;
+ // length and string are deprecated and thus zeroed out
+ msg.length = 0;
+ msg.string = NULL;
+ msg.hardware_keycode = keys[0].keycode;
+ msg.group = keys[0].group;
+ msg.is_modifier = 0;
+
+ g_free(keys);
+
+ gtk_main_do_event(reinterpret_cast<GdkEvent*>(&msg));
+ } else {
+ // This means that there isn't a h/w code for the keyval in the
+ // current keymap, which is weird but possible if the keymap just
+ // changed. This isn't a critical error, but might be indicative
+ // of something off if it happens regularly.
+ DLOG(WARNING) << "Found no keys for value " << keyval;
+ }
Close();
}
break;
@@ -416,36 +446,6 @@
return FALSE;
}
- gdk_keymap_get_entries_for_keyval(NULL,
- keyval,
- &keys,
- &n_keys);
- if (n_keys) {
- // Forward the accelerator to root window the bubble is anchored
- // to for further processing
- msg.type = GDK_KEY_PRESS;
- msg.window = GTK_WIDGET(toplevel_window_)->window;
- msg.send_event = TRUE;
- msg.time = GDK_CURRENT_TIME;
- msg.state = modifier | GDK_MOD2_MASK;
- msg.keyval = keyval;
- // length and string are deprecated and thus zeroed out
- msg.length = 0;
- msg.string = NULL;
- msg.hardware_keycode = keys[0].keycode;
- msg.group = keys[0].group;
- msg.is_modifier = 0;
-
- g_free(keys);
-
- gtk_main_do_event(reinterpret_cast<GdkEvent*>(&msg));
- } else {
- // This means that there isn't a h/w code for the keyval in the
- // current keymap, which is weird but possible if the keymap just
- // changed. This isn't a critical error, but might be indicative
- // of something off if it happens regularly.
- DLOG(WARNING) << "Found no keys for value " << keyval;
- }
return TRUE;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698