summaryrefslogtreecommitdiff
path: root/app/xtsscale/xtsscale.c
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2009-11-25 19:43:06 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2009-11-25 19:43:06 +0000
commit6eec6d46c06ffd5394e7adc2269a53210e748c4a (patch)
tree26c09f19818d433034dd194ed021a3cdc68682fc /app/xtsscale/xtsscale.c
parent2dff6638d48155a8d2c5e1c38b6d703aa48d581d (diff)
Search for calibration properties atoms earlier, to avoid a screen
flash when they are not present.
Diffstat (limited to 'app/xtsscale/xtsscale.c')
-rw-r--r--app/xtsscale/xtsscale.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/app/xtsscale/xtsscale.c b/app/xtsscale/xtsscale.c
index 985fd22e0..6d2976083 100644
--- a/app/xtsscale/xtsscale.c
+++ b/app/xtsscale/xtsscale.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xtsscale.c,v 1.7 2009/11/25 18:30:13 matthieu Exp $ */
+/* $OpenBSD: xtsscale.c,v 1.8 2009/11/25 19:43:05 matthieu Exp $ */
/*
* Copyright (c) 2007 Robert Nagy <robert@openbsd.org>
* Copyright (c) 2009 Matthieu Herrb <matthieu@herrb.eu>
@@ -482,6 +482,17 @@ main(int argc, char *argv[], char *env[])
exit(1);
}
+ prop_calibration = XInternAtom(display, WS_PROP_CALIBRATION, True);
+ if (prop_calibration == None) {
+ fprintf(stderr, "cannot find atom %s\n", WS_PROP_CALIBRATION);
+ exit(1);
+ }
+ prop_swap = XInternAtom(display, WS_PROP_SWAP_AXES, True);
+ if (prop_swap == None) {
+ fprintf(stderr, "cannot find atom %s\n", WS_PROP_SWAP_AXES);
+ exit(1);
+ }
+
screen = DefaultScreen(display);
root = RootWindow(display, screen);
@@ -512,18 +523,6 @@ main(int argc, char *argv[], char *env[])
if (!register_events(info, device, argv[1], 0))
exit(1);
-
- prop_calibration = XInternAtom(display, WS_PROP_CALIBRATION, True);
- if (prop_calibration == None) {
- fprintf(stderr, "cannot find atom %s\n", WS_PROP_CALIBRATION);
- exit(1);
- }
- prop_swap = XInternAtom(display, WS_PROP_SWAP_AXES, True);
- if (prop_swap == None) {
- fprintf(stderr, "cannot find atom %s\n", WS_PROP_SWAP_AXES);
- exit(1);
- }
-
uncalibrate(device);
calib:
XftDrawRect(draw, &bg, 0, 0, width, height);