X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Fxjack.c;h=1765243cba111240466aa8045a2f238c39a49c66;hp=55134d915629e269801bd6379fc3c5ae74c77315;hb=f8cf5ac7b2f53510f80a0eaf286a25298be17bfe;hpb=ec8d2b32b63649e6d32bdfb306eda062769af823 diff --git a/hacks/xjack.c b/hacks/xjack.c index 55134d91..1765243c 100644 --- a/hacks/xjack.c +++ b/hacks/xjack.c @@ -1,4 +1,4 @@ -/* xscreensaver, Copyright (c) 1997-2008 Jamie Zawinski +/* xscreensaver, Copyright (c) 1997-2012 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 @@ -72,6 +72,8 @@ xjack_reshape (Display *dpy, Window window, void *closure, if (st->right > st->columns) st->right = st->columns; if (st->left > st->columns-20) st->left = st->columns-20; if (st->left < 0) st->left = 0; + + XClearWindow (st->dpy, st->window); } @@ -87,6 +89,12 @@ xjack_init (Display *dpy, Window window) st->s = source; st->delay = get_integer_resource (st->dpy, "delay", "Integer"); fontname = get_string_resource (st->dpy, "font", "Font"); + + XGetWindowAttributes (st->dpy, st->window, &st->xgwa); + + if (st->xgwa.width <= 480) + fontname = "-*-courier-medium-r-*-*-*-180-*-*-m-*-*-*"; + st->font = XLoadQueryFont (st->dpy, fontname); if (!st->font) @@ -102,8 +110,6 @@ xjack_init (Display *dpy, Window window) exit(1); } - XGetWindowAttributes (st->dpy, st->window, &st->xgwa); - gcv.font = st->font->fid; gcv.foreground = get_pixel_resource (st->dpy, st->xgwa.colormap, "foreground", "Foreground");