MCPcopy Create free account
hub / github.com/NetHack/NetHack / X11_destroy_nhwindow

Function X11_destroy_nhwindow

win/X11/winX.c:1223–1282  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1221}
1222
1223void
1224X11_destroy_nhwindow(winid window)
1225{
1226 struct xwindow *wp;
1227
1228 check_winid(window);
1229 wp = &window_list[window];
1230 /*
1231 * "Zap" known windows, but don't destroy them. We need to keep the
1232 * toplevel widget popped up so that later windows (e.g. tombstone)
1233 * are visible on DECWindow systems. This is due to the virtual
1234 * roots that the DECWindow wm creates.
1235 */
1236 if (window == WIN_MESSAGE) {
1237 wp->keep_window = TRUE;
1238 WIN_MESSAGE = WIN_ERR;
1239 iflags.window_inited = 0;
1240 } else if (window == WIN_MAP) {
1241 wp->keep_window = TRUE;
1242 WIN_MAP = WIN_ERR;
1243 } else if (window == WIN_STATUS) {
1244 wp->keep_window = TRUE;
1245 WIN_STATUS = WIN_ERR;
1246 } else if (window == WIN_INVEN) {
1247 /* don't need to keep this one */
1248 WIN_INVEN = WIN_ERR;
1249 }
1250
1251 if (wp->boldfs) {
1252 XFreeFont(wp->boldfs_dpy, wp->boldfs);
1253 wp->boldfs = (XFontStruct *) 0;
1254 wp->boldfs_dpy = (Display *) 0;
1255 }
1256
1257 if (wp->title) {
1258 free(wp->title);
1259 wp->title = (char *) 0;
1260 }
1261
1262 switch (wp->type) {
1263 case NHW_MAP:
1264 destroy_map_window(wp);
1265 break;
1266 case NHW_MENU:
1267 destroy_menu_window(wp);
1268 break;
1269 case NHW_TEXT:
1270 destroy_text_window(wp);
1271 break;
1272 case NHW_STATUS:
1273 destroy_status_window(wp);
1274 break;
1275 case NHW_MESSAGE:
1276 destroy_message_window(wp);
1277 break;
1278 default:
1279 panic("destroy_nhwindow: unknown window type [%d]", wp->type);
1280 break;

Callers 4

X11_putstrFunction · 0.85
X11_exit_nhwindowsFunction · 0.85
X11_display_fileFunction · 0.85
X11_select_menuFunction · 0.85

Calls 6

destroy_map_windowFunction · 0.85
destroy_menu_windowFunction · 0.85
destroy_text_windowFunction · 0.85
destroy_status_windowFunction · 0.85
destroy_message_windowFunction · 0.85
panicFunction · 0.50

Tested by

no test coverage detected