GNOME Bugzilla – Bug 691976
PointerWatcher: keep a reference to the idle monitor
Last modified: 2013-01-18 20:14:54 UTC
As the description says, has the important side effect of fixing "stuck" notifications (due to idle monitor not firing)
Created attachment 233696 [details] [review] PointerWatcher: keep a reference to the idle monitor If nothing references the idle monitor, it can be finalized at GC, causing it to have no effect. Worse, if the finalization happens at wrong time, the pointer watcher can be permanently off, disabling the message tray. Also, the pointer watcher has the useful side effect of creating a PositiveTransition XSync alarm for 1 second of idleness, which is necessary for the idle monitor in message tray to work correctly (XSync NegativeTransition events are only emitted after a positive transition for some other alarm)
(In reply to comment #1) > Also, the pointer watcher has the useful side effect of creating > a PositiveTransition XSync alarm for 1 second of idleness, which is > necessary for the idle monitor in message tray to work correctly > (XSync NegativeTransition events are only emitted after a positive > transition for some other alarm) Wait, so you're saying that having two idle monitors could potentially gobble each other's events up?
(In reply to comment #2) > > Wait, so you're saying that having two idle monitors could potentially gobble > each other's events up? No, I'm saying that you need to fire a PositiveTransition before NegativeTransition XSync alarms are even considered. MessageTray's IdleMonitor doesn't install watches, so it relies on someone else to create a PositiveTransition alarm that fires "often enough" to unblock its NegativeTransition. Normally, that one is the PointerWatcher's IdleMonitor, but if that's finalized GnomeIdleMonitor::became-active won't fire until some other alarm is triggered (usually, gnome-settings-daemon's idle-dim timeout)
To clarify, two idle monitors can't gobble each other, but they can make each other fire more events than they would alone.
If anybody else is curious, this is the same bug as #688227.
Review of attachment 233696 [details] [review]: With the commit message modified, this could work.
Attachment 233696 [details] pushed as 56d7679 - PointerWatcher: keep a reference to the idle monitor