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

Unified Diff: chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc

Issue 173324: Fix double control key issue with the omnibox. (Closed)
Patch Set: Created 11 years, 4 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/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
« 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