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
+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,