[nautilus] Trigger the eject button on release.
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] Trigger the eject button on release.
- Date: Thu, 6 May 2010 16:42:39 +0000 (UTC)
commit 108a23dc0e0be534530028612d72302c7d2a1e53
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Thu May 6 18:26:27 2010 +0200
Trigger the eject button on release.
src/nautilus-places-sidebar.c | 18 ++++++++----------
1 files changed, 8 insertions(+), 10 deletions(-)
---
diff --git a/src/nautilus-places-sidebar.c b/src/nautilus-places-sidebar.c
index db9fc23..c70575e 100644
--- a/src/nautilus-places-sidebar.c
+++ b/src/nautilus-places-sidebar.c
@@ -700,7 +700,7 @@ clicked_eject_button (NautilusPlacesSidebar *sidebar,
*path = NULL;
- if (event->type == GDK_BUTTON_PRESS &&
+ if ((event->type == GDK_BUTTON_PRESS || event->type == GDK_BUTTON_RELEASE) &&
gtk_tree_view_get_path_at_pos (sidebar->tree_view,
button_event->x, button_event->y,
path, &column, NULL, NULL)) {
@@ -2354,11 +2354,18 @@ bookmarks_button_release_event_cb (GtkWidget *widget,
GtkTreePath *path;
GtkTreeModel *model;
GtkTreeView *tree_view;
+ gboolean ret;
if (event->type != GDK_BUTTON_RELEASE) {
return TRUE;
}
+ if (clicked_eject_button (sidebar, &path)) {
+ ret = eject_or_unmount_bookmark (sidebar, path);
+ gtk_tree_path_free (path);
+ return ret;
+ }
+
tree_view = GTK_TREE_VIEW (widget);
model = gtk_tree_view_get_model (tree_view);
@@ -2388,20 +2395,11 @@ bookmarks_button_press_event_cb (GtkWidget *widget,
GdkEventButton *event,
NautilusPlacesSidebar *sidebar)
{
- GtkTreePath *path;
- gboolean ret;
-
if (event->type != GDK_BUTTON_PRESS) {
/* ignore multiple clicks */
return TRUE;
}
- if (clicked_eject_button (sidebar, &path)) {
- ret = eject_or_unmount_bookmark (sidebar, path);
- gtk_tree_path_free (path);
- return ret;
- }
-
if (event->button == 3) {
bookmarks_popup_menu (sidebar, event);
} else if (event->button == 2) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]