summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNelson Benítez León <nbenitezl+gnome@gmail.com>2017-09-20 20:43:52 +0500
committerErnestas Kulik <ernestask@gnome.org>2018-03-24 19:54:35 +0200
commit12769c995b850c386458aa692ba4b9bc9fd560c4 (patch)
tree8911078f4de6f580af139d011c7d08d5b4c62804
parent1fce6830b239d5a259f5f79568b74af6ac5ba9d5 (diff)
downloadnautilus-12769c995b850c386458aa692ba4b9bc9fd560c4.tar.gz
files-view: fix NautilusFloatingBar interfering with double click
When you have the mouse pointer at the bottom of the icon view in the area of the floating bar (which is hidden as you have the pointer there) if the file is not selected and you double-click it, it fails to launch because the floating bar appears for an instant and eats the second click of the double-click. What happens is the first click selects the file and queues a floating bar show info, the floating bar appears for an instant eating your second click, it hides again as you have the pointer in the floating bar area. Fixed by making the floating bar pass-through the click events to its underneath window just for the timeframe a double click could happen. We can't leave pass-through always on because the parent overlay "enter-notify-event" event would not fire in that case. Fixes: https://gitlab.gnome.org/GNOME/nautilus/issues/28
-rw-r--r--src/nautilus-files-view.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c
index 0175e689b..30e5a143d 100644
--- a/src/nautilus-files-view.c
+++ b/src/nautilus-files-view.c
@@ -531,6 +531,17 @@ floating_bar_set_status_timeout_cb (gpointer data)
return FALSE;
}
+static gboolean
+remove_floating_bar_passthrough (gpointer data)
+{
+ NautilusFilesViewPrivate *priv;
+
+ priv = nautilus_files_view_get_instance_private (NAUTILUS_FILES_VIEW (data));
+ gtk_overlay_set_overlay_pass_through (GTK_OVERLAY (priv->overlay),
+ priv->floating_bar, FALSE);
+ return G_SOURCE_REMOVE;
+}
+
static void
set_floating_bar_status (NautilusFilesView *view,
const gchar *primary_status,
@@ -559,6 +570,12 @@ set_floating_bar_status (NautilusFilesView *view,
status_data->detail_status = g_strdup (detail_status);
status_data->view = view;
+ /* Activate passthrough on the floating bar just long enough for a
+ * potential double click to happen, so to not interfere with it */
+ gtk_overlay_set_overlay_pass_through (GTK_OVERLAY (priv->overlay),
+ priv->floating_bar, TRUE);
+ g_timeout_add ((guint) double_click_time, remove_floating_bar_passthrough, view);
+
/* waiting for half of the double-click-time before setting
* the status seems to be a good approximation of not setting it
* too often and not delaying the statusbar too much.