[Rhythmbox-devel] [PATCH] add command line option play-pause without focusing




Hi All,

I really like rhythmbox a lot.  I've finally got it working with MP3 
support and I have the following addition (patch attached).

I added a commind line option to toggle play/pause but without focusing 
the window.  Arguably, --play-pause should be modified to not focus, and 
another option --focus could be added to explicitly focus the window.

But in the interests of not causing behavior change, I added a new option 
--play-pause-nf (non-focusing).  A patch to the SPEC file to incorporate 
the patch is included as well.

Now I can go into the GNOME Metacity Keybindings 
(/apps/metacity/global_keybindings in gconf) and add the binding so that I 
can toggle play/pause from any desktop/workspace without having the 
rhythmbox window move itself to this workspace and come in front.  Works 
perfectly.

Thanks for the good work,
David

P.S.  I hope the only reason you don't allow non-list members to post is 
to prevent spam.  Othewise, it's a bit weird and restrictive.  Have a nice 
day.


-- 
/==============================\
| David Mansfield              |
| rb@dm.cobite.com             |
\==============================/
--- rhythmbox-0.6.1/shell/main.c.orig	2003-12-08 12:16:35.000000000 -0500
+++ rhythmbox-0.6.1/shell/main.c	2003-12-08 12:21:05.000000000 -0500
@@ -65,6 +65,7 @@
 static gboolean print_playing = FALSE;
 static gboolean print_playing_path = FALSE;
 static gboolean playpause       = FALSE;
+static gboolean playpause_nf    = FALSE;
 static gboolean previous        = FALSE;
 static gboolean next            = FALSE;
 static gboolean print_play_time = FALSE;
@@ -89,6 +90,7 @@
         { "set-play-time", 	    0,  POPT_ARG_LONG,			&seek_time,				0, N_("Seek to the specified time in playing song if possible and exit"),	NULL },
         
 		{ "play-pause",		    0,  POPT_ARG_NONE,			&playpause,	        	0, N_("Toggle play/pause mode"),     NULL },
+		{ "play-pause-nf",	    0,  POPT_ARG_NONE,			&playpause_nf,	        	0, N_("Toggle play/pause mode, don't focus window"),     NULL },
 		{ "previous",		    0,  POPT_ARG_NONE,			&previous,	        	0, N_("Jump to previous song"),     NULL },
 		{ "next",		        0,  POPT_ARG_NONE,			&next,		        	0, N_("Jump to next song"),     NULL },
 		
@@ -340,6 +342,12 @@
 	if (playpause)
 		GNOME_Rhythmbox_playPause (shell, &ev);
 
+	if (playpause_nf)
+	{
+		GNOME_Rhythmbox_playPause (shell, &ev);
+		grab_focus = FALSE;
+	}
+
 	if (previous)
 		GNOME_Rhythmbox_previous (shell, &ev);
 
--- rhythmbox-0.6.1/rhythmbox.spec.orig	2003-12-08 12:42:05.000000000 -0500
+++ rhythmbox-0.6.1/rhythmbox.spec	2003-12-08 12:42:13.000000000 -0500
@@ -8,10 +8,11 @@
 Name:		rhythmbox
 Summary:	Music Management Application 
 Version:	0.6.1
-Release:	1
+Release:	1a
 License:	GPL
 Group:		Applications/Multimedia
 Source:		%{name}-%{version}.tar.gz
+Patch0:		rhythmbox-play-pause-nf.patch
 BuildRoot:	%{_tmppath}/%{name}-%{version}-root
 Requires:	gtk2 >= %{gtk2_version}
 Requires:	libgnomeui >= %{libgnomeui_version}
@@ -32,6 +33,7 @@
 
 %prep
 %setup -q
+%patch0 -p1
 
 %build
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]