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

Unified Diff: chrome/browser/tab_contents/tab_contents_view_gtk.cc

Issue 150204: GTK: when doing a drag from a web page, pass a recent mouse down to gtk_drag_... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 6 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
Index: chrome/browser/tab_contents/tab_contents_view_gtk.cc
===================================================================
--- chrome/browser/tab_contents/tab_contents_view_gtk.cc (revision 19793)
+++ chrome/browser/tab_contents/tab_contents_view_gtk.cc (working copy)
@@ -350,7 +350,7 @@
void TabContentsViewGtk::ShowContextMenu(const ContextMenuParams& params) {
context_menu_.reset(new RenderViewContextMenuGtk(tab_contents(), params,
- last_mouse_down_time_));
+ last_mouse_down_.time));
context_menu_->Init();
context_menu_->Popup();
}
@@ -392,7 +392,13 @@
0, GtkDndUtil::X_CHROME_WEBDROP_FILE_CONTENTS);
}
- gtk_drag_begin(GetContentNativeView(), list, GDK_ACTION_COPY, 1, NULL);
+ // If we don't pass an event, GDK won't know what event time to start grabbing
+ // mouse events. Technically it's the mouse motion event and not the mouse
+ // down event that causes the drag, but there's no reliable way to know
+ // *which* motion event initiated the drag, so this will have to do.
+ gtk_drag_begin(GetContentNativeView(), list, GDK_ACTION_COPY,
+ last_mouse_down_.button,
+ reinterpret_cast<GdkEvent*>(&last_mouse_down_));
// The drag adds a ref; let it own the list.
gtk_target_list_unref(list);
}
@@ -459,7 +465,7 @@
gboolean TabContentsViewGtk::OnMouseDown(GtkWidget* widget,
GdkEventButton* event, TabContentsViewGtk* view) {
- view->last_mouse_down_time_ = event->time;
+ view->last_mouse_down_ = *event;
return FALSE;
}

Powered by Google App Engine
This is Rietveld 408576698