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

Unified Diff: chrome/browser/gtk/bookmark_manager_gtk.cc

Issue 155368: Fix double click item activation in right pane of bookmark manager.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 5 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 | « chrome/browser/gtk/bookmark_manager_gtk.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/gtk/bookmark_manager_gtk.cc
===================================================================
--- chrome/browser/gtk/bookmark_manager_gtk.cc (revision 20336)
+++ chrome/browser/gtk/bookmark_manager_gtk.cc (working copy)
@@ -305,7 +305,8 @@
organize_is_for_left_(true),
search_factory_(this),
select_file_dialog_(SelectFileDialog::Create(this)),
- delaying_mousedown_(false) {
+ delaying_mousedown_(false),
+ sending_delayed_mousedown_(false) {
InitWidgets();
g_signal_connect(window_, "destroy",
G_CALLBACK(OnWindowDestroy), this);
@@ -762,6 +763,14 @@
}
}
+void BookmarkManagerGtk::SendDelayedMousedown() {
+ sending_delayed_mousedown_ = true;
+ gtk_propagate_event(right_tree_view_,
+ reinterpret_cast<GdkEvent*>(&mousedown_event_));
+ sending_delayed_mousedown_ = false;
+ delaying_mousedown_ = false;
+}
+
bool BookmarkManagerGtk::RecursiveFind(GtkTreeModel* model, GtkTreeIter* iter,
int target) {
GValue value = { 0, };
@@ -1099,13 +1108,22 @@
// static
gboolean BookmarkManagerGtk::OnRightTreeViewButtonPress(GtkWidget* tree_view,
GdkEventButton* event, BookmarkManagerGtk* bm) {
- // Always let the cached mousedown sent from OnTreeViewButtonRelease through.
- if (bm->delaying_mousedown_)
+ // Always let cached mousedown events through.
+ if (bm->sending_delayed_mousedown_) {
return FALSE;
+ }
if (event->button != 1)
return FALSE;
+ // If a user double clicks, we will get two button presses in a row without
+ // any intervening mouse up, hence we must flush delayed mousedowns here as
+ // well as in the button release handler.
+ if (bm->delaying_mousedown_) {
+ bm->SendDelayedMousedown();
+ return FALSE;
+ }
+
GtkTreePath* path;
gtk_tree_view_get_path_at_pos(GTK_TREE_VIEW(tree_view),
event->x, event->y, &path, NULL, NULL, NULL);
@@ -1157,11 +1175,8 @@
NOTIMPLEMENTED();
#endif
- if (bm->delaying_mousedown_ && (tree_view == bm->right_tree_view_)) {
- gtk_propagate_event(tree_view,
- reinterpret_cast<GdkEvent*>(&bm->mousedown_event_));
- bm->delaying_mousedown_ = false;
- }
+ if (bm->delaying_mousedown_ && (tree_view == bm->right_tree_view_))
+ bm->SendDelayedMousedown();
return FALSE;
}
« no previous file with comments | « chrome/browser/gtk/bookmark_manager_gtk.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698