summaryrefslogtreecommitdiff
path: root/src/caja-navigation-window-pane.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/caja-navigation-window-pane.c')
-rw-r--r--src/caja-navigation-window-pane.c128
1 files changed, 23 insertions, 105 deletions
diff --git a/src/caja-navigation-window-pane.c b/src/caja-navigation-window-pane.c
index 91e5da94..aa700830 100644
--- a/src/caja-navigation-window-pane.c
+++ b/src/caja-navigation-window-pane.c
@@ -261,63 +261,21 @@ location_button_create (CajaNavigationWindowPane *pane)
}
static gboolean
-path_bar_button_pressed_callback (GtkWidget *widget,
- GdkEventButton *event,
- CajaNavigationWindowPane *pane)
-{
- CajaWindowSlot *slot;
- CajaView *view;
- GFile *location;
- char *uri;
-
- caja_window_set_active_pane (CAJA_WINDOW_PANE (pane)->window, CAJA_WINDOW_PANE (pane));
-
- g_object_set_data (G_OBJECT (widget), "handle-button-release",
- GINT_TO_POINTER (TRUE));
-
- if (event->button == 3)
- {
- slot = caja_window_get_active_slot (CAJA_WINDOW_PANE (pane)->window);
- view = slot->content_view;
- if (view != NULL)
- {
- location = caja_path_bar_get_path_for_button (
- CAJA_PATH_BAR (pane->path_bar), widget);
- if (location != NULL)
- {
- uri = g_file_get_uri (location);
- caja_view_pop_up_location_context_menu (
- view, event, uri);
- g_object_unref (G_OBJECT (location));
- g_free (uri);
- return TRUE;
- }
- }
- }
+path_bar_path_event_callback (CajaPathBar *path_bar,
+ GFile *location,
+ GdkEventButton *event,
+ CajaWindowPane *pane)
- return FALSE;
-}
-
-static gboolean
-path_bar_button_released_callback (GtkWidget *widget,
- GdkEventButton *event,
- CajaNavigationWindowPane *pane)
{
CajaWindowSlot *slot;
CajaWindowOpenFlags flags;
- GFile *location;
int mask;
- gboolean handle_button_release;
-
- mask = event->state & gtk_accelerator_get_default_mod_mask ();
- flags = 0;
-
- handle_button_release = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (widget),
- "handle-button-release"));
+ CajaView *view;
+ char *uri;
- if (event->type == GDK_BUTTON_RELEASE && handle_button_release)
- {
- location = caja_path_bar_get_path_for_button (CAJA_PATH_BAR (pane->path_bar), widget);
+ if (event->type == GDK_BUTTON_RELEASE) {
+ mask = event->state & gtk_accelerator_get_default_mod_mask ();
+ flags = 0;
if (event->button == 2 && mask == 0)
{
@@ -334,26 +292,25 @@ path_bar_button_released_callback (GtkWidget *widget,
caja_window_slot_info_open_location (slot, location,
CAJA_WINDOW_OPEN_ACCORDING_TO_MODE,
flags, NULL);
- g_object_unref (location);
- return TRUE;
}
- g_object_unref (location);
+ return FALSE;
}
+ if (event->button == 3) {
+ slot = caja_window_get_active_slot (pane->window);
+ view = slot->content_view;
+ if (view != NULL) {
+ uri = g_file_get_uri (location);
+ caja_view_pop_up_location_context_menu (view, event, uri);
+ g_free (uri);
+ }
+ return TRUE;
+ }
return FALSE;
}
static void
-path_bar_button_drag_begin_callback (GtkWidget *widget,
- GdkEventButton *event,
- gpointer user_data)
-{
- g_object_set_data (G_OBJECT (widget), "handle-button-release",
- GINT_TO_POINTER (FALSE));
-}
-
-static void
notebook_popup_menu_new_tab_cb (GtkMenuItem *menuitem,
gpointer user_data)
{
@@ -364,46 +321,6 @@ notebook_popup_menu_new_tab_cb (GtkMenuItem *menuitem,
}
static void
-path_bar_path_set_callback (GtkWidget *widget,
- GFile *location,
- CajaNavigationWindowPane *pane)
-{
- GList *children, *l;
- GtkWidget *child;
-
- children = gtk_container_get_children (GTK_CONTAINER (widget));
-
- for (l = children; l != NULL; l = l->next)
- {
- child = GTK_WIDGET (l->data);
-
- if (!GTK_IS_TOGGLE_BUTTON (child))
- {
- continue;
- }
-
- if (!g_signal_handler_find (child,
- G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA,
- 0, 0, NULL,
- path_bar_button_pressed_callback,
- pane))
- {
- g_signal_connect (child, "button-press-event",
- G_CALLBACK (path_bar_button_pressed_callback),
- pane);
- g_signal_connect (child, "button-release-event",
- G_CALLBACK (path_bar_button_released_callback),
- pane);
- g_signal_connect (child, "drag-begin",
- G_CALLBACK (path_bar_button_drag_begin_callback),
- pane);
- }
- }
-
- g_list_free (children);
-}
-
-static void
notebook_popup_menu_move_left_cb (GtkMenuItem *menuitem,
gpointer user_data)
{
@@ -766,8 +683,9 @@ caja_navigation_window_pane_setup (CajaNavigationWindowPane *pane)
g_signal_connect_object (pane->path_bar, "path_clicked",
G_CALLBACK (path_bar_location_changed_callback), pane, 0);
- g_signal_connect_object (pane->path_bar, "path_set",
- G_CALLBACK (path_bar_path_set_callback), pane, 0);
+
+ g_signal_connect_object (pane->path_bar, "path-event",
+ G_CALLBACK (path_bar_path_event_callback), pane, 0);
gtk_box_pack_start (GTK_BOX (hbox),
pane->path_bar,