]> git.draconx.ca Git - rrace.git/blobdiff - src/motif.c
Reduce the amount of redundant drawing in the goal area.
[rrace.git] / src / motif.c
index f9366f7f30b4e2ac1ca5539df03cace02c273f12..a829cf78b0f6389c1be619a1d9001c32311e1093 100644 (file)
@@ -75,7 +75,6 @@ static void print_help(void)
        puts("Options:");
        for (opt = lopts; opt->name; opt++) {
                struct lopt_help help;
-               int w;
 
                if (!lopt_get_help(opt, &help))
                        continue;
@@ -136,9 +135,15 @@ static void proc_exit(Widget w, XEvent *e, String *argv, Cardinal *argc)
 
 static void proc_new_game(Widget w, XEvent *e, String *argv, Cardinal *argc)
 {
+       Widget shell;
+
+       for (shell = w; !XtIsWMShell(shell);)
+               shell = XtParent(shell);
+
        game_reset(&state.board);
-       x11_redraw_goal(&state);
-       x11_redraw_game(&state);
+       x11_redraw_goal(&state, -1);
+       x11_redraw_game(&state, -1);
+       x11_redraw_icon(&state, shell);
 }
 
 static const XtActionsRec menu_actions[] = {
@@ -159,8 +164,11 @@ static XtAppContext app_initialize(int argc, char **argv)
        ui_initialize(&state, shell);
        x11_initialize(&state, XtScreen(shell));
        game_reset(&state.board);
+       state.use_ewmh_icons = ewmh_probe_wm_icon(shell);
        XtRealizeWidget(shell);
 
+       x11_redraw_icon(&state, shell);
+
        return app;
 }