From: PatR Date: Fri, 12 Feb 2021 23:07:51 +0000 (-0800) Subject: X11: persistent inventory issues and hack for OSX X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=be9a2c29079a810559250838888a11ce3501b42f;p=nethack X11: persistent inventory issues and hack for OSX This hack prevents the perm_invent window for X11 on OSX from creeping every time it gets updated. It is far from perfect and at the very least ought be handled via user settable X resources rather than hardcoded values, but it's as much effort as I'm likely to spend. Add a new file containing a list of issues that ought to be fixed. The initial entries are things I noticed while experimenting with perm_invent; there is lots of older stuff that could/should be there too. I'm not sure whether the first one is OSX-specific; the others aren't. --- diff --git a/doc/fixes37.0 b/doc/fixes37.0 index 24f49d107..9c62b3086 100644 --- a/doc/fixes37.0 +++ b/doc/fixes37.0 @@ -1,4 +1,4 @@ -NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.448 $ $NHDT-Date: 1612912018 2021/02/09 23:06:58 $ +NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.450 $ $NHDT-Date: 1613171268 2021/02/12 23:07:48 $ General Fixes and Modified Features ----------------------------------- @@ -530,6 +530,8 @@ X11: was still initializing map to 'stone' instead of 'unexplored' after they became separate glyphs X11: for text map without color, add support for black&white ice; draw it in inverse video to distinguish from ordinary floor +X11+OSX: after the "bad Atom" fix (below), the persistent inventory window + crept downward every time it got updated Platform- and/or Interface-Specific Fixes diff --git a/win/X11/X11-issues.txt b/win/X11/X11-issues.txt new file mode 100644 index 000000000..dd74208e3 --- /dev/null +++ b/win/X11/X11-issues.txt @@ -0,0 +1,15 @@ +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 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 +manually. diff --git a/win/X11/winX.c b/win/X11/winX.c index b819a63e1..beaa33051 100644 --- a/win/X11/winX.c +++ b/win/X11/winX.c @@ -1,4 +1,4 @@ -/* NetHack 3.7 winX.c $NHDT-Date: 1613011899 2021/02/11 02:51:39 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.94 $ */ +/* NetHack 3.7 winX.c $NHDT-Date: 1613171266 2021/02/12 23:07:46 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.95 $ */ /* Copyright (c) Dean Luick, 1992 */ /* NetHack may be freely redistributed. See license for details. */ @@ -573,11 +573,25 @@ get_window_frame_extents(Widget w, unsigned char *data = 0; long *extents; - *top = *bottom = *left = *right = 0L; - prop = XInternAtom(dpy, "_NET_FRAME_EXTENTS", True); - if (prop == None) + if (prop == None) { + /* + * FIXME! + */ +#ifdef MACOSX + /* + * Default window manager doesn't support _NET_FRAME_EXTENTS. + * Without this position tweak, the persistent inventory window + * creeps downward by approximately the height of its title bar + * and also a smaller amount to the left every time it gets + * updated. Caveat: amount determined by trial and error and + * could change depending upon monitor resolution.... + */ + *top = 22; + *left = 0; +#endif return; + } while (XGetWindowProperty(dpy, win, prop, 0, 4, False, AnyPropertyType,