[tex-k] Problem with "mf" online display in GNOME

Paul Vojta vojta at math.berkeley.edu
Fri May 26 09:07:37 CEST 2017


Dear all,

I have my own suggestion for a patch (attached).

I can work up a similar patch for x11-Xlib.c (I think).
Expose events can be handled via backing-store, as is done in Xt.
But not tonight.

As for slimming down the build, I can't offer any suggestion.  However,
once it's built, you can cd to texk/web2c and type "make mf" to re-build
just mf.

Paul


On Fri, May 26, 2017 at 12:43:08PM +0700, Igor Liferenko wrote:
> Hi Karl and all,
> 
> I have found the solution which works perfectly for me. The patch is attached.
> For now, this is all that I have to offer. But I'm ready to help with testing
> if you have any ideas.
> 
> I suggest that TL will use --with-mf-x-toolkit (like it is done in Debian
> build), because with Xlib the drawing is erased when it is overlapped by
> another window (as described by Paul Vojta), whereas with Xt this does not
> happen.
> 
> For those who may need this, here are the steps which
> I performed to build local variant of MetaFont:
> 
> sudo apt-get install libxt-dev texinfo
> mkdir mydir && cd mydir
> rsync -a --delete --exclude=.svn --exclude=Work
> tug.org::tldevsrc/Build/source/ .
> mkdir Work && cd Work
> ../configure --disable-all-pkgs --disable-native-texlive-build
> --enable-web2c --with-mf-x-toolkit
> make
> cd texk/web2c/
> MFINPUTS=/usr/share/texlive/texmf-dist/metafont/base/:/usr/share/texlive/texmf-dist/metafont/misc/:.
> ./mf -ini -jobname mf '\input plain input modes dump' # or download
> plain.mf and modes.mf from internet
> MFBASES=. MFINPUTS=. ./mf test
> 
> Many thanks to Karl and Paul for your help and ideas.
> 
> Igor
> 
> P.S. Is it possible to reduce the present build even more, to a bare
> minimum - just to get a working "mf" binary? (for example, how to exclude
> luatex and libicu builds?)

> --- mydir.orig/texk/web2c/window/x11-Xt.c
> +++ mydir/texk/web2c/window/x11-Xt.c
> @@ -168,6 +168,8 @@
>  		screendepth > mf_x11_resources.mf_height
>  	        ? screendepth : mf_x11_resources.mf_height);
>  
> +  usleep(100000);
> +
>    return 1;
>  }
>  

-------------- next part --------------
--- x11-Xt.c.orig	2010-02-22 04:09:38.000000000 -0800
+++ x11-Xt.c	2017-05-25 23:57:13.994779867 -0700
@@ -42,7 +42,8 @@
 
 
 /* Don't paint anything until we're mapped.  */
-static Boolean mf_mapped;
+static Boolean mf_mapped = False;
+static Boolean mf_awaiting_expose = True;
 
 #ifdef MF_XT_DEBUG
 static int mf_max_x, mf_max_y;
@@ -150,10 +151,8 @@
      sits in XTMainLoop, if the server supports backing store
      and save unders this will help keep the output looking
      nice.  */
-  xwa.backing_store = Always;
-  xwa.save_under = True;
-  XChangeWindowAttributes (mf_display, mf_window,
-			   CWBackingStore | CWSaveUnder, &xwa);
+  xwa.backing_store = WhenMapped;
+  XChangeWindowAttributes (mf_display, mf_window, CWBackingStore, &xwa);
 
   gcv.background = mf_x11_resources.mf_bg;
   gcv.foreground = mf_x11_resources.mf_fg;
@@ -174,7 +173,14 @@
 void
 mf_x11_updatescreen (void)
 {
+  XEvent event;
+
   mf_events ();
+  while (mf_awaiting_expose)
+    {
+      XtAppNextEvent (mf_app, &event);
+      XtDispatchEvent (&event);
+    }
   mf_redraw ();
 
 #ifdef MF_XT_DEBUG
@@ -327,6 +333,7 @@
 	continue;
 
       mf_redraw ();
+      mf_awaiting_expose = False;
     }
 }
 


More information about the tex-k mailing list