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

Issue 155368: Fix double click item activation in right pane of bookmark manager.... (Closed)

Created:
11 years, 5 months ago by Evan Stade
Modified:
9 years, 6 months ago
CC:
chromium-reviews_googlegroups.com, Ben Goodger (Google)
Visibility:
Public.

Description

Fix double click item activation in right pane of bookmark manager. BUG=none TEST=double click on an unselected item, it should be activated Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=20424

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+31 lines, -9 lines) Patch
M chrome/browser/gtk/bookmark_manager_gtk.h View 2 chunks +8 lines, -1 line 0 comments Download
M chrome/browser/gtk/bookmark_manager_gtk.cc View 4 chunks +23 lines, -8 lines 0 comments Download

Messages

Total messages: 2 (0 generated)
Evan Stade
11 years, 5 months ago (2009-07-10 19:32:17 UTC) #1
Elliot Glaysher
11 years, 5 months ago (2009-07-10 19:57:41 UTC) #2
LGTM

On Fri, Jul 10, 2009 at 12:32 PM, <estade@chromium.org> wrote:
> Reviewers: Elliot Glaysher, Evan Martin,
>
> Description:
> Fix double click item activation in right pane of bookmark manager.
>
> BUG=3Dnone
> TEST=3Ddouble click on an unselected item, it should be activated
>
>
> Please review this at http://codereview.chromium.org/155368
>
> SVN Base: svn://chrome-svn/chrome/trunk/src/
>
> Affected files:
> =A0M =A0 =A0 chrome/browser/gtk/bookmark_manager_gtk.h
> =A0M =A0 =A0 chrome/browser/gtk/bookmark_manager_gtk.cc
>
>
> Index: chrome/browser/gtk/bookmark_manager_gtk.h
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> --- chrome/browser/gtk/bookmark_manager_gtk.h =A0 (revision 20336)
> +++ chrome/browser/gtk/bookmark_manager_gtk.h =A0 (working copy)
> @@ -122,6 +122,10 @@
> =A0 // separately depending on whether the path column is showing.
> =A0 void SaveColumnConfiguration();
>
> + =A0// Flush the saved mousedown. Should only be called when
> |delaying_mousedown_|
> + =A0// is true.
> + =A0void SendDelayedMousedown();
> +
> =A0 GtkTreeSelection* left_selection() {
> =A0 =A0 return gtk_tree_view_get_selection(GTK_TREE_VIEW(left_tree_view_)=
);
> =A0 }
> @@ -246,10 +250,13 @@
>
> =A0 scoped_refptr<SelectFileDialog> select_file_dialog_;
>
> - =A0// These two variables used for the workaround for
> http://crbug.com/15240.
> + =A0// These variables are used for the workaround for
> http://crbug.com/15240.
> =A0 // The last mouse down we got. Only valid while |delaying_mousedown| =
is
> true.
> =A0 GdkEventButton mousedown_event_;
> =A0 bool delaying_mousedown_;
> + =A0// This is true while we are propagating a delayed mousedown. It is =
used
> to
> + =A0// tell the button press handler to ignore the event.
> + =A0bool sending_delayed_mousedown_;
> =A0};
>
> =A0#endif =A0// CHROME_BROWSER_GTK_BOOKMARK_MANAGER_GTK_H_
> Index: chrome/browser/gtk/bookmark_manager_gtk.cc
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> --- chrome/browser/gtk/bookmark_manager_gtk.cc =A0(revision 20336)
> +++ chrome/browser/gtk/bookmark_manager_gtk.cc =A0(working copy)
> @@ -305,7 +305,8 @@
> =A0 =A0 =A0 organize_is_for_left_(true),
> =A0 =A0 =A0 search_factory_(this),
> =A0 =A0 =A0 select_file_dialog_(SelectFileDialog::Create(this)),
> - =A0 =A0 =A0delaying_mousedown_(false) {
> + =A0 =A0 =A0delaying_mousedown_(false),
> + =A0 =A0 =A0sending_delayed_mousedown_(false) {
> =A0 InitWidgets();
> =A0 g_signal_connect(window_, "destroy",
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0G_CALLBACK(OnWindowDestroy), this)=
;
> @@ -762,6 +763,14 @@
> =A0 }
> =A0}
>
> +void BookmarkManagerGtk::SendDelayedMousedown() {
> + =A0sending_delayed_mousedown_ =3D true;
> + =A0gtk_propagate_event(right_tree_view_,
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0reinterpret_cast<GdkEvent*>(=
&mousedown_event_));
> + =A0sending_delayed_mousedown_ =3D false;
> + =A0delaying_mousedown_ =3D false;
> +}
> +
> =A0bool BookmarkManagerGtk::RecursiveFind(GtkTreeModel* model, GtkTreeIte=
r*
> iter,
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0int target) {
> =A0 GValue value =3D { 0, };
> @@ -1099,13 +1108,22 @@
> =A0// static
> =A0gboolean BookmarkManagerGtk::OnRightTreeViewButtonPress(GtkWidget*
> tree_view,
> =A0 =A0 GdkEventButton* event, BookmarkManagerGtk* bm) {
> - =A0// Always let the cached mousedown sent from OnTreeViewButtonRelease
> through.
> - =A0if (bm->delaying_mousedown_)
> + =A0// Always let cached mousedown events through.
> + =A0if (bm->sending_delayed_mousedown_) {
> =A0 =A0 return FALSE;
> + =A0}
>
> =A0 if (event->button !=3D 1)
> =A0 =A0 return FALSE;
>
> + =A0// If a user double clicks, we will get two button presses in a row
> without
> + =A0// any intervening mouse up, hence we must flush delayed mousedowns =
here
> as
> + =A0// well as in the button release handler.
> + =A0if (bm->delaying_mousedown_) {
> + =A0 =A0bm->SendDelayedMousedown();
> + =A0 =A0return FALSE;
> + =A0}
> +
> =A0 GtkTreePath* path;
> =A0 gtk_tree_view_get_path_at_pos(GTK_TREE_VIEW(tree_view),
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 event->x,=
 event->y, &path, NULL, NULL,
> NULL);
> @@ -1157,11 +1175,8 @@
> =A0 NOTIMPLEMENTED();
> =A0#endif
>
> - =A0if (bm->delaying_mousedown_ && (tree_view =3D=3D bm->right_tree_view=
_)) {
> - =A0 =A0gtk_propagate_event(tree_view,
> -
> =A0reinterpret_cast<GdkEvent*>(&bm->mousedown_event_));
> - =A0 =A0bm->delaying_mousedown_ =3D false;
> - =A0}
> + =A0if (bm->delaying_mousedown_ && (tree_view =3D=3D bm->right_tree_view=
_))
> + =A0 =A0bm->SendDelayedMousedown();
>
> =A0 return FALSE;
> =A0}
>
>
>

Powered by Google App Engine
This is Rietveld 408576698