[arch-commits] CVS update of extra/gnome/gnome-applets (3 files)
Jan de Groot
jgc at archlinux.org
Mon Mar 17 18:58:53 UTC 2008
Date: Monday, March 17, 2008 @ 14:58:53
Author: jgc
Path: /home/cvs-extra/extra/gnome/gnome-applets
Added: 80_mixer_user_gstreamer_signals.patch (1.1)
Modified: PKGBUILD (1.40 -> 1.41) gnome-applets.install (1.13 -> 1.14)
upgpkg: gnome-applets 2.22.0-1
GNOME 2.22
---------------------------------------+
80_mixer_user_gstreamer_signals.patch | 150 ++++++++++++++++++++++++++++++++
PKGBUILD | 20 ++--
gnome-applets.install | 5 -
3 files changed, 161 insertions(+), 14 deletions(-)
Index: extra/gnome/gnome-applets/80_mixer_user_gstreamer_signals.patch
diff -u /dev/null extra/gnome/gnome-applets/80_mixer_user_gstreamer_signals.patch:1.1
--- /dev/null Mon Mar 17 14:58:53 2008
+++ extra/gnome/gnome-applets/80_mixer_user_gstreamer_signals.patch Mon Mar 17 14:58:52 2008
@@ -0,0 +1,150 @@
+diff -ur gnome-applets-2.19.1/mixer/applet.c gnome-applets-2.19.1.new/mixer/applet.c
+--- gnome-applets-2.19.1/mixer/applet.c 2007-07-28 03:02:35.000000000 +0100
++++ gnome-applets-2.19.1.new/mixer/applet.c 2007-08-30 20:36:22.000000000 +0100
+@@ -80,6 +80,9 @@
+
+ static void gnome_volume_applet_refresh (GnomeVolumeApplet *applet,
+ gboolean force_refresh);
++
++static void cb_notify_message (GstBus *bus, GstMessage *message, gpointer data);
++
+ static gboolean cb_check (gpointer data);
+
+ static void cb_volume (GtkAdjustment *adj,
+@@ -242,6 +245,12 @@
+ /* i18n */
+ ao = gtk_widget_get_accessible (GTK_WIDGET (applet));
+ atk_object_set_name (ao, _("Volume Control"));
++
++ /* Bus for notifications */
++ applet->bus = gst_bus_new ();
++ gst_bus_add_signal_watch (applet->bus);
++ g_signal_connect (G_OBJECT (applet->bus), "message::element",
++ (GCallback) cb_notify_message, applet);
+ }
+
+ /* Parse the list of tracks that are stored in GConf */
+@@ -368,12 +377,33 @@
+ return FALSE;
+
+ applet->mixer = g_object_ref (active_element);
++ gst_element_set_bus (GST_ELEMENT (applet->mixer), applet->bus);
+ applet->tracks = active_tracks;
+ g_list_foreach (applet->tracks, (GFunc) g_object_ref, NULL);
+
+ return TRUE;
+ }
+
++static void
++gnome_volume_applet_setup_timeout (GnomeVolumeApplet *applet)
++{
++ gboolean need_timeout = TRUE;
++ need_timeout = ((gst_mixer_get_mixer_flags (GST_MIXER (applet->mixer)) &
++ GST_MIXER_FLAG_AUTO_NOTIFICATIONS) == 0);
++
++ if (need_timeout) {
++ if (applet->timeout == 0) {
++ applet->timeout = g_timeout_add (100, cb_check, applet);
++ }
++ }
++ else {
++ if (applet->timeout != 0) {
++ g_source_remove (applet->timeout);
++ applet->timeout = 0;
++ }
++ }
++}
++
+ gboolean
+ gnome_volume_applet_setup (GnomeVolumeApplet *applet,
+ GList *elements)
+@@ -436,9 +466,8 @@
+ g_signal_connect (component, "ui-event", G_CALLBACK (cb_ui_event), applet);
+
+ gnome_volume_applet_refresh (applet, TRUE);
+- if (res) {
+- applet->timeout = g_timeout_add (100, cb_check, applet);
+- }
++ if (res)
++ gnome_volume_applet_setup_timeout (applet);
+
+ if (res) {
+ /* gconf */
+@@ -479,6 +508,11 @@
+ g_list_free (applet->elements);
+ applet->elements = NULL;
+ }
++ gst_bus_remove_signal_watch (applet->bus);
++ if (applet->bus) {
++ gst_object_unref (applet->bus);
++ applet->bus = NULL;
++ }
+
+ if (applet->tracks) {
+ g_list_foreach (applet->tracks, (GFunc) g_object_unref, NULL);
+@@ -1049,6 +1083,8 @@
+
+ applet->lock = FALSE;
+ applet->force_next_update = TRUE;
++
++ gnome_volume_applet_refresh (GNOME_VOLUME_APPLET (data), FALSE);
+ }
+
+ /*
+@@ -1152,6 +1188,36 @@
+ "state", mute ? "1" : "0", NULL);
+ }
+
++static void
++cb_notify_message (GstBus *bus, GstMessage *message, gpointer data)
++{
++ GnomeVolumeApplet *applet = GNOME_VOLUME_APPLET (data);
++ GstMixerMessageType type;
++ GstMixerTrack *first_track;
++ GstMixerTrack *track = NULL;
++
++ if (applet->tracks == NULL ||
++ GST_MESSAGE_SRC (message) != GST_OBJECT (applet->mixer)) {
++ /* No tracks, or not from our mixer - can't update anything anyway */
++ return;
++ }
++
++ first_track = g_list_first (applet->tracks)->data;
++
++ /* This code only calls refresh if the first_track changes, because the
++ * refresh code only retrieves the current value from that track anyway */
++ type = gst_mixer_message_get_type (message);
++ if (type == GST_MIXER_MESSAGE_MUTE_TOGGLED) {
++ gst_mixer_message_parse_mute_toggled (message, &track, NULL);
++ }
++ else {
++ gst_mixer_message_parse_volume_changed (message, &track, NULL, NULL);
++ }
++
++ if (first_track == track)
++ gnome_volume_applet_refresh (GNOME_VOLUME_APPLET (data), FALSE);
++}
++
+ static gboolean
+ cb_check (gpointer data)
+ {
+@@ -1214,6 +1280,8 @@
+ /* save */
+ gst_object_replace ((GstObject **) &applet->mixer, item->data);
+ gst_element_set_state (old_element, GST_STATE_NULL);
++
++ gnome_volume_applet_setup_timeout (applet);
+ newdevice = TRUE;
+ }
+ break;
+diff -ur gnome-applets-2.19.1/mixer/applet.h gnome-applets-2.19.1.new/mixer/applet.h
+--- gnome-applets-2.19.1/mixer/applet.h 2007-07-28 03:02:35.000000000 +0100
++++ gnome-applets-2.19.1.new/mixer/applet.h 2007-08-30 20:21:10.000000000 +0100
+@@ -71,6 +71,7 @@
+
+ /* element */
+ GstMixer *mixer;
++ GstBus *bus;
+ gboolean lock;
+ gint state;
+ GList *tracks;
Index: extra/gnome/gnome-applets/PKGBUILD
diff -u extra/gnome/gnome-applets/PKGBUILD:1.40 extra/gnome/gnome-applets/PKGBUILD:1.41
--- extra/gnome/gnome-applets/PKGBUILD:1.40 Thu Jan 10 16:34:09 2008
+++ extra/gnome/gnome-applets/PKGBUILD Mon Mar 17 14:58:52 2008
@@ -1,32 +1,34 @@
-# $Id: PKGBUILD,v 1.40 2008/01/10 21:34:09 jgc Exp $
+# $Id: PKGBUILD,v 1.41 2008/03/17 18:58:52 jgc Exp $
# Maintainer: Jan de Groot <jgc at archlinux.org>
pkgname=gnome-applets
-pkgver=2.20.1
+pkgver=2.22.0
pkgrel=1
pkgdesc="GNOME Applets"
arch=(i686 x86_64)
license=('GPL')
-depends=('gstreamer0.10-alsa' 'gnome-panel>=2.20.3' 'libgtop>=2.20.1' 'gucharmap>=1.10.2' 'libnotify>=0.4.4' 'cpufrequtils' 'libgnomekbd>=2.20.0')
-makedepends=('perlxml' 'gnome-doc-utils>=0.12.0' 'pkgconfig' 'gnome-control-center>=2.20.3')
+depends=('gstreamer0.10-alsa' 'gnome-panel>=2.22.0' 'libgtop>=2.22.0' 'gucharmap>=2.22.0' 'libnotify>=0.4.4' 'cpufrequtils' 'libgnomekbd>=2.21.4.1')
+makedepends=('perlxml' 'gnome-doc-utils>=0.12.2' 'pkgconfig' 'gnome-settings-daemon>=2.22.0')
options=(!emptydirs)
url="http://www.gnome.org"
groups=(gnome)
install=gnome-applets.install
-source=(http://ftp.gnome.org/pub/gnome/sources/${pkgname}/2.20/${pkgname}-${pkgver}.tar.bz2)
-md5sums=('e49402e7323bdd9595dc5cbfdba6ba5b')
+source=(http://ftp.gnome.org/pub/gnome/sources/${pkgname}/2.22/${pkgname}-${pkgver}.tar.bz2
+ 80_mixer_user_gstreamer_signals.patch)
+md5sums=('cd31cc9171cc350e7d0074b1a8092fbd')
build() {
cd ${startdir}/src/${pkgname}-${pkgver}
+ patch -Np1 -i ${startdir}/src/80_mixer_user_gstreamer_signals.patch || return 1
./configure --prefix=/usr --sysconfdir=/etc \
--libexecdir=/usr/lib/gnome-applets \
--localstatedir=/var --disable-static \
- --disable-scrollkeeper
+ --disable-scrollkeeper || return 1
make || return 1
make GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=1 DESTDIR=${startdir}/pkg install || return 1
rm -f ${startdir}/pkg/usr/lib/*.la
- mkdir -p ${startdir}/pkg/usr/share/gconf/schemas
- gconf-merge-schema ${startdir}/pkg/usr/share/gconf/schemas/${pkgname}.schemas ${startdir}/pkg/etc/gconf/schemas/*.schemas
+ install -m755 -d ${startdir}/pkg/usr/share/gconf/schemas
+ gconf-merge-schema ${startdir}/pkg/usr/share/gconf/schemas/${pkgname}.schemas ${startdir}/pkg/etc/gconf/schemas/*.schemas || return 1
rm -f ${startdir}/pkg/etc/gconf/schemas/*.schemas
}
Index: extra/gnome/gnome-applets/gnome-applets.install
diff -u extra/gnome/gnome-applets/gnome-applets.install:1.13 extra/gnome/gnome-applets/gnome-applets.install:1.14
--- extra/gnome/gnome-applets/gnome-applets.install:1.13 Sun Sep 23 07:21:39 2007
+++ extra/gnome/gnome-applets/gnome-applets.install Mon Mar 17 14:58:52 2008
@@ -20,8 +20,3 @@
post_remove() {
gtk-update-icon-cache -q -t -f usr/share/icons/hicolor
}
-
-op=$1
-shift
-
-$op $*
More information about the arch-commits
mailing list