Merge lp://staging/~hypodermia/ubuntu/oneiric/compiz/fix-for-bug-301174 into lp://staging/ubuntu/oneiric/compiz

Proposed by Emily Strickland
Status: Work in progress
Proposed branch: lp://staging/~hypodermia/ubuntu/oneiric/compiz/fix-for-bug-301174
Merge into: lp://staging/ubuntu/oneiric/compiz
Diff against target: 204 lines (+183/-0)
4 files modified
plugins/bell/CMakeLists.txt (+5/-0)
plugins/bell/bell.xml.in (+21/-0)
plugins/bell/src/bell.cpp (+103/-0)
plugins/bell/src/bell.h (+54/-0)
To merge this branch: bzr merge lp://staging/~hypodermia/ubuntu/oneiric/compiz/fix-for-bug-301174
Reviewer Review Type Date Requested Status
Sam Spilsbury (community) Approve
compiz packagers Pending
Ubuntu branches Pending
Review via email: mp+64632@code.staging.launchpad.net

Description of the change

This branch creates a new plugin which uses libcanberra to play an audible bell when the system bell action event is triggered, along with a small typo fix incorporated to make sure that action actually happens. For the typo fix to compiz core, see this commit log entry: http://cgit.compiz.org/compiz/core/commit/?id=e6afcfd735db5a9f507fb9cd810bdb139ab8480f

The original source code can be found in my Github repository here, along with smspillaz' merged changes: https://github.com/hypodermia/compiz-bell-plugin

This should fix this bug: https://bugs.launchpad.net/ubuntu/+source/compiz/+bug/301174

As well as this bug: https://bugs.launchpad.net/ubuntu/+source/unity/+bug/769314

To test this, build and install this plugin, install fixed compiz, replace compiz, load the plugin, and then run this to trigger the bell: echo -n -e "\a"

Should cause a mild bell sound, provided the alert sounds in sound preferences are turned on and up and the sound file exists (configurable).

Adds a dependency on libcanberra. May require one further small change to make sure CMake finds and builds it, and may also add one dependency to ensure the default sound file is actually present on the system.

To post a comment you must log in.
Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

Thanks for this patch and help to make ubuntu better.

The review should be done by smspillaz, Sam can you have a look please?

Revision history for this message
Sam Spilsbury (smspillaz) wrote :

Approve +1

We discussed having this a long time ago but never actually got around to implementing it. Thanks.

review: Approve
Revision history for this message
Sam Spilsbury (smspillaz) wrote :

Oh, one thing, could you retarget this against lp:compiz-core ?

Revision history for this message
Chris Halse Rogers (raof) wrote :

I'm not a compiz dev, so my input may be overruled by someone who is, but I think this should use a named event sound rather than manually specifying a filename - that way, (a) depending on sound-theme-freedesktop (which libcanberra does) guarantees that the sound file exists, and (b) allows the sound-theme to be configured in the “Sound” capplet, with the rest of the sounds.

http://0pointer.de/public/sound-naming-spec.html suggests “bell-window-system” (which should fallback to “bell” in the freedesktop theme) would be the right choice.

This looks like it should go upstream first - Sam, do you have any comments on this?

Revision history for this message
Chris Halse Rogers (raof) wrote :

Discussion with Sam in #ayatana:

16:07 <RAOF> It should use an event sound from http://0pointer.de/public/sound-naming-spec.html rather than manually specifying a filename. That way, sound themes will actually work.
16:07 <RAOF> Also, it becomes simpler. Bonus!
16:07 <RAOF> (I'd suggest bell-window-system)
16:10 <RAOF> Ah. Alternatively, that spec could be a pack of lies, and there not actually _be_ a bell-window-system. Superlative. There is, however, a bell. So the not-manually-specifying-a-filename thing stands.
16:17 <RAOF> Ah, again no. bell-window-system should alledgedly fall back to just “bell”
16:18 <RAOF> smspillaz: Anyway, the summary is: don't specify a filename, so that it respects the system sound theme :)
16:19 <smspillaz> RAOF: ah, ok
16:19 <RAOF> Note: this advice may need actual, you know, _testing_
16:19 <smspillaz> that doesn't exist in compizland
16:19 <RAOF> But if everything works as advertised, that's what should happen!
16:21 <smspillaz> RAOF: so we need to specify bell-window-system
16:21 <smspillaz> and instead of CA_PROP_MEDIA_FILENAME ...
16:21 <RAOF> Right.
16:22 <RAOF> And instead of CA_PROP_MEDIA_FILENAME, you *don't* specify CA_PROP_MEDIA_FILENAME, and libcanberra looks it up in the sound theme.
16:22 <smspillaz> I hope canberra uses gtkdoc ...
16:22 <RAOF> Why, yes it does.
16:22 <RAOF> http://0pointer.de/lennart/projects/libcanberra/gtkdoc/libcanberra-canberra.html#CA-PROP-EVENT-ID:CAPS
16:22 <smspillaz> oh I see
16:23 <smspillaz> I think that the filename is actually inteded to be an override
16:23 <smspillaz> so I might just check for filename size
16:24 <RAOF> Is there a desperate need for compiz's sounds to be configured differently to the sound theme?
16:25 <RAOF> Hm. Actually, the gtkdoc doesn't make it clear whether or CA_PROP_EVENT_ID *overrides* CA_PROP_MEDIA_FILENAME…
16:26 <RAOF> I guess empirical testing may be in order. Worse than a superfluous configuration option is a superfluous configuration option that *doesn't even work* :)
16:28 <RAOF> smspillaz: So, it's possible my concern is actually ‘the option to set the bell sound filename doesn't work’ :)
16:30 <RAOF> Either it works, and compiz won't follow the sound theme, or it doesn't, and compiz gains a non-functional option. Score!
16:32 <smspillaz> RAOF: we just don't se CA_PROP_MEDIA_FILENAME if mFilename is empty
16:33 <RAOF> smspillaz: And you may need to *not* set CA_PROP_EVENT_ID if mFilename is not empty. http://0pointer.de/lennart/projects/libcanberra/gtkdoc/libcanberra-canberra.html#ca-context-play suggests that it'll override MEDIA_FILENAME.
16:34 <RAOF> But relying on this crazy documentation thing is probably a bit ambitious. There should be actual testing to confirm that libcanberra works that way.
16:35 <RAOF> And I suspect that this testing could be asked of our intrepid branch submitterc.
16:36 <RAOF> Shall I paste this IRC snippet in as a review comment?
16:37 <smspillaz> sure
16:37 <smspillaz> I'll probably just fix it myself though

So - feel free to either resolve my concerns there, or wait for Sam to fix it!

Revision history for this message
Emily Strickland (hypodermia) wrote :

Finally got a chance to look at this.

The documentation was ambiguous when I originally made the plugin, so as
suggested here, I decided simply to test out all the options. I can confirm
that if you set CA_PROP_EVENT_ID as "bell" and don't specify a file name
that it uses the correct bell sound. Furthermore, 'bell-window-system'
actually doesn't work. Since 'bell' itself does, there's no need to specify
the file name, as far as I can tell (it seemed to be overriding the
CA_PROP_EVENT_ID setting).

I'm making the change and pushing it with the filename business entirely
removed.

On Mon, Aug 1, 2011 at 23:44, Chris Halse Rogers <email address hidden> wrote:

> The proposal to merge
> lp:~hypodermia/ubuntu/oneiric/compiz/fix-for-bug-301174 into
> lp:ubuntu/compiz has been updated.
>
> Status: Needs review => Work in progress
>
> For more details, see:
>
> https://code.launchpad.net/~hypodermia/ubuntu/oneiric/compiz/fix-for-bug-301174/+merge/64632
> --
>
> https://code.launchpad.net/~hypodermia/ubuntu/oneiric/compiz/fix-for-bug-301174/+merge/64632
> You are the owner of
> lp:~hypodermia/ubuntu/oneiric/compiz/fix-for-bug-301174.
>

--
Emily Strickland
<email address hidden>
706-363-0950

233. By Emily Strickland

Removed option to specify the file name. Should follow user's sound scheme.

Revision history for this message
Emily Strickland (hypodermia) wrote :

Actually, this appears to break on my system. I must've had the old bell file cached for that event. I don't see how to make this work as it's documented to supposed to work. We may need to roll back this latest change and, as RAOF said, go with the option where "it works, and compiz won't follow the sound theme".

Libcanberra bug?

Unmerged revisions

233. By Emily Strickland

Removed option to specify the file name. Should follow user's sound scheme.

232. By Emily Strickland

Add 'bell' plugin and a small fix to bcop.xslt to properly trigger bell events (see http://cgit.compiz.org/compiz/core/commit/?id=e6afcfd735db5a9f507fb9cd810bdb139ab8480f); fixes https://bugs.launchpad.net/ubuntu/+source/compiz/+bug/301174 and https://bugs.launchpad.net/ubuntu/+source/unity/+bug/769314

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches