diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-10 21:40:54 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-10 21:40:54 +0000 |
commit | 2d3eba8e5ea6455334d78a69d0a57ad63a855eed (patch) | |
tree | 099c5f4707497b46bdf5da9e7878415da4124c6a /chrome/browser/gtk/bookmark_manager_gtk.cc | |
parent | bd68c98a38b630046ba7e6b83d9811d1bc2a27a9 (diff) | |
download | chromium_src-2d3eba8e5ea6455334d78a69d0a57ad63a855eed.zip chromium_src-2d3eba8e5ea6455334d78a69d0a57ad63a855eed.tar.gz chromium_src-2d3eba8e5ea6455334d78a69d0a57ad63a855eed.tar.bz2 |
Fix double click item activation in right pane of bookmark manager.
BUG=none
TEST=double click on an unselected item, it should be activated
Review URL: http://codereview.chromium.org/155368
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20424 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/bookmark_manager_gtk.cc')
-rw-r--r-- | chrome/browser/gtk/bookmark_manager_gtk.cc | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/chrome/browser/gtk/bookmark_manager_gtk.cc b/chrome/browser/gtk/bookmark_manager_gtk.cc index 52832f2..d43b422 100644 --- a/chrome/browser/gtk/bookmark_manager_gtk.cc +++ b/chrome/browser/gtk/bookmark_manager_gtk.cc @@ -305,7 +305,8 @@ BookmarkManagerGtk::BookmarkManagerGtk(Profile* profile) 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::SaveColumnConfiguration() { } } +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 @@ void BookmarkManagerGtk::OnRightTreeViewFocusIn(GtkTreeView* tree_view, // 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 @@ gboolean BookmarkManagerGtk::OnTreeViewButtonRelease(GtkWidget* tree_view, 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; } |