]> git.draconx.ca Git - rrace.git/blobdiff - src/motif.c
Implement window icons.
[rrace.git] / src / motif.c
index f98b3078b2fbb5600a611df90907f25830f3e39f..52afaaecaf9ff2d89ac6be4fbc8103ed9854c214 100644 (file)
@@ -135,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_icon(&state, shell);
 }
 
 static const XtActionsRec menu_actions[] = {
@@ -158,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;
 }