summaryrefslogtreecommitdiffstats
path: root/views
diff options
context:
space:
mode:
authoroshima@google.com <oshima@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-30 20:20:40 +0000
committeroshima@google.com <oshima@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-30 20:20:40 +0000
commitc235959b816ba67a36cd7b47aa4c975b2aab574a (patch)
treeae5bb7b88745845fce08f64214e37909b72de288 /views
parentd5a1e0e9b333dab910164c0063194437cae554a3 (diff)
downloadchromium_src-c235959b816ba67a36cd7b47aa4c975b2aab574a.zip
chromium_src-c235959b816ba67a36cd7b47aa4c975b2aab574a.tar.gz
chromium_src-c235959b816ba67a36cd7b47aa4c975b2aab574a.tar.bz2
Handle fake GTK events gracefully.
GTK sends fake enter/leave event when window activation changes. This event has (0,0) coordinates, which confuses NativeWidgetGtk::TransformEvent and ViewportWidget::OnMouseExited. This is a dirty hack to deal with gtk's fake events. This will be solved properly in NativeWidgetX + pure views. BUG=none TEST=click menu on notification. menu button on the notification shouldn't disappar and does not cause gtk warning. Review URL: http://codereview.chromium.org/7282020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@91189 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r--views/widget/native_widget_gtk.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/views/widget/native_widget_gtk.cc b/views/widget/native_widget_gtk.cc
index aef20078..ae43da9 100644
--- a/views/widget/native_widget_gtk.cc
+++ b/views/widget/native_widget_gtk.cc
@@ -1427,7 +1427,12 @@ gboolean NativeWidgetGtk::OnLeaveNotify(GtkWidget* widget,
GetWidget()->ResetLastMouseMoveFlag();
if (!HasMouseCapture() && !GetWidget()->is_mouse_button_pressed_) {
- MouseEvent mouse_event(TransformEvent(event));
+ // Don't convert if the event is synthetic and has 0x0 coordinates.
+ if (event->x_root || event->y_root || event->x || event->y ||
+ !event->send_event) {
+ TransformEvent(event);
+ }
+ MouseEvent mouse_event(reinterpret_cast<GdkEvent*>(event));
delegate_->OnMouseEvent(mouse_event);
}
return false;