]> git.draconx.ca Git - rrace.git/blobdiff - src/motif_ui.c
Fix distribution of src/cursesui.h.
[rrace.git] / src / motif_ui.c
index 05721e09a95b1515dcf79feb25b7f54320f43c04..fefcfedef7505a6509074f76e5ffe1d2e9d57ecb 100644 (file)
@@ -22,7 +22,6 @@
 #include <Xm/XmAll.h>
 
 #include "motif.h"
-#include "motifstr.h"
 #include "motifgui.h"
 #include "xcounter.h"
 #include "version.h"
@@ -324,6 +323,8 @@ static void game_expose(Widget w, void *data, void *cb_data)
 {
        XmDrawingAreaCallbackStruct *cbs = cb_data;
        XExposeEvent *e = &cbs->event->xexpose;
+       struct app_state *state = data;
+       uint_least32_t *gp = state->board.game;
        Dimension width, height;
        uint_fast32_t mask;
 
@@ -331,8 +332,15 @@ static void game_expose(Widget w, void *data, void *cb_data)
        if (!(width /= 5) || !(height /= 5))
                return;
 
-       mask = expose_mask(e->x, e->y, e->width, e->height, width, height);
-       x11_redraw_game(data, mask);
+       /*
+        * Only draw exposed nonempty tiles; exposed areas are filled with the
+        * background automatically and thus exposed empty spaces don't need
+        * to be drawn again.
+        */
+       mask = gp[0] | gp[1] | gp[2];
+       mask &= expose_mask(e->x, e->y, e->width, e->height, width, height);
+
+       x11_redraw_game(state, mask);
 }
 
 static void goal_expose(Widget w, void *data, void *cb_data)
@@ -409,7 +417,10 @@ void ui_show_about(struct app_state *state, Widget shell)
 
        msg = version_format_head("rrace-motif");
        l = XmMessageBoxGetChild(w, XmDIALOG_MESSAGE_LABEL);
-       XtVaSetValues(l, XmNlabelType, XmPIXMAP_AND_STRING,
+       XtVaSetValues(l, XmNlabelType, XmSTRING,
+#if HAVE_MOTIF_PIXMAP_AND_STRING
+                        XmNlabelType, XmPIXMAP_AND_STRING,
+#endif
                         XmNlabelPixmap, state->icon_pixmap,
                         STRING_ARG(XmNlabelString, msg),
                         (char *)NULL);