1 diff -aur jnethack/include/config.h new/include/config.h
2 --- jnethack/include/config.h Sat Jan 4 22:24:22 2003
3 +++ new/include/config.h Fri Jan 3 03:02:52 2003
5 # define GRAPHIC_TOMBSTONE /* Use graphical tombstone (rip.xpm) */
6 # define X11LARGETILE /* Large tile for X11 */
8 +# define X11CENTERPOPUPS /* Popup dialogs at the center of window */
12 diff -aur jnethack/include/winX.h new/include/winX.h
13 --- jnethack/include/winX.h Sat Jan 4 23:23:03 2003
14 +++ new/include/winX.h Fri Jan 3 02:13:30 2003
16 int tombtext_dx; /* x-displacement between tombstone line */
17 int tombtext_dy; /* y-displacement between tombstone line */
19 +#ifdef X11CENTERPOPUPS
20 + Boolean center_popups; /* to centre popups over the main window */
24 E AppResources appResources;
25 diff -aur jnethack/win/X11/JNetHack.ad new/win/X11/JNetHack.ad
26 --- jnethack/win/X11/JNetHack.ad Sat Jan 4 22:27:07 2003
27 +++ new/win/X11/JNetHack.ad Fri Jan 3 01:55:18 2003
29 ! If your window manager does click-to-focus, you'll probably want this False.
30 !JNetHack*autofocus: True
32 +! If True, popup windows are centred over the main nethack window. If False,
33 +! they're positioned under the mouse. True is useful with a click-to-focus
34 +! style window manager where you leave the mouse to one side when not in use.
35 +!JNetHack*centerPopups: True
37 ! Specify the number of rows and columns of the map window. The default
38 ! is the standard 80x21 window. Note: this _does_not_ change JNetHack's
39 ! level size, only what you see of it.
40 diff -aur jnethack/win/X11/dialogs.c new/win/X11/dialogs.c
41 --- jnethack/win/X11/dialogs.c Sat Jan 4 23:32:10 2003
42 +++ new/win/X11/dialogs.c Sat Jan 4 23:31:07 2003
47 +#ifdef X11CENTERPOPUPS
52 /* ":" added to both translations below to allow limited redefining of
53 * keysyms before testing for keysym values -- dlc */
54 static const char okay_accelerators[] =
56 /* following line deals with a race condition w/brain-damaged WM's -dlc */
59 +#ifndef X11CENTERPOPUPS
60 XQueryPointer(XtDisplay(toplevel), XtWindow(toplevel), &root, &child,
61 &x, &y, &dummyx, &dummyy, &dummymask);
63 + if (appResources.center_popups) {
64 + /* At startup the toplevel window can have a negative x or y,
65 + * and if that happens they're interpreted as zero.
67 + Dimension toplevel_width, toplevel_height;
68 + Position toplevel_x, toplevel_y;
69 + XtVaGetValues (toplevel,
70 + XtNwidth, &toplevel_width, XtNheight, &toplevel_height,
72 + XtTranslateCoords(toplevel, 0, 0, &toplevel_x, &toplevel_y);
73 + if (toplevel_x < 0) toplevel_x = 0;
74 + if (toplevel_y < 0) toplevel_y = 0;
75 + x = toplevel_x + toplevel_width / 2;
76 + y = toplevel_y + toplevel_height / 2;
79 + XQueryPointer(XtDisplay(toplevel), XtWindow(toplevel), &root, &child,
80 + &x, &y, &dummyx, &dummyy, &dummymask);
84 XtSetArg(args[num_args], XtNwidth, &width); num_args++;
85 XtSetArg(args[num_args], XtNheight, &height); num_args++;
86 diff -aur jnethack/win/X11/winX.c new/win/X11/winX.c
87 --- jnethack/win/X11/winX.c Sat Jan 4 22:25:17 2003
88 +++ new/win/X11/winX.c Fri Jan 3 02:13:28 2003
89 @@ -1004,6 +1004,10 @@
90 { "tombtext_dy", "Tombtext_dy", XtRInt, sizeof(int),
91 XtOffset(AppResources *,tombtext_dy), XtRString, "13" },
93 +#ifdef X11CENTERPOPUPS
94 + { "centerPopups", "CenterPopups", XtRBoolean, sizeof(Boolean),
95 + XtOffset(AppResources *,center_popups), XtRImmediate, False },