* 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.
This commit is contained in:
Pavel Roskin 2001-07-10 18:18:09 +00:00
parent 3b83dc732f
commit c2560cf2a6
3 changed files with 40 additions and 13 deletions

View File

@ -1,3 +1,11 @@
2001-07-10 Pavel Roskin <proski@gnu.org>
* 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 <proski@gnu.org>
* gtkdtree.c: Include alloca.h if available.

View File

@ -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;
}

View File

@ -7,7 +7,9 @@
#include <config.h>
#include <stdlib.h>
#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;