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 332576 - screensaver activates too early after wake-up from sleeping
screensaver activates too early after wake-up from sleeping
Status: RESOLVED FIXED
Product: gnome-screensaver
Classification: Deprecated
Component: daemon
CVS HEAD
Other All
: Normal normal
: ---
Assigned To: gnome-screensaver maintainers
gnome-screensaver maintainers
Depends on:
Blocks:
 
 
Reported: 2006-02-25 21:56 UTC by Byeong-taek Lee
Modified: 2006-04-05 02:45 UTC
See Also:
GNOME target: ---
GNOME version: 2.11/2.12


Attachments
comment out only two lines (876 bytes, patch)
2006-03-15 08:51 UTC, Byeong-taek Lee
none Details | Review
screensaver debug message (51.62 KB, text/plain)
2006-03-31 23:05 UTC, Byeong-taek Lee
  Details
reset emergency_lock variable (471 bytes, patch)
2006-04-04 05:12 UTC, Ray Strode [halfline]
none Details | Review

Description Byeong-taek Lee 2006-02-25 21:56:57 UTC
Please describe the problem:
After launching, it works fine.
But after the laptop sleep and then wake up, screensaver works abnormally.
Specifically, it activates too early.
Even when i am typing some letters or moving mouse pointer, it activates.
Once this problem occurs, the solution is just `killall gnome-screensaver &&
gnome-screensaver'.


Steps to reproduce:
1. sleep laptop
2. wake up laptop
3. 


Actual results:
sometimes screensaver activates too early

Expected results:
screensaver should wait a given time to activate

Does this happen every time?
almost always
if sleep time is too short (about 1-2 min),it seems not to happen.

Other information:
Here is my debug information from gnome-screensaver --no-daemon --debug


[_gs_watcher_notice_activity] gs-watcher-x11.c:565 (13:45:33):   Activity
detected: resetting timers
[remove_idle_timer] gs-watcher-x11.c:461 (13:45:33):     killing idle_timer 
(300000, 176)
[add_idle_timer] gs-watcher-x11.c:474 (13:45:33):        starting idle_timer
(290000, 177)
[_gs_watcher_check_pointer_position] gs-watcher-x11.c:1389 (13:45:33):   Idle 0
seconds
[check_for_clock_skew] gs-watcher-x11.c:1308 (13:45:33):         checking wall
clock for hibernation, changed: 0:00:02
[_gs_watcher_notice_window_created] gs-watcher-x11.c:586 (13:45:33):     Window
created: noticing activity on 0xE49B2A
[_gs_watcher_check_pointer_position] gs-watcher-x11.c:1389 (13:45:35):   Idle 2
seconds
[check_for_clock_skew] gs-watcher-x11.c:1308 (13:45:35):         checking wall
clock for hibernation, changed: 0:00:02
[_gs_watcher_check_pointer_position] gs-watcher-x11.c:1389 (13:45:37):   Idle 4
seconds
[check_for_clock_skew] gs-watcher-x11.c:1308 (13:45:37):         checking wall
clock for hibernation, changed: 0:00:02
[_gs_watcher_check_pointer_position] gs-watcher-x11.c:1389 (13:45:39):   Idle 6
seconds
[check_for_clock_skew] gs-watcher-x11.c:1308 (13:45:39):         checking wall
clock for hibernation, changed: 0:00:02
[_gs_watcher_check_pointer_position] gs-watcher-x11.c:1389 (13:45:41):   Idle 8
seconds
[check_for_clock_skew] gs-watcher-x11.c:1308 (13:45:41):         checking wall
clock for hibernation, changed: 0:00:02
[_gs_watcher_check_pointer_position] gs-watcher-x11.c:1389 (13:45:43):   Idle 10
seconds
[check_for_clock_skew] gs-watcher-x11.c:1308 (13:45:43):         checking wall
clock for hibernation, changed: 0:00:02
[_gs_watcher_check_pointer_position] gs-watcher-x11.c:1389 (13:45:45):   Idle 12
seconds
[check_for_clock_skew] gs-watcher-x11.c:1308 (13:45:45):         checking wall
clock for hibernation, changed: 0:00:02
[_gs_watcher_check_pointer_position] gs-watcher-x11.c:1389 (13:45:47):   Idle 14
seconds
[check_for_clock_skew] gs-watcher-x11.c:1308 (13:45:47):         checking wall
clock for hibernation, changed: 0:00:02
[_gs_watcher_check_pointer_position] gs-watcher-x11.c:1389 (13:45:49):   Idle 16
seconds
[check_for_clock_skew] gs-watcher-x11.c:1308 (13:45:49):         checking wall
clock for hibernation, changed: 0:00:02
[idle_timer] gs-watcher-x11.c:1239 (13:45:51):   in idle timer
[_gs_watcher_check_pointer_position] gs-watcher-x11.c:1389 (13:45:51):   Idle 18
seconds
[check_for_clock_skew] gs-watcher-x11.c:1308 (13:45:51):         checking wall
clock for hibernation, changed: 0:00:02
[watcher_idle_cb] gs-monitor.c:110 (13:45:51):   Idle signal detected: 1
[gs_listener_set_session_idle] gs-listener-dbus.c:364 (13:45:51):        Setting
session idle: 1
[listener_check_activation] gs-listener-dbus.c:257 (13:45:51):   Checking for
activation
[listener_check_activation] gs-listener-dbus.c:272 (13:45:51):   Trying to activate
[gs_grab_get_keyboard] gs-grab-x11.c:166 (13:45:51):     Grabbing keyboard widget=3F
[gs_grab_get_mouse] gs-grab-x11.c:192 (13:45:51):        Grabbing mouse widget=3F
[gs_fade_set_active] gs-fade.c:500 (13:45:51):   Setting fade: ON
[_gs_watcher_check_pointer_position] gs-watcher-x11.c:1389 (13:45:51):   Idle 18
seconds
[check_for_clock_skew] gs-watcher-x11.c:1308 (13:45:51):         checking wall
clock for hibernation, changed: 0:00:00
[gs_fade_set_active] gs-fade.c:500 (13:45:52):   Setting fade: OFF
[window_map_cb] gs-manager.c:906 (13:45:52):     Handling window map event
[gs_window_clear] gs-window-x11.c:220 (13:45:52):        Clearing window
[clear_all_children] gs-window-x11.c:201 (13:45:52):     Clearing all child windows
[window_show_cb] gs-manager.c:959 (13:45:52):    Handling window show
[gs_watcher_set_active] gs-watcher-x11.c:764 (13:45:53):         turning
watcher: OFF
[_gs_watcher_set_active_internal] gs-watcher-x11.c:747 (13:45:53):      
Stopping idle watcher
[_gs_watcher_set_session_idle] gs-watcher-x11.c:546 (13:45:53):  Changing idle
state: 1
[gs_window_xevent] gs-window-x11.c:439 (13:45:53):       not raising our
windows[window_map_event_cb] gs-manager.c:893 (13:45:53):       Handling window
map_event event
[xorg_lock_smasher_set_active] gs-grab-x11.c:109 (13:45:53):     Disabling the
x.org grab smasher
[xorg_lock_smasher_set_active] gs-grab-x11.c:128 (13:45:53):    
XF86MiscSetGrabKeysState(off) returned MiscExtGrabStateSuccess

[gs_grab_move_keyboard] gs-grab-x11.c:328 (13:45:53):    Moving keyboard grab
from 3F to 1600144
[gs_grab_move_keyboard] gs-grab-x11.c:335 (13:45:53):    *** doing X server
grab[gs_grab_release_keyboard] gs-grab-x11.c:218 (13:45:53):         Ungrabbing
keyboard
[gs_grab_get_keyboard] gs-grab-x11.c:166 (13:45:53):     Grabbing keyboard
widget=1600144
[gs_grab_move_keyboard] gs-grab-x11.c:357 (13:45:53):    *** releasing X server grab
[gs_grab_move_mouse] gs-grab-x11.c:274 (13:45:53):       Moving pointer grab
from 3F to 1600144
[gs_grab_move_mouse] gs-grab-x11.c:281 (13:45:53):       *** doing X server
grab[gs_grab_release_mouse] gs-grab-x11.c:236 (13:45:53):    Ungrabbing pointer
[gs_grab_get_mouse] gs-grab-x11.c:192 (13:45:53):        Grabbing mouse
widget=1600144
[gs_grab_move_mouse] gs-grab-x11.c:304 (13:45:53):       *** releasing X server grab
[nice_process] gs-job.c:552 (13:45:53):  Setting child process priority to: 10
[gs_window_xevent] gs-window-x11.c:439 (13:45:53):       not raising our
windows[window_map_event_cb] gs-manager.c:893 (13:45:53):       Handling window
map_event event
[xorg_lock_smasher_set_active] gs-grab-x11.c:109 (13:45:53):     Disabling the
x.org grab smasher
[xorg_lock_smasher_set_active] gs-grab-x11.c:128 (13:45:53):    
XF86MiscSetGrabKeysState(off) returned MiscExtGrabStateAlready

[gs_grab_move_keyboard] gs-grab-x11.c:321 (13:45:53):    Window 1600144 is
already grabbed, skipping
[gs_grab_move_mouse] gs-grab-x11.c:262 (13:45:53):       Window 1600144 is
already grabbed, skipping

(gnome-screensaver:32611): gnome-screensaver-WARNING **: Cannot restart active job.
[gs_window_xevent] gs-window-x11.c:451 (13:45:53):       not raising our
windows[gs_window_xevent] gs-window-x11.c:451 (13:45:53):       not raising our
windows[gs_window_request_unlock] gs-window-x11.c:994 (13:45:55):      
Requesting unlock
[gs_grab_release_keyboard_and_mouse] gs-grab-x11.c:384 (13:45:55):      
Releasing all grabs
[gs_grab_release_mouse] gs-grab-x11.c:236 (13:45:55):    Ungrabbing pointer
[gs_grab_release_keyboard] gs-grab-x11.c:218 (13:45:55):         Ungrabbing keyboard
[xorg_lock_smasher_set_active] gs-grab-x11.c:107 (13:45:55):     Enabling the
x.org grab smasher
[xorg_lock_smasher_set_active] gs-grab-x11.c:128 (13:45:55):    
XF86MiscSetGrabKeysState(on) returned MiscExtGrabStateSuccess

[window_unmap_cb] gs-manager.c:913 (13:45:55):   window unmapped!
[gs_window_dialog_finish] gs-window-x11.c:790 (13:45:55):        Dialog
finished[gs_watcher_set_active] gs-watcher-x11.c:764 (13:45:55):         turning
watcher: ON
[_gs_watcher_notice_activity] gs-watcher-x11.c:565 (13:45:55):   Activity
detected: resetting timers
[watcher_idle_cb] gs-monitor.c:110 (13:45:55):   Idle signal detected: 0
[gs_listener_set_session_idle] gs-listener-dbus.c:364 (13:45:55):        Setting
session idle: 0
[listener_check_activation] gs-listener-dbus.c:257 (13:45:55):   Checking for
activation
[_gs_watcher_set_session_idle] gs-watcher-x11.c:546 (13:45:55):  Changing idle
state: 0
[add_idle_timer] gs-watcher-x11.c:474 (13:45:55):        starting idle_timer
(290000, 188)
[_gs_watcher_check_pointer_position] gs-watcher-x11.c:1389 (13:45:55):   Idle 0
seconds
[check_for_clock_skew] gs-watcher-x11.c:1308 (13:45:55):         checking wall
clock for hibernation, changed: 0:00:00
[_gs_watcher_set_active_internal] gs-watcher-x11.c:751 (13:45:55):      
Starting idle watcher
[_gs_watcher_notice_activity] gs-watcher-x11.c:565 (13:45:57):   Activity
detected: resetting timers
[remove_idle_timer] gs-watcher-x11.c:461 (13:45:57):     killing idle_timer 
(300000, 188)
[add_idle_timer] gs-watcher-x11.c:474 (13:45:57):        starting idle_timer
(290000, 190)

btlee@southstar ~ $
Comment 1 Anatol Ulrich 2006-03-04 16:49:38 UTC
This happens here too (2.13.92 on ubuntu dapper)
Comment 2 Rui Matos 2006-03-13 19:55:19 UTC
Doesn't the following change fix this?

2006-03-03  William Jon McCann  <mccann@jhu.edu>

	* src/test-watcher.c (connect_watcher_signals, watcher_idle_cb):
	Use correct signal.
Comment 3 Byeong-taek Lee 2006-03-13 20:09:01 UTC
The symptom depends on architecture.
Specifically, on x86, screensaver does not work any more after wake up but gnome-screensaver still resides in memory.
In the other hands, on ppc, the symptom (too early actiates) still replicates.
on x86, hal-0.5.7, dbus-0.61, last cvs snapshop of gnome-power-manager are installed.
on ppc, hal-0.5.6 is installed with the same other packages.
Comment 4 William Jon McCann 2006-03-13 20:22:04 UTC
Rui: no it isn't related.

Unfortunately, I'm not able to reproduce this since I don't have hibernate or suspend working on my systems.
Comment 5 William Jon McCann 2006-03-14 17:04:33 UTC
I finally got a system with a working suspend (FC5).  However, I still can't reproduce the problem.
Comment 6 William Jon McCann 2006-03-14 19:56:21 UTC
OK, I'm going to refocus this bug on the doesn't activate on idle part.

I've reproduced this with FC5.

Looks like g-p-m is inhibiting the idle erroneously.

[gs_listener_set_session_idle] gs-listener-dbus.c:364 (13:05:52):        Setting session idle: 1
[list_inhibitors] gs-listener-dbus.c:229 (13:05:52):     Inhibited by bus :1.0 for reason: gnome-power-manager has detected that the lid is closed
Comment 7 William Jon McCann 2006-03-14 19:57:35 UTC
Richard, this was with g-p-m 2.13.93-4 
Comment 8 William Jon McCann 2006-03-14 20:01:13 UTC
Why are you inhibiting idle?
Comment 9 Richard Hughes 2006-03-14 20:07:28 UTC
2006-03-02  Richard Hughes  <richard@hughsie.com>

	* src/gpm-screensaver.{c|h}: Add the functions:
	gpm_screensaver_inhibit_activation() and
	gpm_screensaver_allow_activation ().

	* src/gpm-manager.c (lid_button_pressed): Inhibit activation of the
	screensaver when the lid is closed, and allow activation when the
	lid is opened. This prevents the screensaver starting when the panel
	is closed, and the action is to turn off the screen or do nothing.
Comment 10 William Jon McCann 2006-03-14 20:08:55 UTC
Yeah, I read that.  It doesn't make any sense to me.
Comment 11 Richard Hughes 2006-03-14 20:19:17 UTC
Ohh, sorry.

Basically, I got a bugzilla, where the user had specified *not* to suspend or hibernate when the lid was shut. But as the g-s idle timer was still going, the screensaver energised, and the nice openGL screensaver quickly depleted the battery, even with the lid shut. I figured "inhibiting" the screensaver when the lid was closed was the correct thing to do.
Comment 12 William Jon McCann 2006-03-14 20:22:47 UTC
Throttling is the correct thing to do.  That will allow the system to enter the idle state and screensaver to activate but it will only use a blank screen - no themes.
Comment 13 Richard Hughes 2006-03-14 20:31:09 UTC
Ohh, yes, of course that's right. I can patch g-p-m tomorrow, or you can do it now if you want.
Comment 14 Byeong-taek Lee 2006-03-15 08:51:27 UTC
Created attachment 61269 [details] [review]
comment out only two lines
Comment 15 Richard Hughes 2006-03-15 10:36:05 UTC
Does that fix the bug you are experiencing?
Comment 16 Byeong-taek Lee 2006-03-17 07:22:04 UTC
no, that does not fix the problem.
Comment 17 Richard Hughes 2006-03-17 16:26:37 UTC
Can you try with g-p-m 2.14.0 please, I think your problem might have been fixed now we poke g-s on hardware events.
Comment 18 Byeong-taek Lee 2006-03-17 19:50:39 UTC
I'm already using g-p-m 2.14.0, but the problem persists.
Comment 19 Richard Hughes 2006-03-22 11:36:48 UTC
2006-03-22  Richard Hughes  <richard@hughsie.com>
 * src/gpm-manager.c, src/gpm-screensaver.{c|h}: Don't inhibit, just throttle. Pointed out in #332576.
Comment 20 William Jon McCann 2006-03-22 17:37:30 UTC
OK, I'll move it back to g-s since this may not be related to the inhibit bug.
Comment 21 William Jon McCann 2006-03-22 17:41:16 UTC
I can't reproduce this even on FC5 when doing a suspend.  Whoever sees this problem please run:

gnome-screensaver --debug --no-daemon

and do a suspend, resume, and watch the output of the above command while you are typing in another window or using your mouse.  You should see output like:
"Activity detected: resetting timers"

Please let me know.  Thanks.
Comment 22 Byeong-taek Lee 2006-03-22 23:07:24 UTC
Well,
As you said, When I resume my laptop, I looked at the message as following.

[_gs_watcher_notice_activity] gs-watcher-x11.c:565 (14:59:13):   Activity detect
ed: resetting timers
[remove_idle_timer] gs-watcher-x11.c:461 (14:59:13):     killing idle_timer  (30
0000, 948)
[add_idle_timer] gs-watcher-x11.c:474 (14:59:13):        starting idle_timer (29
0000, 949)
[_gs_watcher_check_pointer_position] gs-watcher-x11.c:1389 (14:59:13):   Idle 0 
seconds
[check_for_clock_skew] gs-watcher-x11.c:1308 (14:59:13):         checking wall c
lock for hibernation, changed: 0:00:02
[_gs_watcher_notice_window_created] gs-watcher-x11.c:586 (14:59:15):     Window 
created: noticing activity on 0xC02FBE



But, the problem will not stop.
Look at the following messages.

[_gs_watcher_check_pointer_position] gs-watcher-x11.c:1389 (15:00:19):   Idle 64
 seconds
[check_for_clock_skew] gs-watcher-x11.c:1308 (15:00:19):         checking wall c
lock for hibernation, changed: 0:00:02
[idle_timer] gs-watcher-x11.c:1239 (15:00:21):   in idle timer
[_gs_watcher_check_pointer_position] gs-watcher-x11.c:1389 (15:00:21):   Idle 66
 seconds
[check_for_clock_skew] gs-watcher-x11.c:1308 (15:00:21):         checking wall c
lock for hibernation, changed: 0:00:02
[watcher_idle_cb] gs-monitor.c:110 (15:00:21):   Idle signal detected: 1
[gs_listener_set_session_idle] gs-listener-dbus.c:364 (15:00:21):        Setting
 session idle: 1
[listener_check_activation] gs-listener-dbus.c:257 (15:00:21):   Checking for ac
tivation
[listener_check_activation] gs-listener-dbus.c:272 (15:00:21):   Trying to activ
ate
[gs_grab_get_keyboard] gs-grab-x11.c:166 (15:00:21):     Grabbing keyboard widge
t=4D
[gs_grab_get_mouse] gs-grab-x11.c:192 (15:00:21):        Grabbing mouse widget=4
D
[gs_fade_set_active] gs-fade.c:500 (15:00:21):   Setting fade: ON
[_gs_watcher_check_pointer_position] gs-watcher-x11.c:1389 (15:00:21):   Idle 66
 seconds
[check_for_clock_skew] gs-watcher-x11.c:1308 (15:00:21):         checking wall c
lock for hibernation, changed: 0:00:00
[gs_fade_set_active] gs-fade.c:500 (15:00:22):   Setting fade: OFF
[window_map_cb] gs-manager.c:906 (15:00:22):     Handling window map event
[gs_window_clear] gs-window-x11.c:220 (15:00:22):        Clearing window
[clear_all_children] gs-window-x11.c:201 (15:00:22):     Clearing all child wind
ows
[window_show_cb] gs-manager.c:959 (15:00:22):    Handling window show
[gs_watcher_set_active] gs-watcher-x11.c:764 (15:00:23):         turning watcher
: OFF
[_gs_watcher_set_active_internal] gs-watcher-x11.c:747 (15:00:23):       Stoppin
g idle watcher
[_gs_watcher_set_session_idle] gs-watcher-x11.c:546 (15:00:23):  Changing idle s
tate: 1
[gs_window_xevent] gs-window-x11.c:439 (15:00:23):       not raising our windows
[window_map_event_cb] gs-manager.c:893 (15:00:23):       Handling window map_eve
nt event
[xorg_lock_smasher_set_active] gs-grab-x11.c:109 (15:00:23):     Disabling the x
.org grab smasher
[xorg_lock_smasher_set_active] gs-grab-x11.c:128 (15:00:23):     XF86MiscSetGrab
KeysState(off) returned MiscExtGrabStateSuccess

[gs_grab_move_keyboard] gs-grab-x11.c:328 (15:00:23):    Moving keyboard grab fr
om 4D to 30000F9


I set the idle time to 5 min, but it starts after sixty two seconds.
Comment 23 William Jon McCann 2006-03-30 17:00:37 UTC
I've changed g-s to use GTimer and added a few more debug statements.  Can you test g-p-m and g-s HEAD?
Comment 24 Byeong-taek Lee 2006-03-31 07:34:38 UTC
Thanks, but still the problem continues.
While i am posting now, screensaver started. :)
Comment 25 William Jon McCann 2006-03-31 14:36:04 UTC
Can you attach (as an attachment not a comment) a full debug log from g-s HEAD when this happens?  Thanks.
Comment 26 Byeong-taek Lee 2006-03-31 23:05:13 UTC
Created attachment 62493 [details]
screensaver debug message

Here is the debug message.
After waking up, it seems to work well once.
However, after i deactivated screensaver, it starts to work weirdly.
Comment 27 Ray Strode [halfline] 2006-04-04 05:12:29 UTC
Created attachment 62710 [details] [review]
reset emergency_lock variable

Hi,

I ended up moving my clock forward an hour tonight for an unrelated reason and then this bug started hitting me.

That seemed like a pretty good hint where the problem might be, so I read through the code to see if anything obvious stuck out.

One thing I noticed was that when the clock jumps forward gnome-screensaver does an "emergency" screen lock and sets watcher->priv->emergency_lock to TRUE.  It never resets it FALSE though.

The above patch does that.  I haven't tried it yet, but I wouldn't be surprised if it or something similiar fixes the problem.  I'm going to try to get it built into rawhide tonight and test tomorrow.
Comment 28 Ray Strode [halfline] 2006-04-04 05:28:36 UTC
Fedora bug report is here, by the way:

https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=183668
Comment 29 Ray Strode [halfline] 2006-04-04 14:14:50 UTC
I did some limited testing today and it seems to work.  I've asked Fedora users to test on the downstream report, too.
Comment 30 William Jon McCann 2006-04-04 14:24:01 UTC
Byeong-taek, thank you for that debug log.  It makes it pretty clear what is
going on.  Can you please confirm that this solve the problem for you?

Ray, I think you got it.  There really isn't any need to have emergency_lock in the priv data at all but that'll have to wait.  Thanks!
Comment 31 Byeong-taek Lee 2006-04-05 02:45:06 UTC
I'm sure that this bug was catched, too.
Since I patched last night, I confirmed that the problem was fixed.
Thanks William, Ray, and everyone :)