projects
/
xscreensaver
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
From http://www.jwz.org/xscreensaver/xscreensaver-5.38.tar.gz
[xscreensaver]
/
hacks
/
compass.c
diff --git
a/hacks/compass.c
b/hacks/compass.c
index 5b9ba4990ec51febf325ae04183ec366d5bc14cf..9d62870f6d163be6a6107a588f43930ee97019b8 100644
(file)
--- a/
hacks/compass.c
+++ b/
hacks/compass.c
@@
-822,13
+822,17
@@
compass_init (Display *dpy, Window window)
st->delay = get_integer_resource (st->dpy, "delay", "Integer");
st->dbuf = get_boolean_resource (st->dpy, "doubleBuffer", "Boolean");
st->delay = get_integer_resource (st->dpy, "delay", "Integer");
st->dbuf = get_boolean_resource (st->dpy, "doubleBuffer", "Boolean");
-# ifdef HAVE_
COCOA
/* Don't second-guess Quartz's double-buffering */
+# ifdef HAVE_
JWXYZ
/* Don't second-guess Quartz's double-buffering */
st->dbuf = False;
# endif
XGetWindowAttributes (st->dpy, st->window, &st->xgwa);
st->size2 = MIN(st->xgwa.width, st->xgwa.height);
st->dbuf = False;
# endif
XGetWindowAttributes (st->dpy, st->window, &st->xgwa);
st->size2 = MIN(st->xgwa.width, st->xgwa.height);
+ if (st->xgwa.width > st->xgwa.height * 5 || /* goofy aspect ratio */
+ st->xgwa.height > st->xgwa.width * 5)
+ st->size2 = MAX(st->xgwa.width, st->xgwa.height);
+
if (st->size2 > 600) st->size2 = 600;
st->size = (st->size2 / 2) * 0.8;
if (st->size2 > 600) st->size2 = 600;
st->size = (st->size2 / 2) * 0.8;
@@
-933,6
+937,11
@@
static void
compass_reshape (Display *dpy, Window window, void *closure,
unsigned int w, unsigned int h)
{
compass_reshape (Display *dpy, Window window, void *closure,
unsigned int w, unsigned int h)
{
+ struct state *st = (struct state *) closure;
+ XGetWindowAttributes (st->dpy, st->window, &st->xgwa);
+ st->size2 = MIN(st->xgwa.width, st->xgwa.height);
+ st->x = st->xgwa.width/2;
+ st->y = st->xgwa.height/2;
}
static Bool
}
static Bool