summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCosimo Cecchi <cosimoc@gnome.org>2010-09-17 19:28:27 +0200
committerCosimo Cecchi <cosimoc@gnome.org>2010-09-17 19:28:27 +0200
commit476d45bfd1dd71595e7d38f4d18c761fe2a85b78 (patch)
tree40fd0a4211dc270d272bd500d04d4fc294b479dd
parentbfe278cbf84a441a951d48dc528f20226127e1f3 (diff)
downloadnautilus-476d45bfd1dd71595e7d38f4d18c761fe2a85b78.tar.gz
Don't check for the eject button if the row doesn't have it (#628347)
This sometimes caused false positives in the click-on-eject-button detection method.
-rw-r--r--src/nautilus-places-sidebar.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/nautilus-places-sidebar.c b/src/nautilus-places-sidebar.c
index ce3ef5ef2..cd25f5b1f 100644
--- a/src/nautilus-places-sidebar.c
+++ b/src/nautilus-places-sidebar.c
@@ -913,12 +913,26 @@ over_eject_button (NautilusPlacesSidebar *sidebar,
GtkTextDirection direction;
int width, total_width;
int eject_button_size;
+ gboolean show_eject;
+ GtkTreeIter iter;
+ GtkTreeModel *model;
*path = NULL;
+ model = gtk_tree_view_get_model (sidebar->tree_view);
if (gtk_tree_view_get_path_at_pos (sidebar->tree_view,
x, y,
path, &column, NULL, NULL)) {
+
+ gtk_tree_model_get_iter (model, &iter, *path);
+ gtk_tree_model_get (model, &iter,
+ PLACES_SIDEBAR_COLUMN_EJECT, &show_eject,
+ -1);
+
+ if (!show_eject) {
+ goto out;
+ }
+
total_width = 0;
gtk_widget_style_get (GTK_WIDGET (sidebar->tree_view),
@@ -959,6 +973,7 @@ over_eject_button (NautilusPlacesSidebar *sidebar,
}
}
+ out:
if (*path != NULL) {
gtk_tree_path_free (*path);
*path = NULL;