]> granicus.if.org Git - nethack/commitdiff
X11: persistent inventory issues and hack for OSX
authorPatR <rankin@nethack.org>
Fri, 12 Feb 2021 23:07:51 +0000 (15:07 -0800)
committerPatR <rankin@nethack.org>
Fri, 12 Feb 2021 23:07:51 +0000 (15:07 -0800)
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.

doc/fixes37.0
win/X11/X11-issues.txt [new file with mode: 0644]
win/X11/winX.c

index 24f49d107a8c4a4efddec37bbd3e8ede7ed6db51..9c62b3086d1f339980460ef5ab828e3663d15b36 100644 (file)
@@ -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 (file)
index 0000000..dd74208
--- /dev/null
@@ -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.
index b819a63e19548d6c7dacac4c71c8587e6af9a3ab..beaa3305117c4f621922352d180eebf8d50a439c 100644 (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,