~ubuntu-branches/ubuntu/precise/xscreensaver/precise

« back to all changes in this revision

Viewing changes to driver/dpms.c

  • Committer: Bazaar Package Importer
  • Author(s): Jeremy Bicha
  • Date: 2011-05-18 15:39:48 UTC
  • mfrom: (1.1.11 upstream) (2.1.12 sid)
  • Revision ID: james.westby@ubuntu.com-20110518153948-8w0vyzy9lbiimpez
Tags: 5.13-1ubuntu1
* Merge with Debian unstable, remaining Ubuntu changes:
* debian/control:
  - Build-Depend on ubuntu-artwork
  - Add Vcs-Bzr link
  - Move xli | xloadimage xscreensaver recommends to suggests
  - Add/Update replaces with Ubuntu versions
  - Update package descriptions to list Ubuntu screensavers
* debian/rules:
  - Use /usr/share/backgrounds as image directory
  - Add translation domain to .desktop files
* debian/source_xscreensaver.py: 
  - Add apport hook
* debian/split-hacks.config:
  - Use different set of default hacks than Debian
* debian/xscreensaver.dirs
  - Install /usr/share/backgrounds. By default, settings search in
    /usr/share/backgrounds and without it, it displays an error
* debian/patches/53_XScreenSaver.ad.in.patch:
  - Use Ubuntu branding

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* dpms.c --- syncing the X Display Power Management values
2
 
 * xscreensaver, Copyright (c) 2001-2009 Jamie Zawinski <jwz@jwz.org>
 
2
 * xscreensaver, Copyright (c) 2001-2011 Jamie Zawinski <jwz@jwz.org>
3
3
 *
4
4
 * Permission to use, copy, modify, distribute, and sell this software and its
5
5
 * documentation for any purpose is hereby granted without fee, provided that
217
217
}
218
218
 
219
219
void
220
 
monitor_power_on (saver_info *si)
 
220
monitor_power_on (saver_info *si, Bool on_p)
221
221
{
222
 
  if (!monitor_powered_on_p (si))
 
222
  if ((!!on_p) != monitor_powered_on_p (si))
223
223
    {
224
 
      DPMSForceLevel(si->dpy, DPMSModeOn);
 
224
      int event_number, error_number;
 
225
      if (!DPMSQueryExtension(si->dpy, &event_number, &error_number) ||
 
226
          !DPMSCapable(si->dpy))
 
227
        {
 
228
          if (si->prefs.verbose_p)
 
229
            fprintf (stderr,
 
230
                     "%s: unable to power %s monitor: no DPMS extension.\n",
 
231
                     blurb(), (on_p ? "on" : "off"));
 
232
          return;
 
233
        }
 
234
 
 
235
      DPMSForceLevel(si->dpy, (on_p ? DPMSModeOn : DPMSModeOff));
225
236
      XSync(si->dpy, False);
226
 
      if (!monitor_powered_on_p (si))
 
237
 
 
238
      if ((!!on_p) != monitor_powered_on_p (si))  /* double-check */
227
239
        fprintf (stderr,
228
 
       "%s: DPMSForceLevel(dpy, DPMSModeOn) did not power the monitor on?\n",
229
 
                 blurb());
 
240
       "%s: DPMSForceLevel(dpy, %s) did not change monitor power state.\n",
 
241
                 blurb(),
 
242
                 (on_p ? "DPMSModeOn" : "DPMSModeOff"));
230
243
    }
231
244
}
232
245
 
248
261
}
249
262
 
250
263
void
251
 
monitor_power_on (saver_info *si)
 
264
monitor_power_on (saver_info *si, Bool on_p)
252
265
{
253
266
  return; 
254
267
}