Skip to content

Commit

Permalink
Revert "Little improvment for repainting"
Browse files Browse the repository at this point in the history
Revert the timer based redraw prevention, because we want to
take a new approach based on an idle worker.

This reverts commit 99a44dd.
  • Loading branch information
donald committed Mar 22, 2019
1 parent 3a00b22 commit 18c9542
Showing 1 changed file with 3 additions and 28 deletions.
31 changes: 3 additions & 28 deletions xwin.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@
#include <stdlib.h> /* for exit() */
#endif

#include <sys/time.h>

/*
* IMPORTS: routines that this module vectors out to
*/
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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
Expand All @@ -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();
}

Expand Down

0 comments on commit 18c9542

Please sign in to comment.