X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fscreenhack.c;h=443d3f423745562b89165e8df92fa620caad08ec;hb=de460e831dc8578acfa8b72251ab9346c99c1f96;hp=f4db428a2d9db1a8fbc130cf1e5b65bf3d87ec71;hpb=49f5b54f312fe4ac2e9bc47581a72451bd0e8439;p=xscreensaver diff --git a/hacks/screenhack.c b/hacks/screenhack.c index f4db428a..443d3f42 100644 --- a/hacks/screenhack.c +++ b/hacks/screenhack.c @@ -1,4 +1,4 @@ -/* xscreensaver, Copyright (c) 1992-2006 Jamie Zawinski +/* xscreensaver, Copyright (c) 1992-2008 Jamie Zawinski * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -105,10 +105,6 @@ #include "screenhackI.h" #include "version.h" #include "vroot.h" -#include "change_locale.h" -#if HAVE_SETLOCALE -#include -#endif #ifndef _XSCREENSAVER_VROOT_H_ # error Error! You have an old version of vroot.h! Check -I args. @@ -162,27 +158,6 @@ static XrmOptionDescRec *merged_options; static int merged_options_size; static char **merged_defaults; -static void -reset_locale (void) -{ -#ifdef HAVE_SETLOCALE - const char *current_locale = setlocale(LC_ALL, ""); - const char *cmp_locale; - int j = 0; - - while ((cmp_locale = change_locale[j])) - { - if (!strncmp(current_locale, cmp_locale, strlen(cmp_locale))) - { - setlocale(LC_ALL, "C"); - break; - } - j++; - } -#endif /* HAVE_SETLOCALE */ -} - - static void merge_options (void) { @@ -606,7 +581,7 @@ run_screenhack_table (Display *dpy, { unsigned long delay = ft->draw_cb (dpy, window, closure); #ifdef DEBUG_PAIR - unsigned long delay2; + unsigned long delay2 = 0; if (window2) delay2 = ft->draw_cb (dpy, window2, closure2); #endif @@ -709,7 +684,7 @@ init_window (Display *dpy, Widget toplevel, const char *title) window = XtWindow (toplevel); XGetWindowAttributes (dpy, window, &xgwa); XSelectInput (dpy, window, - (xgwa.your_event_mask | KeyPressMask | + (xgwa.your_event_mask | KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask)); XChangeProperty (dpy, window, XA_WM_PROTOCOLS, XA_ATOM, 32, PropModeReplace, @@ -738,7 +713,6 @@ main (int argc, char **argv) char version[255]; fix_fds(); - reset_locale(); progname = argv[0]; /* reset later */ progclass = ft->progclass; @@ -908,6 +882,8 @@ main (int argc, char **argv) window = VirtualRootWindowOfScreen (XtScreen (toplevel)); XtDestroyWidget (toplevel); XGetWindowAttributes (dpy, window, &xgwa); + /* With RANDR, the root window can resize! */ + XSelectInput (dpy, window, xgwa.your_event_mask | StructureNotifyMask); visual_warning (xgwa.screen, window, xgwa.visual, xgwa.colormap, False); } else