From 45e937a7a334373ee26b6e33341dfb79561d2767 Mon Sep 17 00:00:00 2001 From: Martin Tournoij Date: Tue, 21 Apr 2020 23:34:57 +0800 Subject: [PATCH] Revert "Smoother experience when drawing a solid circle with --repeat 0 --follow" This reverts commit 241ae5c0d463985be985978b6787b419c16029ab. --- find-cursor.c | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/find-cursor.c b/find-cursor.c index 5f0f4fb..c659bb2 100644 --- a/find-cursor.c +++ b/find-cursor.c @@ -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, ¢er_x, ¢er_y); - XMoveWindow(display, window, center_x, center_y); - XRaiseWindow(display, window); - XSync(display, False); - } - } - XFreeGC(display, gc); XDestroyWindow(display, window); }