diff options
author | Tanu Kaskinen <tanuk@iki.fi> | 2016-11-10 13:22:04 +0200 |
---|---|---|
committer | Tanu Kaskinen <tanuk@iki.fi> | 2017-01-19 03:00:45 +0200 |
commit | f790925c7b3767002afa33a0e63fb049c3d93da2 (patch) | |
tree | d9e83aa8fafa92a5118bdf677767fb862d93fe61 /src/modules/x11/module-x11-bell.c | |
parent | 8405b1fb7f03ca11512321df1e9ed8fc806dc662 (diff) | |
download | pulseaudio-f790925c7b3767002afa33a0e63fb049c3d93da2.tar.gz |
x11-bell: ignore volume from X11
X11 has its own bell volume setting, controlled with the "xset b"
command. If we use that volume, then the "System Sounds" slider in
pavucontrol doesn't affect the x11-bell sample volume, which in my
opinion is a bad thing. Ignoring the volume suggestion from X11 allows
module-stream-restore to apply the "event" role volume.
Diffstat (limited to 'src/modules/x11/module-x11-bell.c')
-rw-r--r-- | src/modules/x11/module-x11-bell.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/modules/x11/module-x11-bell.c b/src/modules/x11/module-x11-bell.c index 6c9f580f5..7b2be57bf 100644 --- a/src/modules/x11/module-x11-bell.c +++ b/src/modules/x11/module-x11-bell.c @@ -76,7 +76,10 @@ static int x11_event_cb(pa_x11_wrapper *w, XEvent *e, void *userdata) { bne = (XkbBellNotifyEvent*) e; - if (pa_scache_play_item_by_name(u->core, u->scache_item, u->sink_name, ((pa_volume_t) bne->percent*PA_VOLUME_NORM)/100U, NULL, NULL) < 0) { + /* We could use bne->percent to set the volume, but then the "event" role + * volume wouldn't have effect. It's better to ignore the volume suggestion + * from X11. */ + if (pa_scache_play_item_by_name(u->core, u->scache_item, u->sink_name, PA_VOLUME_INVALID, NULL, NULL) < 0) { pa_log_info("Ringing bell failed, reverting to X11 device bell."); XkbForceDeviceBell(pa_x11_wrapper_get_display(w), bne->device, bne->bell_class, bne->bell_id, bne->percent); } |