~ubuntu-branches/ubuntu/vivid/xscreensaver/vivid

« back to all changes in this revision

Viewing changes to driver/test-xdpms.c

  • Committer: Bazaar Package Importer
  • Author(s): Mathieu Trudel-Lapierre
  • Date: 2011-06-09 22:10:56 UTC
  • mfrom: (1.1.12 upstream) (2.1.13 sid)
  • Revision ID: james.westby@ubuntu.com-20110609221056-01ikv0cvs0g1hhxd
Tags: 5.14-1ubuntu1
* Merge with Debian unstable, remaining Ubuntu changes (LP: #795251):
  - debian/control:
    + Add Vcs-Bzr link
    + 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
  - debian/patches/60_sequential_glslideshow.patch:
    + Allow going through images sequentially rather than just at random in
      the GLSlideshow hack. 
* debian/patches/61_fix_tube_memleak.patch: dropped, applied upstream.
* debian/xscreensaver.desktop: drop file left over from previous merge.
* debian/control: drop Build-Depends on ubuntu-artwork. This was only pulled
  in to create /usr/share/backgrounds to use as a location for screensavers
  that look for images.
* debian/changelog: reinstate old changelog entries that were dropped in
  previous commits.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* test-xdpms.c --- playing with the XDPMS extension.
2
 
 * xscreensaver, Copyright (c) 1998 Jamie Zawinski <jwz@jwz.org>
 
2
 * xscreensaver, Copyright (c) 1998-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
65
65
}
66
66
 
67
67
 
 
68
static Bool error_handler_hit_p = False;
 
69
 
 
70
static int
 
71
ignore_all_errors_ehandler (Display *dpy, XErrorEvent *error)
 
72
{
 
73
  error_handler_hit_p = True;
 
74
  return 0;
 
75
}
 
76
 
 
77
 
68
78
int
69
79
main (int argc, char **argv)
70
80
{
148
158
          state == DPMSModeSuspend ||
149
159
          state == DPMSModeOff)
150
160
        {
151
 
          Status st;
 
161
          XErrorHandler old_handler;
 
162
          int st;
152
163
          fprintf(stderr, "%s: monitor is off; turning it on.\n", blurb());
 
164
 
 
165
          XSync (dpy, False);
 
166
          error_handler_hit_p = False;
 
167
          old_handler = XSetErrorHandler (ignore_all_errors_ehandler);
 
168
          XSync (dpy, False);
153
169
          st = DPMSForceLevel (dpy, DPMSModeOn);
 
170
          XSync (dpy, False);
 
171
          if (error_handler_hit_p) st = -666;
 
172
 
154
173
          fprintf (stderr, "%s: DPMSForceLevel (dpy, DPMSModeOn) ==> %s\n",
155
 
                   blurb(), (st ? "Ok" : "Error"));
 
174
                   blurb(), (st == -666 ? "X Error" : st ? "Ok" : "Error"));
156
175
        }
157
176
 
158
177
      sleep (delay);