-NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.451 $ $NHDT-Date: 1613258116 2021/02/13 23:15:16 $
+NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.452 $ $NHDT-Date: 1613272633 2021/02/14 03:17:13 $
General Fixes and Modified Features
-----------------------------------
X11: stop including unused column 0 in the map
X11: avoid 'bad Atom X Error' when perm_invent is enabled (seemingly window
manager dependent)
+X11: toggling 'perm_invent' off via 'O' didn't dismiss persistent inventory
+ window
+X11: (possibly X11+OSX): if persistent inventory was displayed at time of
+ end-of-game prompting, prompting would stall until that window was
+ manually dismissed
General New Features
-/* NetHack 3.7 winX.h $NHDT-Date: 1611697182 2021/01/26 21:39:42 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.42 $ */
+/* NetHack 3.7 winX.h $NHDT-Date: 1613272633 2021/02/14 03:17:13 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.45 $ */
/* Copyright (c) Dean Luick, 1992 */
/* NetHack may be freely redistributed. See license for details. */
/* ### winmenu.c ### */
extern void menu_delete(Widget, XEvent *, String *, Cardinal *);
extern void menu_key(Widget, XEvent *, String *, Cardinal *);
+extern void x11_no_perminv(struct xwindow *);
extern void create_menu_window(struct xwindow *);
extern void destroy_menu_window(struct xwindow *);
-End of game stalls after death is reported if the persistent inventory
-window is shown at the time. Closing it manually lets the game-over
-sequence proceed. Answering 'y' to "Really quit?" and any valid response
-to "Dump core?" behaves likewise.
-
-Toggling 'perm_invent' Off with the 'O' command while the persistent
-inventory window is displayed does not remove it.
-
Starting or restoring a game with 'perm_invent' enabled via config file
or NETHACKOPTIONS does not begin with inventory shown.
+When persistent inventory window is first populated, focus is given to
+its window (behavior might be window manager-specific; it happens with
+default window manager on OSX). Focus should be explicitly directed
+back to the main window.
+
When persistent inventory window is displayed, an update that ought to
make it grow won't do so even if there is room on the screen for that.
It will add scrollbar(s) when not already there, and it can be resized
-/* NetHack 3.7 winX.c $NHDT-Date: 1613171266 2021/02/12 23:07:46 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.95 $ */
+/* NetHack 3.7 winX.c $NHDT-Date: 1613272634 2021/02/14 03:17:14 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.96 $ */
/* Copyright (c) Dean Luick, 1992 */
/* NetHack may be freely redistributed. See license for details. */
void
X11_update_inventory(void)
{
- if (x_inited && window_list[WIN_INVEN].menu_information->is_up) {
- updated_inventory = 1; /* hack to avoid mapping&raising window */
- (void) display_inventory((char *) 0, FALSE);
- updated_inventory = 0;
+ if (!x_inited)
+ return;
+
+ if (window_list[WIN_INVEN].menu_information->is_up) {
+ if (iflags.perm_invent) {
+ updated_inventory = 1; /* hack to avoid mapping&raising window */
+ (void) display_inventory((char *) 0, FALSE);
+ updated_inventory = 0;
+ } else {
+ x11_no_perminv(&window_list[WIN_INVEN]);
+ }
}
}
-/* NetHack 3.7 winmenu.c $NHDT-Date: 1596498373 2020/08/03 23:46:13 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.39 $ */
+/* NetHack 3.7 winmenu.c $NHDT-Date: 1613272635 2021/02/14 03:17:15 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.42 $ */
/* Copyright (c) Dean Luick, 1992 */
/* NetHack may be freely redistributed. See license for details. */
/* Global functions ======================================================= */
+/* called by X11_update_inventory() if persistent inventory is currently
+ displayed but the 'perm_invent' option is now Off */
+void
+x11_no_perminv(struct xwindow *wp)
+{
+ if (wp && wp->type == NHW_MENU && wp->menu_information->is_up) {
+ destroy_menu_entry_widgets(wp);
+ nh_XtPopdown(wp->popup);
+ XtDestroyWidget(wp->popup);
+ wp->w = wp->popup = (Widget) 0;
+ wp->menu_information->is_up = FALSE;
+ }
+}
+
void
X11_start_menu(winid window, unsigned long mbehavior UNUSED)
{