Merge lp:~azzar1/caffeine/notify into lp:caffeine

Proposed by Andrea Azzarone
Status: Rejected
Rejected by: Reuben Thomas
Proposed branch: lp:~azzar1/caffeine/notify
Merge into: lp:caffeine
Diff against target: 36 lines (+7/-7)
1 file modified
caffeine/core.py (+7/-7)
To merge this branch: bzr merge lp:~azzar1/caffeine/notify
Reviewer Review Type Date Requested Status
Reuben Thomas Pending
Review via email: mp+49630@code.launchpad.net

Description of the change

Many users complained that caffeine also disables notifications.
If we replace the freedesktop.org specific org.gnome.ScreenSaver with the freedesktop.org specific org.gnome.SessionManager we don't have this problem. I do not know if there is a special reasons for the choice of org.gnome.ScreenSaver but with this patch Caffeine works the same.

We can also add the possibility to choice between the two option: with notification, without notification.

To post a comment you must log in.
Revision history for this message
Marco Trevisan (TreviƱo) (3v1n0) wrote :

This should be totally merged.

Revision history for this message
Andrea Azzarone (azzar1) wrote :

Thanks Marco! I have also add another options in the Preferences Dialog by the witch you can choose if show or not show the notification. The option works only for GNOME for the moment. Unfortunately I do not know whether to go ahead and added support for KDE because the mainteneirs don't answer. How can i do?

Revision history for this message
Tommy Brunn (tommybrunn) wrote :

The reason why this is not implemented is because the Notify-OSD specification states that when the screensaver is inhibited, any non-critical notifications should be hidden.

Personally I feel that adding options instead of sane defaults (and in this case, I would say following the specification is the most sane option) is bad software design. That said, we used to get a fair bit of complaints regarding this. Strangely we haven't gotten any such complaints during the last few months.

I'd like input from Isaiah on this before I give you the green light to keep working on this. You should be aware, however, that the option would have to work in any environment that Caffeine currently supports (gnome screensaver, the kde screensaver that I can't remember the name of, xscreensaver and plain DPMS) in order to be merged.

Revision history for this message
Andrea Azzarone (azzar1) wrote :

Thanks for the answer!

I write this sample patch becuase a lot of users complained!

I am waiting for reply Isaiah then.

Revision history for this message
Reuben Thomas (rrt) wrote :

We're now using freedesktop.org's ScreenSaver API.

Unmerged revisions

366. By a

Many users complained that caffeine also disables notifications.
If we replace the freedesktop.org specific org.gnome.ScreenSaver
with the freedesktop.org specific org.gnome.SessionManager
we don't have this problem. I do not know if there is a special
reason for the choice of org.gnome.ScreenSaver but with this patch
Caffeine works the same.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'caffeine/core.py'
--- caffeine/core.py 2011-01-14 20:12:35 +0000
+++ caffeine/core.py 2011-02-14 14:27:36 +0000
@@ -472,7 +472,7 @@
472 After detection is complete, it will finish the inhibiting process."""472 After detection is complete, it will finish the inhibiting process."""
473 logging.info("Attempting to detect screensaver/powersaving type... (" + str(self.dbusDetectionFailures) + " dbus failures so far)")473 logging.info("Attempting to detect screensaver/powersaving type... (" + str(self.dbusDetectionFailures) + " dbus failures so far)")
474 bus = dbus.SessionBus()474 bus = dbus.SessionBus()
475 if 'org.gnome.ScreenSaver' in bus.list_names():475 if 'org.gnome.SessionManager' in bus.list_names():
476 self.screensaverAndPowersavingType = "Gnome"476 self.screensaverAndPowersavingType = "Gnome"
477 elif 'org.freedesktop.ScreenSaver' in bus.list_names() and \477 elif 'org.freedesktop.ScreenSaver' in bus.list_names() and \
478 'org.freedesktop.PowerManagement.Inhibit' in bus.list_names():478 'org.freedesktop.PowerManagement.Inhibit' in bus.list_names():
@@ -527,17 +527,17 @@
527527
528 def _toggleGnome(self):528 def _toggleGnome(self):
529 """Toggle the screensaver and powersaving with the interfaces used by Gnome."""529 """Toggle the screensaver and powersaving with the interfaces used by Gnome."""
530
531 self._toggleDPMS()530 self._toggleDPMS()
532 bus = dbus.SessionBus()531 bus = dbus.SessionBus()
533 self.ssProxy = bus.get_object('org.gnome.ScreenSaver',532 self.ssProxy = bus.get_object('org.gnome.SessionManager',
534 '/org/gnome/ScreenSaver')533 '/org/gnome/SessionManager')
534 self.ssProxy_interface = dbus.Interface(self.ssProxy, "org.gnome.SessionManager")
535 if self.sleepIsPrevented:535 if self.sleepIsPrevented:
536 if self.screenSaverCookie != None:536 if self.screenSaverCookie != None:
537 self.ssProxy.UnInhibit(self.screenSaverCookie)537 self.ssProxy_interface.Uninhibit(self.screenSaverCookie)
538 else:538 else:
539 self.screenSaverCookie = self.ssProxy.Inhibit("Caffeine",539 self.screenSaverCookie = self.ssProxy_interface.Inhibit("Caffeine", 0,
540 "User has requested that Caffeine disable the screen saver")540 "User has requested that Caffeine disable the screen saver", 8)
541541
542 def _toggleKDE(self):542 def _toggleKDE(self):
543 """Toggle the screensaver and powersaving with the interfaces used by KDE."""543 """Toggle the screensaver and powersaving with the interfaces used by KDE."""

Subscribers

People subscribed via source and target branches