Discussion:
[PATCH 1/2] pulse: set standard icon
Johannes Weißl
2011-04-19 20:37:54 UTC
Permalink
Otherwise an ugly placeholder is displayed in gnome-sound-applet
(gnome3).
---
pulse.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/pulse.c b/pulse.c
index 9a59247..ebd6c60 100644
--- a/pulse.c
+++ b/pulse.c
@@ -71,6 +71,9 @@ static pa_proplist *__create_stream_proplist(void)
rc = pa_proplist_sets(pl, PA_PROP_MEDIA_ROLE, "music");
BUG_ON(rc);

+ rc = pa_proplist_sets(pl, PA_PROP_MEDIA_ICON_NAME, "audio-x-generic");
+ BUG_ON(rc);
+
return pl;
}
--
1.7.4.4
Johannes Weißl
2011-04-19 20:37:55 UTC
Permalink
last paragraph of:
http://www.faqs.org/faqs/unix-faq/faq/part3/section-13.html

mutt also does it this way!
---
spawn.c | 22 +++++++++++++++++++---
1 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/spawn.c b/spawn.c
index 30999f6..25d4711 100644
--- a/spawn.c
+++ b/spawn.c
@@ -43,6 +43,21 @@ int spawn(char *argv[], int *status, int do_wait)
/* child */
int dev_null, err, i;

+ /* create grandchild and exit child to avoid zombie processes */
+ if (!do_wait) {
+ switch (fork()) {
+ case 0:
+ /* grandchild */
+ break;
+ case -1:
+ /* error */
+ _exit(127);
+ default:
+ /* parent of grandchild */
+ _exit(0);
+ }
+ }
+
close(err_pipe[0]);
fcntl(err_pipe[1], F_SETFD, FD_CLOEXEC);

@@ -68,15 +83,16 @@ int spawn(char *argv[], int *status, int do_wait)
exit(1);
} else {
/* parent */
- int rc, errno_save, child_errno;
+ int rc, errno_save, child_errno, tmp;

close(err_pipe[1]);
rc = read_all(err_pipe[0], &child_errno, sizeof(int));
errno_save = errno;
close(err_pipe[0]);

- if (do_wait)
- waitpid(pid, status, 0);
+ if (!do_wait)
+ status = &tmp;
+ waitpid(pid, status, 0);

if (rc == -1) {
errno = errno_save;
--
1.7.4.4
Gregory Petrosyan
2011-04-23 19:16:52 UTC
Permalink
Merged both patches to master, thanks a lot — broken PA icon has bothered me
for quite some time!

Gregory
Jason Woofenden
2011-04-23 19:38:25 UTC
Permalink
Nice work! It didn't occur to me that you could just tell PA to use
the default "audio" icon.

Works for me :)

Take care, - Jason

Loading...