diff -ur microwindows-0.91.orig/src/config microwindows-0.91/src/config
--- microwindows-0.91.orig/src/config	2003-11-16 23:34:12.000000000 +0100
+++ microwindows-0.91/src/config	2006-11-28 20:31:42.000000000 +0100
@@ -37,7 +37,7 @@
 # note: ELKS can't build client/server nano-X, nor widget lib
 #
 ####################################################################
-ARCH                     = LINUX-NATIVE
+ARCH                     = LINUX-ARM
 BIGENDIAN                = N
 NATIVETOOLSPREFIX        = 
 ARMTOOLSPREFIX           = arm-linux-
@@ -54,8 +54,7 @@
 OPTIMIZE                 = Y
 DEBUG                    = N
 VERBOSE                  = N
-THREADSAFE               = Y
-GPROF                    = N
+THREADSAFE               = N
 
 ####################################################################
 #
@@ -64,7 +63,7 @@
 ####################################################################
 MICROWIN                 = Y
 NANOX                    = Y
-SHAREDLIBS               = Y
+SHAREDLIBS               = N
 OBJFRAMEWORK             = N
 
 
@@ -134,9 +133,9 @@
 ####################################################################
 # JPEG support through libjpeg, see README.txt in contrib/jpeg
 ####################################################################
-HAVE_JPEG_SUPPORT        = Y
+HAVE_JPEG_SUPPORT        = N
 INCJPEG                  = .
-LIBJPEG                  = /usr/lib/libjpeg.so
+LIBJPEG                  = /usr/lib/libjpeg.a
 
 ####################################################################
 # PNG support via libpng and libz
@@ -157,20 +156,20 @@
 # native .fnt loadable font support
 ####################################################################
 HAVE_FNT_SUPPORT         = Y
-HAVE_FNTGZ_SUPPORT       = Y
+HAVE_FNTGZ_SUPPORT       = N
 FNT_FONT_DIR             = "fonts/bdf"
 
 ####################################################################
 # T1 adobe type1 font support thru t1lib
 ####################################################################
 HAVE_T1LIB_SUPPORT       = N
-INCT1LIB                 = /usr/include
+INCT1LIB                 = .
 LIBT1LIB                 = /usr/local/lib/libt1.a
 
 ####################################################################
 # TrueType font support thru FreeType 1.x
 ####################################################################
-HAVE_FREETYPE_SUPPORT    = Y
+HAVE_FREETYPE_SUPPORT    = N
 INCFTLIB                 = /usr/include/freetype1
 LIBFTLIB                 = /usr/lib/libttf.so
 FREETYPE_FONT_DIR        = "fonts/truetype"
@@ -180,7 +179,7 @@
 # Must also set FREETYPE_FONT_DIR in the Freetype 1.x section
 ####################################################################
 HAVE_FREETYPE_2_SUPPORT  = N
-INCFT2LIB                = /usr/include
+INCFT2LIB                = .
 LIBFT2LIB                = /usr/lib/libfreetype.a
 
 ####################################################################
@@ -188,8 +187,8 @@
 # Selecting HAVE_PCFGZ_SUPPORT will allow you to directly read
 # .pcf.gz files, but it will add libz to the size of the server
 ####################################################################
-HAVE_PCF_SUPPORT         = Y
-HAVE_PCFGZ_SUPPORT       = Y
+HAVE_PCF_SUPPORT         = N
+HAVE_PCFGZ_SUPPORT       = N
 PCF_FONT_DIR             = "fonts/pcf"
 
 ####################################################################
@@ -276,14 +275,14 @@
 # set FBREVERSE to reverse bit orders in 1,2,4 bpp
 # set FBVGA=N for all systems without VGA hardware (for MIPS must=N)
 FRAMEBUFFER              = Y
-FBVGA                    = Y
-VTSWITCH                 = Y
+FBVGA                    = N
+VTSWITCH                 = N
 FBREVERSE                = N
 
 # set HAVETEXTMODE=Y for systems that can switch between text & graphics.
 # On a graphics-only embedded system, such as Osprey and Embedded
 # Planet boards, set HAVETEXTMODE=N
-HAVETEXTMODE             = Y
+HAVETEXTMODE             = N
 
 # svgalib screen driver
 VGALIB                   = N
@@ -311,10 +310,10 @@
 # YOPYMOUSE	Yopy (/dev/yopy-ts)
 # HARRIERMOUSE	NEC Harrier (/dev/tpanel)
 ####################################################################
-GPMMOUSE                 = Y
+GPMMOUSE                 = N
 SERMOUSE                 = N
 SUNMOUSE                 = N
-NOMOUSE                  = N
+NOMOUSE                  = Y
 IPAQMOUSE                = N
 ZAURUSMOUSE              = N
 TUXMOUSE                 = N
@@ -330,11 +329,11 @@
 
 # keyboard or null kbd driver
 TTYKBD                   = N
-SCANKBD                  = Y
+SCANKBD                  = N
 PIPEKBD                  = N
 IPAQKBD                  = N
 LIRCKBD                  = N
-NOKBD                    = N
+NOKBD                    = Y
 
 endif
 
diff -ur microwindows-0.91.orig/src/engine/devdraw.c microwindows-0.91/src/engine/devdraw.c
--- microwindows-0.91.orig/src/engine/devdraw.c	2003-11-16 23:34:12.000000000 +0100
+++ microwindows-0.91/src/engine/devdraw.c	2006-11-29 01:04:37.000000000 +0100
@@ -39,6 +39,61 @@
 /*static*/ void drawrow(PSD psd,MWCOORD x1,MWCOORD x2,MWCOORD y);
 static void drawcol(PSD psd,MWCOORD x,MWCOORD y1,MWCOORD y2);
 
+/* ---------------------------------------------------------------------- */
+
+int gOperationCounter = 0;
+
+void psd_DrawPixel(PSD psd, MWCOORD x, MWCOORD y, MWPIXELVAL c) {
+    psd->DrawPixel(psd, x, y, c);
+    gOperationCounter++;
+}
+
+void psd_DrawHorzLine(PSD psd, MWCOORD x1, MWCOORD x2, MWCOORD y, MWPIXELVAL c) {
+    psd->DrawHorzLine(psd, x1, x2, y, c);
+    gOperationCounter++;
+}
+
+void psd_FillRect(PSD psd,MWCOORD x1,MWCOORD y1,MWCOORD x2, MWCOORD y2,MWPIXELVAL c) {
+    psd->FillRect(psd, x1, y1, x2,  y2, c);
+    gOperationCounter++;
+}
+
+void psd_DrawVertLine(PSD psd, MWCOORD x, MWCOORD y1, MWCOORD y2,
+                      MWPIXELVAL c) {
+    psd->DrawVertLine(psd, x, y1, y2, c);
+    gOperationCounter++;
+}
+
+void psd_Blit(PSD destpsd, MWCOORD destx, MWCOORD desty, MWCOORD w,
+              MWCOORD h,PSD srcpsd,MWCOORD srcx,MWCOORD srcy,long op) {
+    destpsd->Blit(destpsd, destx, desty, w, h, srcpsd, srcx, srcy, op);
+    gOperationCounter++;
+}
+
+void psd_StretchBlitEx(PSD dstpsd, PSD srcpsd,
+                       MWCOORD dest_x_start, int dest_y_start,
+                       MWCOORD width, int height,
+                       int x_denominator, int y_denominator,
+                       int src_x_fraction, int src_y_fraction,
+                       int x_step_fraction, int y_step_fraction, long op) {
+    dstpsd->StretchBlitEx(dstpsd, srcpsd, dest_x_start, dest_y_start,
+                          width, height, x_denominator, y_denominator,
+                          src_x_fraction, src_y_fraction,
+                          x_step_fraction, y_step_fraction, op);
+    gOperationCounter++;
+}
+
+void psd_StretchBlit(PSD destpsd, MWCOORD destx, MWCOORD desty,
+                     MWCOORD dstw, MWCOORD dsth, PSD srcpsd, MWCOORD srcx,
+                     MWCOORD srcy, MWCOORD srcw, MWCOORD srch, long op) {
+    destpsd->StretchBlit(destpsd, destx, desty,
+                         dstw, dsth, srcpsd, srcx,
+                         srcy, srcw, srch, op);
+    gOperationCounter++;
+}
+
+/* ---------------------------------------------------------------------- */
+
 /**
  * Set the drawing mode for future calls.
  *
@@ -178,7 +233,7 @@
 GdPoint(PSD psd, MWCOORD x, MWCOORD y)
 {
 	if (GdClipPoint(psd, x, y)) {
-		psd->DrawPixel(psd, x, y, gr_foreground);
+		psd_DrawPixel(psd, x, y, gr_foreground);
 		GdFixCursor(psd);
 	}
 }
@@ -285,7 +340,7 @@
 
 	/* draw first point*/
 	if (GdClipPoint(psd, x1, y1))
-		psd->DrawPixel(psd, x1, y1, gr_foreground);
+		psd_DrawPixel(psd, x1, y1, gr_foreground);
 
 	if (xdelta >= ydelta) {
 		rem = xdelta / 2;
@@ -301,12 +356,12 @@
 
 			if (gr_dashcount) {
 				if ((gr_dashmask & (1 << bit)) && GdClipPoint(psd, x1, y1))
-					psd->DrawPixel(psd, x1, y1, gr_foreground);
+					psd_DrawPixel(psd, x1, y1, gr_foreground);
 
 				bit = (bit + 1) % gr_dashcount;
 			} else {	/* No dashes */
 				if (GdClipPoint(psd, x1, y1))
-					psd->DrawPixel(psd, x1, y1, gr_foreground);
+					psd_DrawPixel(psd, x1, y1, gr_foreground);
 			}
 
 			if (bDrawLastPoint && x1 == x2)
@@ -328,12 +383,12 @@
 			/* If we are trying to draw to a dash mask */
 			if (gr_dashcount) {
 				if ((gr_dashmask & (1 << bit)) && GdClipPoint(psd, x1, y1))
-					psd->DrawPixel(psd, x1, y1, gr_foreground);
+					psd_DrawPixel(psd, x1, y1, gr_foreground);
 
 				bit = (bit + 1) % gr_dashcount;
 			} else {	/* No dashes */
 				if (GdClipPoint(psd, x1, y1))
-					psd->DrawPixel(psd, x1, y1, gr_foreground);
+					psd_DrawPixel(psd, x1, y1, gr_foreground);
 			}
 
 			if (bDrawLastPoint && y1 == y2)
@@ -348,7 +403,7 @@
 drawpoint(PSD psd, MWCOORD x, MWCOORD y)
 {
 	if (GdClipPoint(psd, x, y))
-		psd->DrawPixel(psd, x, y, gr_foreground);
+		psd_DrawPixel(psd, x, y, gr_foreground);
 }
 
 /* Draw a horizontal line from x1 to and including x2 in the
@@ -381,7 +436,7 @@
 		while (x1 <= x2) {
 			if (GdClipPoint(psd, x1, y)) {
 				temp = MWMIN(clipmaxx, x2);
-				psd->DrawHorzLine(psd, x1, temp, y, gr_foreground);
+				psd_DrawHorzLine(psd, x1, temp, y, gr_foreground);
 			} else
 				temp = MWMIN(clipmaxx, x2);
 			x1 = temp + 1;
@@ -392,7 +447,7 @@
 		/* We want to draw a dashed line instead */
 		for (p = x1; p <= x2; p++) {
 			if ((gr_dashmask & (1 << bit)) && GdClipPoint(psd, p, y))
-				psd->DrawPixel(psd, p, y, gr_foreground);
+				psd_DrawPixel(psd, p, y, gr_foreground);
 
 			bit = (bit + 1) % gr_dashcount;
 		}
@@ -427,7 +482,7 @@
 		while (y1 <= y2) {
 			if (GdClipPoint(psd, x, y1)) {
 				temp = MWMIN(clipmaxy, y2);
-				psd->DrawVertLine(psd, x, y1, temp, gr_foreground);
+				psd_DrawVertLine(psd, x, y1, temp, gr_foreground);
 			} else
 				temp = MWMIN(clipmaxy, y2);
 			y1 = temp + 1;
@@ -438,7 +493,7 @@
 		/* We want to draw a dashed line instead */
 		for (p = y1; p <= y2; p++) {
 			if ((gr_dashmask & (1<<bit)) && GdClipPoint(psd, x, p))
-				psd->DrawPixel(psd, x, p, gr_foreground);
+				psd_DrawPixel(psd, x, p, gr_foreground);
 
 			bit = (bit + 1) % gr_dashcount;
 		}
@@ -515,7 +570,7 @@
 	 */
 	switch (GdClipArea(psd, x1, y1, x2, y2)) {
 	case CLIP_VISIBLE:
-		psd->FillRect(psd, x1, y1, x2, y2, gr_foreground);
+		psd_FillRect(psd, x1, y1, x2, y2, gr_foreground);
 		GdFixCursor(psd);
 		return;
 
@@ -568,7 +623,7 @@
 		return;
 
 	if (gr_usebg)
-		psd->FillRect(psd, x, y, x + width - 1, y + height - 1,
+		psd_FillRect(psd, x, y, x + width - 1, y + height - 1,
 			gr_background);
 
 	/* FIXME think of the speedups if this existed...
@@ -586,7 +641,7 @@
 		}
 		/* draw without clipping*/
 		if (MWIMAGE_TESTBIT(bitvalue))
-			psd->DrawPixel(psd, x, y, gr_foreground);
+			psd_DrawPixel(psd, x, y, gr_foreground);
 		bitvalue = MWIMAGE_SHIFTBIT(bitvalue);
 		bitcount--;
 		if (x++ == maxx) {
@@ -640,7 +695,7 @@
 			bitvalue = *imagebits++;
 		}
 		if (MWIMAGE_TESTBIT(bitvalue) && GdClipPoint(psd, x, y))
-			psd->DrawPixel(psd, x, y, gr_foreground);
+			psd_DrawPixel(psd, x, y, gr_foreground);
 			bitvalue = MWIMAGE_SHIFTBIT(bitvalue);
 			bitcount--;
 		if (x++ == maxx) {
@@ -911,7 +966,7 @@
 			}
 
 			if (clip == CLIP_VISIBLE || GdClipPoint(psd, x, y))
-				psd->DrawPixel(psd, x, y, pixel);
+				psd_DrawPixel(psd, x, y, pixel);
 
 			if (x++ == maxx) {
 				/* printf("EOL\n  "); */
@@ -975,7 +1030,7 @@
 
 				if (clip == CLIP_VISIBLE
 				    || GdClipPoint(psd, x, y))
-					psd->DrawPixel(psd, x, y, pixel);
+					psd_DrawPixel(psd, x, y, pixel);
 #if 0
 				/* fix: use clipmaxx to clip quicker */
 				else if (clip != CLIP_VISIBLE && !clipresult
@@ -1033,7 +1088,7 @@
 			}
 
 			if (clip == CLIP_VISIBLE || GdClipPoint(psd, x, y))
-				psd->DrawPixel(psd, x, y, pixel);
+				psd_DrawPixel(psd, x, y, pixel);
 #if 0
 			/* fix: use clipmaxx to clip quicker */
 			else if (clip != CLIP_VISIBLE && !clipresult
@@ -1541,7 +1596,7 @@
 		if (dstpsd != srcpsd)
 			GdCheckCursor(srcpsd, srcx, srcy, srcx+width-1,
 				srcy+height-1);
-		dstpsd->Blit(dstpsd, dstx, dsty, width, height,
+		psd_Blit(dstpsd, dstx, dsty, width, height,
 			srcpsd, srcx, srcy, rop);
 		GdFixCursor(dstpsd);
 		if (dstpsd != srcpsd)
@@ -1593,7 +1648,7 @@
 			GdCheckCursor(dstpsd, px1, py1, px2-1, py2-1);
 			GdCheckCursor(dstpsd, srcx, srcy,
 				srcx+width, srcy+height);
-			dstpsd->Blit(dstpsd, px1, py1, pw, ph, srcpsd,
+			psd_Blit(dstpsd, px1, py1, pw, ph, srcpsd,
 				srcx + (px1-dstx), srcy + (py1-dsty), rop);
 		}
 		++prc;
@@ -1684,7 +1739,7 @@
 	case CLIP_VISIBLE:
 		/* check cursor in src region*/
 		GdCheckCursor(dstpsd, srcx, srcy, srcx+srcw-1, srcy+srch-1);
-		dstpsd->StretchBlit(dstpsd, dstx, dsty, dstw, dsth,
+		psd_StretchBlit(dstpsd, dstx, dsty, dstw, dsth,
 			srcpsd, srcx, srcy, srcw, srch, rop);
 		GdFixCursor(dstpsd);
 		return;
@@ -1748,7 +1803,7 @@
 				/* check cursor in dest and src regions*/
 				GdCheckCursor(dstpsd, px1, py1, px2-1, py2-1);
 				GdCheckCursor(dstpsd, srcx, srcy, srcx+srcw, srcy+srch);
-				dstpsd->StretchBlit(dstpsd, px1, py1, pw, ph, srcpsd,
+				psd_StretchBlit(dstpsd, px1, py1, pw, ph, srcpsd,
 					sx, sy, sw, sh, rop);
 			}
 		}
@@ -2021,7 +2076,7 @@
 		/* FIXME: check cursor in src region */
 		/* GdCheckCursor(srcpsd, c1_x, c1_y, c2_x-1, c2_y-1); */
 		/* DPRINTF("Nano-X: GdStretchBlitEx: no more clipping needed\n"); */
-		dstpsd->StretchBlitEx(dstpsd,
+		psd_StretchBlitEx(dstpsd,
 					srcpsd,
 					c1_x,
 					c1_y,
@@ -2093,7 +2148,7 @@
 			/* check cursor in dest region */
 			GdCheckCursor(dstpsd, r1_x, r1_y, r2_x - 1,
 					  r2_y - 1);
-			dstpsd->StretchBlitEx(dstpsd,
+			psd_StretchBlitEx(dstpsd,
 						srcpsd,
 						r1_x,
 						r1_y,
diff -ur microwindows-0.91.orig/src/nanox/srvmain.c microwindows-0.91/src/nanox/srvmain.c
--- microwindows-0.91.orig/src/nanox/srvmain.c	2004-02-28 19:19:25.000000000 +0100
+++ microwindows-0.91/src/nanox/srvmain.c	2006-11-29 01:08:33.000000000 +0100
@@ -122,6 +122,43 @@
 	exit(1);
 }
 
+/* ---------------------------------------------------------------------- */
+
+#include <fcntl.h>
+#include <unistd.h>
+#include <sys/ioctl.h>
+#include "lock.h"
+#define FBIO_EINK_SENDANDDISP_NEWPIC         0x46A4
+
+extern int gOperationCounter;
+
+void RefreshCB(void *arg) {
+	char *	fbdev;
+    int frame_fd = -1;
+
+    if (gOperationCounter == 0)
+        return;
+
+	if (!(fbdev = getenv("FRAMEBUFFER")))
+		fbdev = "/dev/fb0";
+
+	LOCK(&nxGlobalLock);
+	frame_fd = open(fbdev, O_RDWR);
+	if (frame_fd < 0) {
+		printf("Can't open framebuffer device\n");
+		UNLOCK(&nxGlobalLock);
+		return;
+	}
+
+    ioctl(frame_fd, FBIO_EINK_SENDANDDISP_NEWPIC);
+    printf("Refreshing: %d\n", gOperationCounter);
+    gOperationCounter = 0;
+    
+	UNLOCK(&nxGlobalLock);
+}
+
+/* ---------------------------------------------------------------------- */
+
 /*
  * This is the main server loop which initialises the server, services
  * the clients, and shuts the server down when there are no more clients.
@@ -202,6 +239,8 @@
 	if(GsInitialize() < 0)
 		exit(1);
 
+    GdAddPeriodicTimer(750, RefreshCB, NULL);
+
 	while(1)
 		GsSelect(0L);
 	return 0;
