After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 331826 - power-manager should only allow single-instance of preferences panel
power-manager should only allow single-instance of preferences panel
Status: RESOLVED WONTFIX
Product: gnome-power-manager
Classification: Deprecated
Component: general
SVN TRUNK
Other Linux
: Normal normal
: ---
Assigned To: GNOME Power Manager Maintainer(s)
GNOME Power Manager Maintainer(s)
: 334266 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2006-02-19 23:32 UTC by Paul Sladen
Modified: 2006-08-10 11:09 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Paul Sladen 2006-02-19 23:32:56 UTC
Copied from: https://launchpad.net/products/gnome-power/+bug/31943

Gnome-power-manager provides a central way of users configuring power-related preferences on the GNOME desktop.

Clicking on the icon in the menu-bar multiple times opens multiple dialogue boxes for the preferences panel. This should probably be restricted to a single instance , eg. following the behaviour of the GNOME network configuration panel:

 1. Show if not visible.
 2. Raise when clicked.
 3. Only allow a single instance.
 4. Dialogue can be hidden by clicking cancel.
 5. Enable the hourglass pointer to show that activity is happening (can take 3seconds + to show the dialogue).
Comment 1 Richard Hughes 2006-02-20 10:53:39 UTC
Guys, any ideas? Can we tell from g-p-m that gnome-power-preferences is launched? And raise it when clicked again?
Comment 2 Paul Sladen 2006-02-20 12:59:36 UTC
I think network-admin/monitor and the update-notifier both have similar.  (Volume doesn't, it justs launches a new copy).  D-Bus maybe another way to detect if it's running and after a click it should be possible to 'hold-off' for at least a second or so (or whatever the normal start-up is).
Comment 3 Daniel Silverstone 2006-02-20 13:35:02 UTC
Well, g-p-m itself already copes with being invoked more than once without exploding horribly

At minimum a similar mechanism could be employed for g-p-p

It shouldn't be too hard to claim an interface on the session dbus for g-p-p on startup, failure to claim results in sending some kind of poke signal at the existing one which would cause it to try and raise itself through the stack?
Comment 4 Richard Hughes 2006-02-20 13:40:55 UTC
Yes, thats completely possible. Isn't that somewhat overkill tho?

An interface could be:

org.gnome.PowerManager.ConfigGUI.poke()
org.gnome.PowerManager.ConfigGUI.exit()

Richard.
Comment 5 Paul Sladen 2006-02-20 13:45:44 UTC
It probably only requires:

  org.gnome.PowerManager.ConfigGUI.raise()

as I can't see a use-case for the exit() just yet, although it might be as well to provide it incase you want to make the icon be able to hide it too later on.
Comment 6 Jaap A. Haitsma 2006-02-21 19:51:07 UTC
All the other gnome capplets also allow more than one instance running. I feel we should come up with a general solution (maybe at a library) level which all capplets can use. 

A dbus server for each capplet that only should be only launched once seems overkill to me.

I don't really have an idea how to fix it for all applets, but for example firefox  can be set in a mode that it just opens a link in a running browser.

Maybe something to discuss on d-d-l. Fixing it only for gpm does not really make sense if you ask me.
Comment 7 Richard Hughes 2006-02-21 20:12:34 UTC
>A dbus server for each capplet that only should be only launched once seems
>overkill to me.

Agreed...

>Maybe something to discuss on d-d-l. Fixing it only for gpm does not really
>make sense if you ask me.

You want to bring it up, or shall I?

Richard.
Comment 8 Luca Cavalli 2006-02-21 21:01:30 UTC
gnomecc will probably be a better place to discuss this. Anyway, as I reported also in bug #328094, capplets are usually just an easy way to set gconf keys, and a nice way to display current gconf settings, thus it shouldn't be a problem having more than one instance running at a time, like it is not a problem having more that one gconf-editor running.
Comment 9 Richard Hughes 2006-03-11 23:16:46 UTC
*** Bug 334266 has been marked as a duplicate of this bug. ***
Comment 10 Richard Hughes 2006-04-25 10:55:46 UTC
(In reply to comment #6)
> ..All the other gnome capplets also allow more than one instance running. I feel
we should come up with a general solution (maybe at a library) level which all
capplets can use. 

Agreed.
If gnome gets a generic gnome-session type thing (like was talked about on d-d-l) then we can start using that. For now, a dbus interface is way overkill in my opinion, and I don't think we should "go it alone" with a homebrew solution.

This needs to be fixed at the gnome-session type level, rather than per-application.
Comment 11 Richard Hughes 2006-08-10 11:09:23 UTC
See http://blogs.gnome.org/view/newren/2006/08/09/1 for a future solution.