After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 316257 - forward / back mouse buttons should trigger next / previous songs
forward / back mouse buttons should trigger next / previous songs
Status: RESOLVED FIXED
Product: rhythmbox
Classification: Other
Component: User Interface
0.12.x
Other All
: Normal enhancement
: ---
Assigned To: RhythmBox Maintainers
RhythmBox Maintainers
Depends on:
Blocks:
 
 
Reported: 2005-09-14 03:12 UTC by James
Modified: 2009-11-29 12:33 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch for handing back/foward mouse clicks while over system tray icon (34.75 KB, patch)
2009-11-14 03:35 UTC, James
none Details | Review
Patch for handing back/foward mouse clicks while over system tray icon (649 bytes, patch)
2009-11-14 03:40 UTC, James
reviewed Details | Review
Added spaces before function names (665 bytes, patch)
2009-11-16 00:15 UTC, James
committed Details | Review

Description James 2005-09-14 03:12:47 UTC
I think it would be a good feature if rhythm box picked up the forward and
backward mouse buttons and used them to control which song is playing.
Comment 1 James 2006-04-05 04:43:07 UTC
Adding to this, it would be nice if you could just hover the mouse over the tray icon and side click to go back and forward between songs.
Comment 2 James "Doc" Livingston 2006-04-08 00:25:37 UTC
(In reply to comment #0)
> I think it would be a good feature if rhythm box picked up the forward and
> backward mouse buttons and used them to control which song is playing.

The best thing to do is to make those buttons emit Alt-Left and Alt-Right. As those are the standard Back and Forward shortcuts, it should work in most programs (including Rhythmbox).


(In reply to comment #1)
> Adding to this, it would be nice if you could just hover the mouse over the
> tray icon and side click to go back and forward between songs.

This would be fairly difficult, as different mice have them as different button numbers. Some mice (mouse-wheel + back/forward button) have them as buttons 6/7, others have them as 8/9 (some with extra buttons).

I'm not sure if we can really do this in a way that doesn't do weird things with different mice.
Comment 3 James 2006-04-17 21:29:12 UTC
Well, scrolling the mouse wheel over the system tray icon lowers and raises the volume, I don't see how adding the side buttons there would be any different than that.  It would make rhythmbox much more convenient for multitasking users - just move the mouse to the icon and give a side click, and the song is changed!

People with different mouse buttons use different xmodmap and xserver settings anyway, so, you could just make the controls triggered by the same buttons that other programs use.  As long as it follows the same convention that other programs are using (such as galeon, firefox, thunar), users would not have much of a problem.
Comment 4 James "Doc" Livingston 2006-04-18 06:12:16 UTC
The standard is to make them emit Alt-Left and Alt-Right. If you have a recent (at least 0.9.3 iirc) version of Rhythmbox, they should work in the main window.

The problem with doing it over the tray icon, is that (afaik) tray icons don't get keyboard events - so we can't respond to Alt-Arrows.
Comment 5 James 2009-11-14 03:35:22 UTC
Created attachment 147710 [details] [review]
Patch for handing back/foward mouse clicks while over system tray icon

Handles back/forward mouse buttons while hovering over system tray icon.  A "previous button" click will go to the previous song, while a "next button" click will go to the next song.  A very slick to change songs!  Does not interfere with the scroll wheel or right or left clicking.
Comment 6 James 2009-11-14 03:37:25 UTC
Comment on attachment 147710 [details] [review]
Patch for handing back/foward mouse clicks while over system tray icon

>diff -Naur rhythmbox-0.12.5.orig/plugins/status-icon/rb-status-icon-plugin.c rhythmbox-0.12.5/plugins/status-icon/rb-status-icon-plugin.c
>--- rhythmbox-0.12.5.orig/plugins/status-icon/rb-status-icon-plugin.c	2009-09-16 14:04:49.000000000 -0700
>+++ rhythmbox-0.12.5/plugins/status-icon/rb-status-icon-plugin.c	2009-11-13 19:21:20.000000000 -0800
>@@ -281,6 +281,12 @@
> 		rb_tray_icon_menu_popup (plugin->priv->tray_icon, popup, 3);
> 		g_object_unref (ui_manager);
> 		break;
>+	case 8:
>+		rb_shell_player_do_previous(plugin->priv->shell_player, NULL);
>+		break;
>+	case 9:
>+		rb_shell_player_do_next(plugin->priv->shell_player, NULL);
>+		break;
> 	}
> }
>
Comment 7 James 2009-11-14 03:40:04 UTC
Created attachment 147711 [details] [review]
Patch for handing back/foward mouse clicks while over system tray icon

Handles back/forward mouse buttons while hovering over system tray icon.  A
"previous button" click will go to the previous song, while a "next button"
click will go to the next song.  A very slick to change songs!  Does not
interfere with the scroll wheel or right or left clicking.

I messed up the last patch, it had a bunch of extra debian stuff in it.  This one doesn't.
Comment 8 Jonathan Matthew 2009-11-15 08:44:59 UTC
Review of attachment 147711 [details] [review]:

::: rhythmbox-0.12.5.orig/plugins/status-icon/rb-status-icon-plugin.c
@@ +282,3 @@
 		g_object_unref (ui_manager);
 		break;
+	case 8:

where does the number 8 come from here?  is the 8th mouse button always 'previous'?  is the 'previous' mouse button always the 8th?

@@ +283,3 @@
 		break;
+	case 8:
+		rb_shell_player_do_previous(plugin->priv->shell_player, NULL);

needs to be a space between the function and its arguments

@@ +285,3 @@
+		rb_shell_player_do_previous(plugin->priv->shell_player, NULL);
+		break;
+	case 9:

same as above
Comment 9 James 2009-11-16 00:12:28 UTC
Buttons 8 and 9 are almost always the defaults for the back and forward buttons.  If they are not, most distrubutions/howtos and wikis recommend remapping them to 8/9 via xmodmap.  Nautilus, firefox and file-roller count buttons 8 and 9 as the forward and back buttons.
Comment 10 James 2009-11-16 00:15:20 UTC
Created attachment 147833 [details] [review]
Added spaces before function names
Comment 11 Jonathan Matthew 2009-11-29 12:33:04 UTC
committed as 9a982259f8c7b1e4733dac5fcbdd3c2560387637