~ubuntu-branches/ubuntu/breezy/xscreensaver/breezy

« back to all changes in this revision

Viewing changes to driver/xset.c

  • Committer: Bazaar Package Importer
  • Author(s): Oliver Grawert
  • Date: 2005-10-11 21:00:42 UTC
  • mfrom: (2.1.1 sarge)
  • Revision ID: james.westby@ubuntu.com-20051011210042-u7q6zslgevdxspr3
Tags: 4.21-4ubuntu17
updated pt_BR again, fixed to UTF-8 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* xset.c --- interacting with server extensions and the builtin screensaver.
2
 
 * xscreensaver, Copyright (c) 1991-1998 Jamie Zawinski <jwz@jwz.org>
 
2
 * xscreensaver, Copyright (c) 1991-2004 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
157
157
 
158
158
 
159
159
 
 
160
/* Resize and Rotate server extension hackery.
 
161
 */
 
162
 
 
163
#ifdef HAVE_RANDR
 
164
 
 
165
# include <X11/extensions/Xrandr.h>
 
166
 
 
167
Bool
 
168
query_randr_extension (saver_info *si)
 
169
{
 
170
  saver_preferences *p = &si->prefs;
 
171
  Bool ok = XRRQueryExtension (si->dpy,
 
172
                               &si->randr_event_number,
 
173
                               &si->randr_error_number);
 
174
 
 
175
  if (ok)
 
176
    {
 
177
      int nscreens = ScreenCount (si->dpy);  /* number of *real* screens */
 
178
      int i;
 
179
 
 
180
      if (p->verbose_p)
 
181
        fprintf (stderr, "%s: selecting RANDR events\n", blurb());
 
182
      for (i = 0; i < nscreens; i++)
 
183
# ifdef RRScreenChangeNotifyMask                 /* randr.h 1.5, 2002/09/29 */
 
184
        XRRSelectInput (si->dpy, RootWindow (si->dpy, i),
 
185
                        RRScreenChangeNotifyMask);
 
186
# else  /* !RRScreenChangeNotifyMask */          /* Xrandr.h 1.4, 2001/06/07 */
 
187
        XRRScreenChangeSelectInput (si->dpy, RootWindow (si->dpy, i), True);
 
188
# endif /* !RRScreenChangeNotifyMask */
 
189
    }
 
190
 
 
191
  return ok;
 
192
}
 
193
 
 
194
#endif /* HAVE_RANDR */
 
195
 
 
196
 
 
197
 
160
198
/* Figuring out what the appropriate XSetScreenSaver() parameters are
161
199
   (one wouldn't expect this to be rocket science.)
162
200
 */
193
231
 
194
232
  /* I suspect (but am not sure) that DontAllowExposures might have
195
233
     something to do with powering off the monitor as well, at least
196
 
     on some systems that don't support XDPMS?  Who know... */
 
234
     on some systems that don't support XDPMS?  Who knows... */
197
235
  desired_allow_exp = AllowExposures;
198
236
 
199
237
  if (si->using_mit_saver_extension || si->using_sgi_saver_extension)
218
256
      desired_server_timeout = 0;
219
257
    }
220
258
 
 
259
  /* XSetScreenSaver() generates BadValue if either timeout parameter
 
260
     exceeds 15 bits (signed short.)  That is 09:06:07.
 
261
   */
 
262
  if (desired_server_timeout  > 0x7FFF) desired_server_timeout  = 0x7FFF;
 
263
  if (desired_server_interval > 0x7FFF) desired_server_interval = 0x7FFF;
 
264
 
221
265
  if (desired_server_timeout != current_server_timeout ||
222
266
      desired_server_interval != current_server_interval ||
223
267
      desired_prefer_blank != current_prefer_blank ||
224
268
      desired_allow_exp != current_allow_exp)
225
269
    {
226
 
      if (p->verbose_p && unblank_screen_p)
227
 
        /* Used to print this all the time, but really, nobody cares.
228
 
           Now only print it when verbose. */
 
270
      if (p->verbose_p)
229
271
        fprintf (stderr,
230
 
                 "%s disabling server builtin screensaver.\n"
231
 
                 "%s: you can re-enable it with \"xset s on\".\n",
232
 
                 blurb(), blurb());
233
 
 
234
 
      if (p->verbose_p)
235
 
        fprintf (stderr, "%s: (xset s %d %d; xset s %s; xset s %s)\n", blurb(),
 
272
                 "%s: disabling server builtin screensaver:\n"
 
273
                 "%s:  (xset s %d %d; xset s %s; xset s %s)\n",
 
274
                 blurb(), blurb(),
236
275
                 desired_server_timeout, desired_server_interval,
237
276
                 (desired_prefer_blank ? "blank" : "noblank"),
238
277
                 (desired_allow_exp ? "expose" : "noexpose"));