Chromium Code Reviews| Index: chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc |
| diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc b/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc |
| index f303bf74cba89342d785feececf716403a2c3bf2..6ead27e9dfb7a74f1ffd4572c0c048fdd979ef09 100644 |
| --- a/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc |
| +++ b/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc |
| @@ -659,11 +659,17 @@ gboolean AutocompleteEditViewGtk::HandleKeyPress(GtkWidget* widget, |
| gboolean AutocompleteEditViewGtk::HandleKeyRelease(GtkWidget* widget, |
| GdkEventKey* event) { |
| + // Omnibox2 can switch its contents while pressing a control key. To switch |
| + // the contents of omnibox2, we notify the AutocompleteEditModel class when |
| + // the control-key state is changed. |
| if (event->keyval == GDK_Control_L || event->keyval == GDK_Control_R) { |
| - // Omnibox2 can switch its contents while pressing a control key. To switch |
| - // the contents of omnibox2, we notify the AutocompleteEditModel class when |
| - // the control-key state is changed. |
| - model_->OnControlKeyChanged(false); |
| + // Round trip to query the control state after the release. This allows |
|
Evan Martin
2009/08/25 01:03:50
Maybe mention that |event| still thinks control is
|
| + // you to release one control key while still holding another control key. |
| + GdkDisplay* display = gdk_drawable_get_display(event->window); |
| + GdkModifierType mod; |
| + gdk_display_get_pointer(display, NULL, NULL, NULL, &mod); |
| + if (!(mod & GDK_CONTROL_MASK)) |
| + model_->OnControlKeyChanged(false); |
| } |
| // Even though we handled the press ourselves, let GtkTextView handle the |