X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Fdistort.c;h=ffaaa53e6b186539bfac5a44d77f4a5c8f76bda1;hp=97b4ffe829b1f4d76d72756a79905d4e45e36fb6;hb=8eb2873d7054e705c4e83f22d18c40946a9e2529;hpb=a1d41b2aa6e18bf9a49b914a99dda8232c5d7762 diff --git a/hacks/distort.c b/hacks/distort.c index 97b4ffe8..ffaaa53e 100644 --- a/hacks/distort.c +++ b/hacks/distort.c @@ -113,6 +113,8 @@ static void init_distort(Display *dpy, Window window) if (get_boolean_resource("bounce", "Boolean")) effect = &move_lense; + XGetWindowAttributes (dpy, window, &xgwa); + if (effect == NULL && radius == 0 && speed == 0 && number == 0 && !blackhole && !vortex && !magnify && !reflect) { /* if no cmdline options are given, randomly choose one of: @@ -201,6 +203,9 @@ static void init_distort(Display *dpy, Window window) abort(); break; } + /* but if the window is small, reduce default radius */ + if (xgwa.width < radius * 8) + radius = xgwa.width/8; } if (delay < 0) @@ -222,7 +227,6 @@ static void init_distort(Display *dpy, Window window) if (draw == NULL) draw = &plain_draw; - XGetWindowAttributes (dpy, window, &xgwa); black_pixel = BlackPixelOfScreen( xgwa.screen ); gcv.function = GXcopy;