From 9024b23d93be00121d5d088f95d33e8d77a4dd32 Mon Sep 17 00:00:00 2001 From: Thomas Leonard Date: Wed, 15 May 2002 16:18:09 +0000 Subject: [PATCH] r1476: Options to forward button-3 clicks on the pinboard to the window manager (requested by Ryan Harris). --- ROX-Filer/Help/Changes | 2 ++ ROX-Filer/Options.xml | 1 + ROX-Filer/src/Makefile.in | 4 ++-- ROX-Filer/src/pinboard.c | 10 +++++++--- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/ROX-Filer/Help/Changes b/ROX-Filer/Help/Changes index 200862c0..ec97674d 100644 --- a/ROX-Filer/Help/Changes +++ b/ROX-Filer/Help/Changes @@ -5,6 +5,8 @@ 15-May-2002 ~~~~~~~~~~~ Wrap long icon names onto multiple lines. +Options to forward button-3 clicks on the pinboard to the window manager +(requested by Ryan Harris). 14-May-2002 ~~~~~~~~~~~ diff --git a/ROX-Filer/Options.xml b/ROX-Filer/Options.xml index 683fbfd5..f95dbe5a 100644 --- a/ROX-Filer/Options.xml +++ b/ROX-Filer/Options.xml @@ -113,6 +113,7 @@ See the manual for information about using the pinboard. Clicking on an item opens it with this on. Hold down Control to select the item instead. If off, clicking once selects an item; double click to open things. + Normally, clicking on the desktop background will open the pinboard menu. Turn this on to forward the event to your window manager instead. Clicks on icons will not be forwarded. If this is set, pinboard icons are always kept completely within screen limits, including the label. diff --git a/ROX-Filer/src/Makefile.in b/ROX-Filer/src/Makefile.in index 6aafb7da..14391848 100644 --- a/ROX-Filer/src/Makefile.in +++ b/ROX-Filer/src/Makefile.in @@ -24,7 +24,7 @@ SRCS = abox.c action.c appinfo.c appmenu.c bind.c choices.c \ fscache.c gtksavebox.c gui_support.c i18n.c icon.c infobox.c \ main.c menu.c minibuffer.c modechange.c mount.c options.c \ panel.c pinboard.c pixmaps.c remote.c rox_gettext.c run.c \ - support.c sc.c session.c tasklist.c toolbar.c type.c \ + sc.c session.c support.c tasklist.c toolbar.c type.c \ usericons.c wrapped.c xml.c OBJECTS = abox.o action.o appinfo.o appmenu.o bind.o choices.o \ @@ -32,7 +32,7 @@ OBJECTS = abox.o action.o appinfo.o appmenu.o bind.o choices.o \ fscache.o gtksavebox.o gui_support.o i18n.o icon.o infobox.o \ main.o menu.o minibuffer.o modechange.o mount.o options.o \ panel.o pinboard.o pixmaps.o remote.o rox_gettext.o run.o \ - support.o sc.o session.o tasklist.o toolbar.o type.o \ + sc.o session.o support.o tasklist.o toolbar.o type.o \ usericons.o wrapped.o xml.o ############ Things to keep the same diff --git a/ROX-Filer/src/pinboard.c b/ROX-Filer/src/pinboard.c index c0f4d5e5..65e949e1 100644 --- a/ROX-Filer/src/pinboard.c +++ b/ROX-Filer/src/pinboard.c @@ -126,7 +126,7 @@ typedef enum { static Option o_pinboard_clamp_icons, o_pinboard_grid_step; static Option o_pinboard_fg_colour, o_pinboard_bg_colour; -static Option o_pinboard_tasklist; +static Option o_pinboard_tasklist, o_forward_button_3; /* Static prototypes */ static GType pin_icon_get_type(void); @@ -216,6 +216,7 @@ void pinboard_init(void) option_add_int(&o_pinboard_grid_step, "pinboard_grid_step", GRID_STEP_COARSE); option_add_int(&o_pinboard_tasklist, "pinboard_tasklist", TRUE); + option_add_int(&o_forward_button_3, "pinboard_forward_button_3", FALSE); option_add_notify(pinboard_check_options); @@ -931,12 +932,15 @@ static void forward_to_root(GdkEventButton *event) ButtonPressMask | ButtonReleaseMask, (XEvent *) &xev); } +#define FORWARDED_BUTTON(pi, button) ((button) == 2 || \ + ((button) == 3 && o_forward_button_3.int_value && !pi)) + /* pi is NULL if this is a root event */ static gboolean button_release_event(GtkWidget *widget, GdkEventButton *event, PinIcon *pi) { - if (event->button == 2) + if (FORWARDED_BUTTON(pi, event->button)) forward_to_root(event); else if (dnd_motion_release(event)) return TRUE; @@ -954,7 +958,7 @@ static gboolean button_press_event(GtkWidget *widget, /* Just in case we've jumped in front of everything... */ gdk_window_lower(current_pinboard->window->window); - if (event->button == 2) + if (FORWARDED_BUTTON(pi, event->button)) forward_to_root(event); else if (dnd_motion_press(widget, event)) perform_action(pi, event); -- 2.11.4.GIT