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.
This commit is contained in:
PatR
2021-02-12 15:07:51 -08:00
parent b1097df86d
commit be9a2c2907
3 changed files with 36 additions and 5 deletions
+15
View File
@@ -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.
+18 -4
View File
@@ -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,