summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-24 21:55:08 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-24 21:55:08 +0000
commite97f40adcfd298cfd2b68b0c78a3fc0acaa71c2c (patch)
treeec013374b4d82c4b94ef1c4398a7fcf63012a287
parent6f1ece11cc87ef228d55939ce62593207b0acfa5 (diff)
downloadchromium_src-e97f40adcfd298cfd2b68b0c78a3fc0acaa71c2c.zip
chromium_src-e97f40adcfd298cfd2b68b0c78a3fc0acaa71c2c.tar.gz
chromium_src-e97f40adcfd298cfd2b68b0c78a3fc0acaa71c2c.tar.bz2
Fixes crash on double clicking in the upper right corner of the
window. For some reason gtk_window_begin_move_drag crashes when invoked for double/triple clicks. BUG=none TEST=none Review URL: http://codereview.chromium.org/434045 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32976 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--views/window/window_gtk.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/views/window/window_gtk.cc b/views/window/window_gtk.cc
index 2cacccd..5fb2bd6 100644
--- a/views/window/window_gtk.cc
+++ b/views/window/window_gtk.cc
@@ -264,11 +264,13 @@ gboolean WindowGtk::OnButtonPress(GtkWidget* widget, GdkEventButton* event) {
case HTCAPTION: {
MouseEvent mouse_pressed(Event::ET_MOUSE_PRESSED, event->x, event->y,
WidgetGtk::GetFlagsForEventButton(*event));
- // Start dragging only if the mouse event is *not* a right
+ // Start dragging if the mouse event is a single click and *not* a right
// click. If it is a right click, then pass it through to
- // WidgetGtk::OnButtonPress so that View class can show
- // ContextMenu upon a mouse release event.
- if (!mouse_pressed.IsOnlyRightMouseButton()) {
+ // WidgetGtk::OnButtonPress so that View class can show ContextMenu upon a
+ // mouse release event. We only start drag on single clicks as we get a
+ // crash in Gtk on double/triple clicks.
+ if (event->type == GDK_BUTTON_PRESS &&
+ !mouse_pressed.IsOnlyRightMouseButton()) {
gfx::Point screen_point(event->x, event->y);
View::ConvertPointToScreen(GetRootView(), &screen_point);
gtk_window_begin_move_drag(GetNativeWindow(), event->button,