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 384545 - Gnome power manager should respond differently if music is playing
Gnome power manager should respond differently if music is playing
Status: RESOLVED FIXED
Product: gnome-power-manager
Classification: Deprecated
Component: gnome-power-preferences
2.16.x
Other All
: Normal enhancement
: ---
Assigned To: GNOME Power Manager Maintainer(s)
GNOME Power Manager Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2006-12-10 22:41 UTC by Henry Gomersall
Modified: 2008-03-24 17:34 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement



Description Henry Gomersall 2006-12-10 22:41:03 UTC
It would be nice if one could set the normal mode of suspending on closing of the lid (say) but with a different response if a music player is playing (Rhythmbox, Banshee etc).

This allows for many of the modern laptops that have media buttons that are responsive and visible when the lid is closed. Just setting the screen to blank on lid close is not sufficient, as currently this causes the screen to lock and so the multimedia buttons are not responsive.
Comment 1 Richard Hughes 2006-12-10 22:52:03 UTC
Sure, I understand the use-case. Surely the correct fix would be for gnome-screensaver to somehow "whitelist" these media keys? Or maybe not to lock the screen if we are inhibited.

Actually thinking about it, that last option might be the best. If you set /apps/gnome-power-manager/lock_use_screensaver_settings to false, and also /apps/gnome-power-manager/lock_on_blank_screen to false, then shut the lid, then try to use the media buttons, do they work?

If so, we can just ignore the lock in this case for the inhibited state (which we should get when we are playing music) only when set to blank screen.

What do you think?
Comment 2 Henry Gomersall 2006-12-11 09:39:56 UTC
Yes, the buttons work when those 2 keys are unset and the lid is closed.

So presumably the media players could block the locking of the screen. It doesn't necessarily solve the problem of wanting to suspend when the lid is closed in normal use but not when the multimedia functions are required.

Is the block somehow already already enabled to stop the inactive triggers from locking the screen etc? If so, that would allow the nice feature of reverting mode if we stop the music/movie for some period of time.

Actually, that raises the other issue of handling movie players. I haven't used it, but Totem will use the buttons (albeit not especially effectively). Can external monitors be set to respond differently to screen blanks?
Comment 3 Richard Hughes 2007-01-21 21:06:03 UTC
(In reply to comment #2)
> Actually, that raises the other issue of handling movie players. I haven't used
> it, but Totem will use the buttons (albeit not especially effectively). Can
> external monitors be set to respond differently to screen blanks?

I don't know (I have a NVidia card with either the nv driver not making my external screen work, or the nvidia driver that does god knows what), maybe you could do some research on DPMS and per-head operation? I thought DPMS was system-wide, but that makes little sense with the lid and external monitor scenario.

Cheers,

Richard.
Comment 4 Mark Edgington 2007-02-28 07:11:06 UTC
It seems to me that a partial solution might be that if a certain amount of idle-time has passed (less than the suspend idle-time), a dialog appears somewhere on the screen (maybe alpha-blended) with a countdown until suspend.  Along with this countdown is a button to "Disable suspend for the remainder of this session" (or something to that effect).  Additionally, simply having a button (maybe a panel applet?) which allows one manually to temporarily disable/re-enable event-triggered suspend would be handy.  When it is in a "manually disabled" state, then pressing the power button, or closing the lid might pop-up a dialog like the one mentioned above

In the case where someone presses the power-button, or closes the lid, then (in the case where suspend is enabled by the user) just have a 15-second (or user-configurable # of secs) version of the countdown-indicator above, so that if the user didn't really mean to press the power-button, they can call-off the suspend/hibernate/whatever...  In the case where suspend is in a "manually disabled" state, then do the same (15-second countdown indicator), but prompting the user to press the button a second time, or to click a button in order to really suspend.

Secondly, maybe a tab in the gnome-power-manager that shows all of the programs which have, in the past, suppressed suspension/etc.  The user can select any of these listed programs, and click on the "Ignore" or "Un-ignore" buttons, which determines if the program will be paid attention to if it requests a suspend-override.  Also, the default policy to prompt-for-decision / ignore-all / listen-to-all new programs which want to influence power-management behavior can be selected there.
Comment 5 Richard Hughes 2007-07-04 13:55:47 UTC
All the music play has to do is call an inhibit on gnome-power-manager and now the lid action will be changed from suspend or hibernate to blank screen. There's also a warning in this case, as some laptops get very hot when they are on and th elid is down.

You can see more details in this commit:

2007-06-29  Richard Hughes  <richard@hughsie.com>

	* data/gnome-power-manager.schemas.in:
	* src/gpm-conf.h:
	* src/gpm-inhibit.c: (gpm_inhibit_inhibit),
	(gpm_inhibit_un_inhibit):
	* src/gpm-manager.c: (manager_policy_do), (has_inhibit_changed_cb),
	(gpm_manager_init):
	* src/gpm-notify.c: (gpm_notify_inhibit_lid):
	* src/gpm-notify.h:
	* src/gpm-stock-icons.h:
	Add functionality so that g-p-m warns the user when manually inhibited
	and the lid action on battery is suspend or hibernate. Fixes #452244