X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=driver%2Ftimers.c;h=d810b4924d32e934de1d62ddc3e0c271ef8c8be2;hb=ebc241816cc8e3eec7270a594bb1a607df32bcd6;hp=5ffc63ed0641efeab11818b6a5697bdb29899b4a;hpb=c596d1306f5f92f7eab76224d3b049980a14adcb;p=xscreensaver diff --git a/driver/timers.c b/driver/timers.c index 5ffc63ed..d810b492 100644 --- a/driver/timers.c +++ b/driver/timers.c @@ -230,8 +230,6 @@ cycle_timer (XtPointer closure, XtIntervalId *id) else { maybe_reload_init_file (si); - if (p->verbose_p) - fprintf (stderr, "%s: changing graphics hacks.\n", blurb()); kill_screenhack (si); if (!si->throttled_p) @@ -348,6 +346,16 @@ check_pointer_timer (XtPointer closure, XtIntervalId *id) else fprintf (stderr, "%s: pointer moved at %s on screen %d.\n", blurb(), timestring(), i); + +# if 0 + fprintf (stderr, "%s: old: %d %d 0x%x ; new: %d %d 0x%x\n", + blurb(), + ssi->poll_mouse_last_root_x, + ssi->poll_mouse_last_root_y, + (unsigned int) ssi->poll_mouse_last_child, + root_x, root_y, (unsigned int) child); +# endif /* 0 */ + #endif /* DEBUG_TIMERS */ si->last_activity_screen = ssi; @@ -456,7 +464,7 @@ swallow_unlock_typeahead_events (saver_info *si, XEvent *e) if (event.xany.type == KeyPress) { char s[2]; - int size = XLookupString (&event, s, 1, 0, 0); + int size = XLookupString ((XKeyEvent *) &event, s, 1, 0, 0); if (size != 1) continue; switch (*s) { @@ -1063,9 +1071,18 @@ static void watchdog_timer (XtPointer closure, XtIntervalId *id) { saver_info *si = (saver_info *) closure; + saver_preferences *p = &si->prefs; disable_builtin_screensaver (si, False); + /* If the DPMS settings on the server have changed, change them back to + what ~/.xscreensaver says they should be. */ + sync_server_dpms_settings (si->dpy, p->dpms_enabled_p, + p->dpms_standby / 1000, + p->dpms_suspend / 1000, + p->dpms_off / 1000, + False); + if (si->screen_blanked_p) { Bool running_p = screenhack_running_p (si); @@ -1089,11 +1106,12 @@ watchdog_timer (XtPointer closure, XtIntervalId *id) raise_window (si, True, True, running_p); } - if (!monitor_powered_on_p (si)) + if (screenhack_running_p (si) && + !monitor_powered_on_p (si)) { if (si->prefs.verbose_p) fprintf (stderr, - "%s: server reports that monitor has powered down; " + "%s: X says monitor has powered down; " "killing running hacks.\n", blurb()); kill_screenhack (si); }