[PATCH] Fix for bgo#654558 - Can not stop file search. Stop button runs away from mouse pointer



Hi,

Attached is a patch to fix�bug #654558 [1]. It would be great if someone could review & (hopefully) commit it.

Kind regards,

Luke.

[1]�https://bugzilla.gnome.org/show_bug.cgi?id=654558
From 9edc417958a0818af5c8de0b8fea41b97eea6469 Mon Sep 17 00:00:00 2001
From: Luke Symes <allsymes gmail com>
Date: Sat, 16 Jul 2011 17:31:26 +1200
Subject: [PATCH] Don't hide the floating-bar on hover if it is interactive

---
 src/nautilus-floating-bar.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/src/nautilus-floating-bar.c b/src/nautilus-floating-bar.c
index 92acbc6..e296209 100644
--- a/src/nautilus-floating-bar.c
+++ b/src/nautilus-floating-bar.c
@@ -33,6 +33,7 @@ struct _NautilusFloatingBarDetails {
 	GtkWidget *label_widget;
 	GtkWidget *spinner;
 	gboolean show_spinner;
+	gboolean is_interactive;
 
 	guint escaping_distance;
 	GtkAllocation initial_allocation;
@@ -42,6 +43,7 @@ struct _NautilusFloatingBarDetails {
 enum {
 	PROP_LABEL = 1,
 	PROP_SHOW_SPINNER,
+	PROP_IS_INTERACTIVE,
 	PROP_ESCAPING_DISTANCE,
 	NUM_PROPERTIES
 };
@@ -146,6 +148,10 @@ overlay_enter_notify_cb (GtkWidget        *parent,
 		return FALSE;
 	}
 
+	if (NAUTILUS_FLOATING_BAR (widget)->priv->is_interactive) {
+		return FALSE;
+	}
+
 	if (gtk_widget_get_halign (widget) == GTK_ALIGN_START) {
 		gtk_widget_set_halign (widget, GTK_ALIGN_END);
 	} else {
@@ -288,6 +294,12 @@ nautilus_floating_bar_class_init (NautilusFloatingBarClass *klass)
 				      "Whether a spinner should be shown in the floating bar",
 				      FALSE,
 				      G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
+	properties[PROP_IS_INTERACTIVE] =
+		g_param_spec_boolean ("is-interactive",
+				      "Is interactive",
+				      "Whether the floating bar has interactive widgets",
+				      FALSE,
+				      G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
 	properties[PROP_ESCAPING_DISTANCE] =
 		g_param_spec_uint ("escaping-distance",
 				   "Escaping distance",
@@ -371,6 +383,8 @@ nautilus_floating_bar_add_action (NautilusFloatingBar *self,
 
 	g_signal_connect (button, "clicked",
 			  G_CALLBACK (action_button_clicked_cb), self);
+
+	self->priv->is_interactive = TRUE;
 }
 
 void
@@ -395,4 +409,6 @@ nautilus_floating_bar_cleanup_actions (NautilusFloatingBar *self)
 	}
 
 	g_list_free (children);
+
+	self->priv->is_interactive = FALSE;
 }
-- 
1.7.6



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]