static const struct option lopts[] = { LOPTS_INITIALIZER, {0} };
static char * const default_resources[] = {
+ "*title: RRace",
"*game.height: 371", // 365 + 2*shadowThickness
"*game.width: 498",
shell = XtOpenApplication(app, PROGNAME, NULL, 0,
&argc, argv, (String *)default_resources,
- sessionShellWidgetClass, NULL, 0);
+ sessionShellWidgetClass, NULL, 0);
opterr = optind = 1;
while ((opt = getopt_long_only(argc, argv, "", lopts, NULL)) != -1) {
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[] = {
shell = early_setup(&app, argc, argv);
XtAppAddActions(app, (void *)menu_actions, XtNumber(menu_actions));
ui_initialize(&state, shell);
- x11_initialize(&state, XtScreen(shell));
+ x11_initialize(&state, shell);
game_reset(&state.board);
+ state.use_ewmh_icons = ewmh_probe_wm_icon(shell);
XtRealizeWidget(shell);
+ x11_redraw_icon(&state, shell);
+
return app;
}