Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[xsrc/trunk]: xsrc/external/mit/ctwm/dist Merge ctwm-4.1.0
details: https://anonhg.NetBSD.org/xsrc/rev/57300a28775c
branches: trunk
changeset: 7576:57300a28775c
user: nia <nia%NetBSD.org@localhost>
date: Wed Jul 05 08:39:10 2023 +0000
description:
Merge ctwm-4.1.0
diffstat:
external/mit/ctwm/dist/add_window.c | 172 +-
external/mit/ctwm/dist/ctwm.1 | 266 +-
external/mit/ctwm/dist/ctwm.h | 38 +-
external/mit/ctwm/dist/ctwm_atoms.c | 2 +-
external/mit/ctwm/dist/ctwm_atoms.h | 2 +-
external/mit/ctwm/dist/ctwm_config.h | 34 +-
external/mit/ctwm/dist/cursor.c | 15 +-
external/mit/ctwm/dist/deftwmrc.c | 67 +-
external/mit/ctwm/dist/event_names_table.h | 2 +-
external/mit/ctwm/dist/ewmh_atoms.c | 6 +-
external/mit/ctwm/dist/ewmh_atoms.h | 68 +-
external/mit/ctwm/dist/functions_deferral.h | 16 +-
external/mit/ctwm/dist/functions_defs.h | 24 +-
external/mit/ctwm/dist/functions_dispatch_execution.h | 18 +-
external/mit/ctwm/dist/functions_parse_table.h | 18 +-
external/mit/ctwm/dist/gram.tab.c | 4094 +++++++++++++++++
external/mit/ctwm/dist/gram.tab.h | 201 +
external/mit/ctwm/dist/gram.y | 42 +-
external/mit/ctwm/dist/iconmgr.c | 52 +-
external/mit/ctwm/dist/iconmgr.h | 9 +-
external/mit/ctwm/dist/icons.c | 6 +-
external/mit/ctwm/dist/list.c | 3 +-
external/mit/ctwm/dist/menus.c | 182 +-
external/mit/ctwm/dist/menus.h | 3 +
external/mit/ctwm/dist/parse.c | 1 -
external/mit/ctwm/dist/screen.h | 20 +-
external/mit/ctwm/dist/session.c | 41 +-
external/mit/ctwm/dist/session.h | 21 +-
external/mit/ctwm/dist/types.h | 6 +-
external/mit/ctwm/dist/util.c | 86 +-
external/mit/ctwm/dist/util.h | 18 +-
external/mit/ctwm/dist/version.c | 6 +-
external/mit/ctwm/dist/vscreen.c | 72 +-
external/mit/ctwm/dist/vscreen.h | 3 +-
external/mit/ctwm/dist/windowbox.c | 4 +-
35 files changed, 5201 insertions(+), 417 deletions(-)
diffs (truncated from 7171 to 300 lines):
diff -r e0357383ea8c -r 57300a28775c external/mit/ctwm/dist/add_window.c
--- a/external/mit/ctwm/dist/add_window.c Wed Jul 05 07:36:06 2023 +0000
+++ b/external/mit/ctwm/dist/add_window.c Wed Jul 05 08:39:10 2023 +0000
@@ -34,7 +34,9 @@
#include <X11/extensions/shape.h>
#include "add_window.h"
+#ifdef CAPTIVE
#include "captive.h"
+#endif
#include "colormaps.h"
#include "ctwm_atoms.h"
#include "functions.h"
@@ -51,17 +53,25 @@
#include "occupation.h"
#include "otp.h"
#include "parse.h"
+#include "r_area.h"
+#include "r_layout.h"
#include "screen.h"
+#ifdef SESSION
#include "session.h"
+#endif
#include "util.h"
#include "vscreen.h"
+#ifdef WINBOX
#include "windowbox.h"
+#endif
#include "win_decorations.h"
#include "win_ops.h"
#include "win_regions.h"
#include "win_resize.h"
+#include "win_ring.h"
#include "win_utils.h"
#include "workspace_manager.h"
+#include "xparsegeometry.h"
int AddingX;
@@ -71,8 +81,10 @@ unsigned int AddingH;
static int PlaceX = -1;
static int PlaceY = -1;
+#ifdef VSCREEN
static void DealWithNonSensicalGeometries(Display *dpy, Window vroot,
TwmWindow *tmp_win);
+#endif
char NoName[] = "Untitled"; /* name if no name is specified */
bool resizeWhenAdd;
@@ -105,19 +117,24 @@ AddWindow(Window w, AWType wtype, IconMg
int gravx, gravy; /* gravity signs for positioning */
int namelen;
int bw2;
+#ifdef SESSION
short restore_icon_x, restore_icon_y;
bool restore_iconified = false;
bool restore_icon_info_present = false;
+#endif
bool restoredFromPrevSession = false;
int saved_occupation = 0; /* <== [ Matthew McNeill Feb 1997 ] == */
bool random_placed = false;
+#ifdef WINBOX
WindowBox *winbox;
+#endif
Window vroot;
#ifdef DEBUG
fprintf(stderr, "AddWindow: w = 0x%x\n", w);
#endif
+#ifdef CAPTIVE
/*
* Possibly this window should be in a captive sub-ctwm? If so, we
* shouldn't mess with it at all.
@@ -126,6 +143,7 @@ AddWindow(Window w, AWType wtype, IconMg
/* XXX x-ref comment by SetNoRedirect() */
return (NULL);
}
+#endif
/*
@@ -151,7 +169,9 @@ AddWindow(Window w, AWType wtype, IconMg
tmp_win->iconmgrp = iconp;
tmp_win->iswspmgr = (wtype == AWT_WORKSPACE_MANAGER);
tmp_win->isoccupy = (wtype == AWT_OCCUPY);
+#ifdef WINBOX
tmp_win->iswinbox = (wtype == AWT_WINDOWBOX);
+#endif
tmp_win->vs = vs;
tmp_win->parent_vs = vs;
tmp_win->savevs = NULL;
@@ -257,6 +277,7 @@ AddWindow(Window w, AWType wtype, IconMg
}
+#ifdef SESSION
/*
* Look up saved X Session info for the window if we have it.
*/
@@ -291,6 +312,7 @@ AddWindow(Window w, AWType wtype, IconMg
}
}
}
+#endif
/*
@@ -321,6 +343,7 @@ AddWindow(Window w, AWType wtype, IconMg
}
}
+#ifdef SESSION
/*
* Override a few bits with saved stuff from previous session, if we
* have it.
@@ -335,6 +358,7 @@ AddWindow(Window w, AWType wtype, IconMg
tmp_win->wmhints->icon_y = restore_icon_y;
tmp_win->wmhints->flags |= IconPositionHint;
}
+#endif
/* Munge as necessary for other stuff */
munge_wmhints(tmp_win, tmp_win->wmhints);
@@ -437,20 +461,10 @@ AddWindow(Window w, AWType wtype, IconMg
&& EwmhOnWindowRing(tmp_win)
#endif /* EWMH */
&& !CHKL(WindowRingExcludeL))) {
- if(Scr->Ring) {
- tmp_win->ring.next = Scr->Ring->ring.next;
- if(Scr->Ring->ring.next->ring.prev) {
- Scr->Ring->ring.next->ring.prev = tmp_win;
- }
- Scr->Ring->ring.next = tmp_win;
- tmp_win->ring.prev = Scr->Ring;
- }
- else {
- tmp_win->ring.next = tmp_win->ring.prev = Scr->Ring = tmp_win;
- }
+ AddWindowToRing(tmp_win);
}
else {
- tmp_win->ring.next = tmp_win->ring.prev = NULL;
+ InitWindowNotOnRing(tmp_win);
}
@@ -537,6 +551,7 @@ AddWindow(Window w, AWType wtype, IconMg
* - And specific NoTitle overrides MakeTitle.
*/
have_title = true;
+ ALLOW_DEAD_STORE(have_title);
#ifdef EWMH
have_title = EwmhHasTitle(tmp_win);
#endif /* EWMH */
@@ -575,6 +590,16 @@ AddWindow(Window w, AWType wtype, IconMg
}
+#ifdef EWMH
+ /*
+ * Now that we know the title_height and the frame border width, we
+ * can set an EWMH property to tell the client how much we're adding
+ * around them.
+ */
+ EwmhSet_NET_FRAME_EXTENTS(tmp_win);
+#endif
+
+
/*
* Need the GetWindowAttributes() call and setting ->old_bw and
* ->frame_bw3D for some of the math in looking up the
@@ -660,8 +685,10 @@ AddWindow(Window w, AWType wtype, IconMg
SetupOccupation(tmp_win, saved_occupation);
+#ifdef WINBOX
/* Does it go in a window box? */
winbox = findWindowBox(tmp_win);
+#endif
/*
@@ -703,9 +730,10 @@ AddWindow(Window w, AWType wtype, IconMg
{
char *geom = LookInListWin(Scr->WindowGeometries, tmp_win);
if(geom) {
- int mask = XParseGeometry(geom, &tmp_win->attr.x, &tmp_win->attr.y,
- (unsigned int *) &tmp_win->attr.width,
- (unsigned int *) &tmp_win->attr.height);
+ int mask = RLayoutXParseGeometry(Scr->Layout, geom,
+ &tmp_win->attr.x, &tmp_win->attr.y,
+ (unsigned int *) &tmp_win->attr.width,
+ (unsigned int *) &tmp_win->attr.height);
if(mask & XNegative) {
tmp_win->attr.x += Scr->rootw - tmp_win->attr.width;
@@ -726,9 +754,11 @@ AddWindow(Window w, AWType wtype, IconMg
vroot = Scr->Root; /* never */
tmp_win->parent_vs = Scr->currentvs;
}
+#ifdef WINBOX
if(winbox) {
vroot = winbox->window;
}
+#endif
/*
@@ -842,7 +872,7 @@ AddWindow(Window w, AWType wtype, IconMg
pixels less wide than the screen. */
if((tmp_win->attr.x + tmp_win->attr.width) > Scr->rootw) {
available = Scr->rootw - tmp_win->attr.width
- - 2 * (bw2 + tmp_win->frame_bw3D);
+ - 2 * tmp_win->frame_bw3D - bw2;
#ifdef DEBUG
fprintf(stderr, "DEBUG[DontMoveOff]: availableX: %d\n",
@@ -872,7 +902,8 @@ AddWindow(Window w, AWType wtype, IconMg
with the title height and the frame widths. */
if((tmp_win->attr.y + tmp_win->attr.height) > Scr->rooth) {
available = Scr->rooth - tmp_win->attr.height
- - tmp_win->title_height - 2 * (bw2 + tmp_win->frame_bw3D);
+ - tmp_win->title_height
+ - 2 * tmp_win->frame_bw3D - bw2;
#ifdef DEBUG
fprintf(stderr, "DEBUG[DontMoveOff]: availableY: %d\n",
@@ -968,9 +999,11 @@ AddWindow(Window w, AWType wtype, IconMg
}
firsttime = false;
}
+#ifdef WINBOX
if(winbox) {
vroot = winbox->window;
}
+#endif
/*
* wait for buttons to come up; yuck
@@ -1007,8 +1040,9 @@ AddWindow(Window w, AWType wtype, IconMg
Scr->SizeStringOffset = width + logical_rect.width;
}
- XResizeWindow(dpy, Scr->SizeWindow, Scr->SizeStringOffset +
- Scr->SizeStringWidth + SIZE_HINDENT, height);
+ MoveResizeSizeWindow(AddingX, AddingY,
+ Scr->SizeStringOffset + Scr->SizeStringWidth + SIZE_HINDENT,
+ height);
XMapRaised(dpy, Scr->SizeWindow);
InstallRootColormap();
FB(Scr->DefaultC.fore, Scr->DefaultC.back);
@@ -1017,9 +1051,11 @@ AddWindow(Window w, AWType wtype, IconMg
SIZE_VINDENT + Scr->SizeFont.ascent,
tmp_win->name, namelen);
+#ifdef WINBOX
if(winbox) {
ConstrainedToWinBox(tmp_win, AddingX, AddingY, &AddingX, &AddingY);
}
+#endif
AddingW = tmp_win->attr.width + bw2 + 2 * tmp_win->frame_bw3D;
AddingH = tmp_win->attr.height + tmp_win->title_height +
@@ -1036,8 +1072,8 @@ AddWindow(Window w, AWType wtype, IconMg
* The TryTo*() and DoResize() calls below rely on having
* frame_{width,height} set, so set them.
*/
- tmp_win->frame_width = AddingW;
- tmp_win->frame_height = AddingH;
+ tmp_win->frame_width = AddingW - bw2;
+ tmp_win->frame_height = AddingH - bw2;
/*SetFocus (NULL, CurrentTime);*/
while(1) {
if(Scr->OpenWindowTimeout) {
@@ -1119,8 +1155,9 @@ AddWindow(Window w, AWType wtype, IconMg
": ", 2, NULL, &logical_rect);
Scr->SizeStringOffset = width + logical_rect.width;
- XResizeWindow(dpy, Scr->SizeWindow, Scr->SizeStringOffset +
- Scr->SizeStringWidth + SIZE_HINDENT, height);
+ MoveResizeSizeWindow(event.xbutton.x_root, event.xbutton.y_root,
+ Scr->SizeStringOffset + Scr->SizeStringWidth + SIZE_HINDENT,
+ height);
XmbDrawImageString(dpy, Scr->SizeWindow, Scr->SizeFont.font_set,
Scr->NormalGC, width,
@@ -1206,18 +1243,23 @@ AddWindow(Window w, AWType wtype, IconMg
}
}
else if(event.xbutton.button == Button3) {
- int maxw = Scr->rootw - Scr->BorderRight - AddingX - bw2;
- int maxh = Scr->rooth - Scr->BorderBottom - AddingY - bw2;
+ RArea area;
+ int max_bottom, max_right;
+
+ area = RAreaNew(AddingX, AddingY, AddingW, AddingH);
+
+ max_bottom = RLayoutFindMonitorBottomEdge(Scr->BorderedLayout, &area) - bw2;
Home |
Main Index |
Thread Index |
Old Index