Revert "Smoother experience when drawing a solid circle with --repeat 0 --follow"

This reverts commit 241ae5c0d4.
pull/19/head v1.6
Martin Tournoij 4 years ago
parent 241ae5c0d4
commit 45e937a7a3
No known key found for this signature in database
GPG Key ID: A6258419189EE585

@ -73,7 +73,7 @@ void usage(char *name) {
printf(" Draw a solid circle:\n");
printf(" %s --size 100 --distance 1 --wait 20 --line-width 1\n\n", name);
printf(" Always draw a full circle on top of the cursor:\n");
printf(" %s --repeat 0 --follow --transparent --line-width 16 --size 16\n", name);
printf(" %s --repeat 0 --follow --distance 1 --wait 1 --line-width 16 --size 16\n", name);
}
// Parse number from commandline, or show error and exit if it's not a number.
@ -339,23 +339,6 @@ void draw(char *name, Display *display, int screen,
usleep(wait * 100);
}
// No need to keep creating windows if follow is enabled, repeating
// indefinitely, and the line_width is the same as the size: just update
// the window position. Saves CPU cycles and gives a smoother
// experience.
//
// TODO: without --transparent the window becomes white after a while?
// Only optimize this case for now.
if (line_width == size && follow && transparent && repeat == -1) {
while (1) {
usleep(200 * 100);
cursor_center(display, size, &center_x, &center_y);
XMoveWindow(display, window, center_x, center_y);
XRaiseWindow(display, window);
XSync(display, False);
}
}
XFreeGC(display, gc);
XDestroyWindow(display, window);
}

Loading…
Cancel
Save