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

Side by Side Diff: chrome/browser/renderer_host/render_widget_host_view_gtk.cc

Issue 431031: GTK: Don't send double/triple click events to renderer.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/renderer_host/render_widget_host_view_gtk.h" 5 #include "chrome/browser/renderer_host/render_widget_host_view_gtk.h"
6 6
7 // If this gets included after the gtk headers, then a bunch of compiler 7 // If this gets included after the gtk headers, then a bunch of compiler
8 // errors happen because of a "#define Status int" in Xlib.h, which interacts 8 // errors happen because of a "#define Status int" in Xlib.h, which interacts
9 // badly with URLRequestStatus::Status. 9 // badly with URLRequestStatus::Status.
10 #include "chrome/common/render_messages.h" 10 #include "chrome/common/render_messages.h"
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 if (host_view->was_focused_before_grab_) 190 if (host_view->was_focused_before_grab_)
191 OnFocusOut(widget, NULL, host_view); 191 OnFocusOut(widget, NULL, host_view);
192 } 192 }
193 } 193 }
194 194
195 static gboolean ButtonPressReleaseEvent( 195 static gboolean ButtonPressReleaseEvent(
196 GtkWidget* widget, GdkEventButton* event, 196 GtkWidget* widget, GdkEventButton* event,
197 RenderWidgetHostViewGtk* host_view) { 197 RenderWidgetHostViewGtk* host_view) {
198 if (!(event->button == 1 || event->button == 2 || event->button == 3)) 198 if (!(event->button == 1 || event->button == 2 || event->button == 3))
199 return FALSE; // We do not forward any other buttons to the renderer. 199 return FALSE; // We do not forward any other buttons to the renderer.
200 if (event->type == GDK_2BUTTON_PRESS || event->type == GDK_3BUTTON_PRESS)
201 return FALSE;
200 202
201 // We want to translate the coordinates of events that do not originate 203 // We want to translate the coordinates of events that do not originate
202 // from this widget to be relative to the top left of the widget. 204 // from this widget to be relative to the top left of the widget.
203 GtkWidget* event_widget = gtk_get_event_widget( 205 GtkWidget* event_widget = gtk_get_event_widget(
204 reinterpret_cast<GdkEvent*>(event)); 206 reinterpret_cast<GdkEvent*>(event));
205 if (event_widget != widget) { 207 if (event_widget != widget) {
206 int x = 0; 208 int x = 0;
207 int y = 0; 209 int y = 0;
208 gtk_widget_get_pointer(widget, &x, &y); 210 gtk_widget_get_pointer(widget, &x, &y);
209 // If the mouse event happens outside our popup, force the popup to 211 // If the mouse event happens outside our popup, force the popup to
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after
685 const NativeWebKeyboardEvent& event) { 687 const NativeWebKeyboardEvent& event) {
686 if (!host_) 688 if (!host_)
687 return; 689 return;
688 690
689 EditCommands edit_commands; 691 EditCommands edit_commands;
690 if (key_bindings_handler_->Match(event, &edit_commands)) { 692 if (key_bindings_handler_->Match(event, &edit_commands)) {
691 host_->ForwardEditCommandsForNextKeyEvent(edit_commands); 693 host_->ForwardEditCommandsForNextKeyEvent(edit_commands);
692 } 694 }
693 host_->ForwardKeyboardEvent(event); 695 host_->ForwardKeyboardEvent(event);
694 } 696 }
OLDNEW
« 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