From 18c9542f0011e16d0a8b1804b7e0cbf29c1e169c Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Fri, 22 Mar 2019 12:59:08 +0100 Subject: [PATCH] Revert "Little improvment for repainting" Revert the timer based redraw prevention, because we want to take a new approach based on an idle worker. This reverts commit 99a44ddc5ddc659345332be8552ed18ad3f68878. --- xwin.c | 31 +++---------------------------- 1 file changed, 3 insertions(+), 28 deletions(-) diff --git a/xwin.c b/xwin.c index a2a08bc..b60ea4d 100644 --- a/xwin.c +++ b/xwin.c @@ -35,8 +35,6 @@ #include /* for exit() */ #endif -#include - /* * IMPORTS: routines that this module vectors out to */ @@ -69,11 +67,6 @@ extern void xdrawrect(); */ static void help_popup(); static void help_popdown(); -static struct timeval last_repaint; -static long int timediff(struct timeval* t1, struct timeval* t2) -{ - return 1000000 * (t2->tv_sec - t1->tv_sec) + t2->tv_usec - t1->tv_usec; -} static String fallback_resources[] = { "*window.width: 600", @@ -345,20 +338,10 @@ static void c_resize(Widget w, XtPointer data, XEvent* event, Boolean* continue_to_dispatch) { UNUSED(w, data, event, continue_to_dispatch); - /* - * printf("Resize\n"); - */ - long int diff; - struct timeval t; - - gettimeofday(&t, NULL); - diff = timediff(&last_repaint, &t); - - if (diff < (long int)50000) - return; + /* + * printf("Resize\n"); + */ xrepaint(); - - gettimeofday(&last_repaint, NULL); } static void @@ -368,14 +351,6 @@ c_repaint(Widget w, XtPointer data, XEvent* event, Boolean* continue_to_dispatch /* * printf("Expose\n"); */ - long int diff; - struct timeval t; - - gettimeofday(&t, NULL); - diff = timediff(&last_repaint, &t); - - if (diff < (long int)50000) - return; xrepaint_noclear(); }