From c2560cf2a6a78754e141c376a9944c805192389d Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Tue, 10 Jul 2001 18:18:09 +0000 Subject: [PATCH] * gscreen.c (panel_icon_list_select_icon): This function doesn't get GDK_BUTTON_RELEASE, so move middle button processing ... (panel_icon_list_button_release): ... here. * gtkflist.c (gtk_flist_button_release): Open new window if the middle button is released and DnD is not attempted. --- gnome/ChangeLog | 8 ++++++++ gnome/gscreen.c | 30 +++++++++++++++++------------- gnome/gtkflist.c | 15 +++++++++++++++ 3 files changed, 40 insertions(+), 13 deletions(-) diff --git a/gnome/ChangeLog b/gnome/ChangeLog index 80a9c6634..4289ef9c7 100644 --- a/gnome/ChangeLog +++ b/gnome/ChangeLog @@ -1,3 +1,11 @@ +2001-07-10 Pavel Roskin + + * gscreen.c (panel_icon_list_select_icon): This function doesn't + get GDK_BUTTON_RELEASE, so move middle button processing ... + (panel_icon_list_button_release): ... here. + * gtkflist.c (gtk_flist_button_release): Open new window if the + middle button is released and DnD is not attempted. + 2001-07-09 Pavel Roskin * gtkdtree.c: Include alloca.h if available. diff --git a/gnome/gscreen.c b/gnome/gscreen.c index 1395bc5a2..50b25618a 100644 --- a/gnome/gscreen.c +++ b/gnome/gscreen.c @@ -1321,19 +1321,6 @@ panel_icon_list_select_icon (GtkWidget *widget, int index, GdkEvent *event, WPan break; - case GDK_BUTTON_RELEASE: - if (event->button.button == 2){ - char *fullname; - - if (S_ISDIR (panel->dir.list [index].buf.st_mode) || - panel->dir.list [index].f.link_to_dir){ - fullname = concat_dir_and_file (panel->cwd, panel->dir.list [index].fname); - new_panel_at (fullname); - g_free (fullname); - } - } - break; - case GDK_2BUTTON_PRESS: if (event->button.button == 1) { do_enter (panel); @@ -1521,6 +1508,23 @@ static int panel_icon_list_button_release (GtkWidget *widget, GdkEventButton *event, WPanel *panel) { panel->maybe_start_drag = 0; + if (event->button == 2){ + char *fullname; + int icon; + file_entry *fe; + + GnomeIconList *gil = GNOME_ICON_LIST (widget); + icon = gnome_icon_list_get_icon_at (gil, event->x, event->y); + fe = &panel->dir.list [icon]; + + if (S_ISDIR (fe->buf.st_mode) || fe->f.link_to_dir){ + fullname = concat_dir_and_file (panel->cwd, fe->fname); + new_panel_at (fullname); + g_free (fullname); + } + return TRUE; + } + return FALSE; } diff --git a/gnome/gtkflist.c b/gnome/gtkflist.c index a682014ac..a1ce1de15 100644 --- a/gnome/gtkflist.c +++ b/gnome/gtkflist.c @@ -7,7 +7,9 @@ #include #include +#include "x.h" #include "gtkflist.h" +#include "gmain.h" enum { @@ -333,6 +335,19 @@ gtk_flist_button_release (GtkWidget *widget, GdkEventButton *event) select_row (flist, row, flist->dnd_select_pending_state); flist->dnd_select_pending = FALSE; flist->dnd_select_pending_state = 0; + } else if (event->button == 2) { + /* Middle click opens another window */ + char *fullname; + file_entry *fe; + + fe = &flist->panel->dir.list [row]; + + if (S_ISDIR (fe->buf.st_mode) || fe->f.link_to_dir) { + fullname = concat_dir_and_file (flist->panel->cwd, + fe->fname); + new_panel_at (fullname); + g_free (fullname); + } } retval = TRUE;