[gtk+/gtk-3-22] placesview: Make middle click work
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-3-22] placesview: Make middle click work
- Date: Tue, 12 Dec 2017 18:57:14 +0000 (UTC)
commit 05e4e7fe879580dc3e468ea27487e563ebdcb9a0
Author: Matthias Clasen <mclasen redhat com>
Date: Tue Dec 12 13:56:15 2017 -0500
placesview: Make middle click work
This does not cost us much, and improves consistency.
gtk/gtkplacesview.c | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkplacesview.c b/gtk/gtkplacesview.c
index f8a2e22..2a79add 100644
--- a/gtk/gtkplacesview.c
+++ b/gtk/gtkplacesview.c
@@ -1897,10 +1897,21 @@ on_listbox_row_activated (GtkPlacesView *view,
GtkWidget *listbox)
{
GtkPlacesViewPrivate *priv;
+ GdkEvent *event;
+ guint button;
+ GtkPlacesOpenFlags open_flags;
priv = gtk_places_view_get_instance_private (view);
- activate_row (view, row, priv->current_open_flags);
+ event = gtk_get_current_event ();
+ gdk_event_get_button (event, &button);
+
+ if (gdk_event_get_event_type (event) == GDK_BUTTON_RELEASE && button == GDK_BUTTON_MIDDLE)
+ open_flags = GTK_PLACES_OPEN_NEW_TAB;
+ else
+ open_flags = priv->current_open_flags;
+
+ activate_row (view, row, open_flags);
}
static gboolean
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]