-/* xscreensaver, Copyright (c) 1991-2008 Jamie Zawinski <jwz@jwz.org>
+/* xscreensaver, Copyright (c) 1991-2011 Jamie Zawinski <jwz@jwz.org>
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
#include <ctype.h>
#include <X11/Xlib.h>
+#ifdef ENABLE_NLS
+# include <locale.h>
+# include <libintl.h>
+#endif /* ENABLE_NLS */
+
#include <X11/Xlibint.h>
#include <X11/Xatom.h>
Bool server_has_sgi_saver_extension_p = False;
Bool server_has_mit_saver_extension_p = False;
Bool system_has_proc_interrupts_p = False;
+ Bool server_has_xinput_extension_p = False;
const char *piwhy = 0;
si->using_xidle_extension = p->use_xidle_extension;
si->using_sgi_saver_extension = p->use_sgi_saver_extension;
si->using_mit_saver_extension = p->use_mit_saver_extension;
si->using_proc_interrupts = p->use_proc_interrupts;
+ si->using_xinput_extension = p->use_xinput_extension;
#ifdef HAVE_XIDLE_EXTENSION
{
system_has_proc_interrupts_p = query_proc_interrupts_available (si, &piwhy);
#endif
+#ifdef HAVE_XINPUT
+ server_has_xinput_extension_p = query_xinput_extension (si);
+#endif
+
if (!server_has_xidle_extension_p)
si->using_xidle_extension = False;
else if (p->verbose_p)
int nscreens = ScreenCount (si->dpy); /* number of *real* screens */
int i;
+ si->using_randr_extension = TRUE;
+
if (p->verbose_p)
fprintf (stderr, "%s: selecting RANDR events\n", blurb());
for (i = 0; i < nscreens; i++)
}
# endif /* HAVE_RANDR */
+#ifdef HAVE_XINPUT
+ if (!server_has_xinput_extension_p)
+ si->using_xinput_extension = False;
+ else
+ {
+ if (si->using_xinput_extension)
+ init_xinput_extension(si);
+
+ if (p->verbose_p)
+ {
+ if (si->using_xinput_extension)
+ fprintf (stderr,
+ "%s: selecting events from %d XInputExtension devices.\n",
+ blurb(), si->num_xinput_devices);
+ else
+ fprintf (stderr,
+ "%s: not using XInputExtension.\n",
+ blurb());
+ }
+ }
+#endif
+
if (!system_has_proc_interrupts_p)
{
si->using_proc_interrupts = False;
for (i = 0; i < si->nscreens; i++)
spawn_screenhack (&si->screens[i]);
+ /* If we are blanking only, optionally power down monitor right now.
+ To do this, we might need to temporarily re-enable DPMS first.
+ */
+ if (p->mode == BLANK_ONLY &&
+ p->dpms_enabled_p &&
+ p->dpms_quickoff_p)
+ {
+ sync_server_dpms_settings (si->dpy, True,
+ p->dpms_standby / 1000,
+ p->dpms_suspend / 1000,
+ (p->dpms_off
+ ? (p->dpms_off / 1000)
+ : 0xFFFF),
+ False);
+ monitor_power_on (si, False);
+ }
+
/* Don't start the cycle timer in demo mode. */
if (!si->demoing_p && p->cycle)
si->cycle_id = XtAppAddTimeOut (si->app,
struct passwd *spasswd;
int i;
+ /* It turns out that if we do NLS stuff here, people running in Japanese
+ locales get font craziness on the password dialog, presumably because
+ it is displaying Japanese characters in a non-Japanese font. I don't
+ understand how to automatically make all this crap work properly by
+ default, so until someone sends me a better patch, just leave it off
+ and run the daemon in English. -- jwz, 29-Sep-2010
+ */
+#undef ENABLE_NLS
+
+#ifdef ENABLE_NLS
+ if (!setlocale (LC_ALL, ""))
+ fprintf (stderr, "locale not supported by C library\n");
+
+ bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
+ textdomain (GETTEXT_PACKAGE);
+#endif /* ENABLE_NLS */
+
memset(si, 0, sizeof(*si));
global_si_kludge = si; /* I hate C so much... */
True, 0
}, { "Apple-DRI", "Apple-DRI (XDarwin)",
True, 0
+ }, { "XInputExtension", "XInput",
+ True, 0
},
};