Red Hat Bugzilla – Bug 39208
Magicdev starts excessive applications
Last modified: 2007-04-18 12:33:04 EDT
If the panel cd-rom player is running or an existing gtcd then magicdev
really should avoid starting another CD-ROM application.
This behavior is, I believe, already implemented for gtcd.
Doing it for the panel applet would be harder; IMO, people
who add the panel applet probably can just disable it from
the control center. To catch the panel applet being there
automatically would be a nice touch, but probably more
trouble to implement than it's worth.
(Trouble is, you have to deal with things like starting gtcd,
then the applet, then closing gtcd. So, the standard
unique CORBA server approach doesn't work.)
We lost the gtcd "unique application" patches with the transition
to gnome2, so now we start multiple gnome-cd's as well. (Bug 72377)
*** Bug 72377 has been marked as a duplicate of this bug. ***
This code should wrap the cd player and fix the problem nicely
Created attachment 72625 [details]
C wrapper for reliable once only unless on error
Hmmm, make some sense, but also seems to have some issues:
- Since it locks in the user's home directory, it won't
handle multiple logins on different machines?
- It doesn't behave that well for multiple login sessions
on the same machine, though that's somewhat esoteric
- It doesn't scale to handling the "cd-player-on-the-panel"
Since I know Xlib and GTK+ better than I know file locking,
and I think the semantic that is desired is "one CD player
per X display", I decided to go with an X selection based
Right now what happens is that there is an X selection
_REDHAT_CD_PLAYER. When a CD player app/applet starts
it sees if there is an existing owner, if not, it claims
the selection. When the current selection owner goes
away, if there are other cd applets/apps running, one
of them takes over ownership of the selection.
THis isn't quite perfect ... it should be
Or maybe even:
But it's close enough for now.
Have the necessary bits in them. Once those build, I'll do
a magicdev that starts 'gnome-cd --unique --play' as the
Nice - yes much better for the X solution
Seems to work nicely even with multiple CD players now.