Every tab is a page now, an XmPanedWindow (mcdeSplit) holding the tab's
DtTermViews -- Xt cannot give a widget another parent, so the page is there
from the start and a split is one more view in it (_McdeTabsPageFor). The
new view is held at its share of the page's height until the paned window
has laid it out, then gets the keyboard; a pane keeps at least 60 pixels.
Ctrl+Shift+W closes the view, the tab with its last, the window with its
last tab. Tested on Xvfb: two terminals in one tab, typing goes to the new
one, closing it keeps dtterm running, Ctrl+Shift+T still opens a tab.
Open: after closing a pane the window shrinks to the one left.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Dropdown.c: full width, 40 % of the screen high, override-redirect, hidden
until its key (resource dropdownKey, F12); then it slides down in 8 steps to
below the top bar and takes the keyboard, the key sends it back up. The key
is grabbed on the root window (with the CapsLock/NumLock combinations, a
BadAccess is reported) and taken in dtterm's own event dispatcher
(XtSetEventDispatcher): registering the root window with a widget did not
bring it. Xsession.d/0085.dtdropdown starts it in every session.
Tested on Xvfb with dtwm and dtbar: hidden at start, down on F12 below the
bar with the keyboard (typed 'echo dropped down'), up again on F12.
xdotool key F12 maps F12 to a spare keycode the grab never sees; the test
sends an XTest event on F12's own keycode.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dtterm does not call DtInitialize: it starts the program side itself
(_DtMcdeGlobalMenuInitialize, declared in Mcde/GlobalMenu.h when Xt is in).
McdeGlobalMenu.c keeps all menu bars (dtterm has one per tab), hides any the
program manages while the bar runs (Xt change hook) and exports the first
that lives. dtterm's menus follow the tab with the focus
(_DtTermViewMenuSetCurrent, setContext split into contextFor), since from the
bar they are not posted from the tab. dtbar defers a new menu text while one
of its menus is open (the open menu was pulled away under the click).
Tested on Xvfb: dtterm's Window/Edit/Options/Help in the bar, no menu bar in
the window with two tabs, Window > New Tab from the bar makes the third.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Profiles.c reads ~/.dt/dtterm.profiles (else the config/ one), plain C with
its test (make check: PASS test_profiles). A view with a profile is named
profile_<name>; its colours are resources of that name, its font an Xft
render table that TermView now passes on to the terminal, its command
DtNsubprocessArgv unless -e gave one. Ctrl+Shift+T keeps the profile of
the tab; the Window menu gets New Tab and New Tab with Profile through a
hook in TermViewMenu.c; dtterm -profile NAME, and "Default" to start with.
Tested on Xvfb with dtwm: -profile, a tab by key, a tab by the menu.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
programs/dtterm/Tabs.c: the window holds an XmTabStack, every tab a whole
DtTermView (its own process, menu, scroll bar); a tab whose shell exits
closes alone, the window with its last tab; the keyboard follows the tab
in front. DtTermMain.c: views go into the container, the window's menu
toggle and close callback belong to the first tab, NewTab for Ctrl+Shift+T,
ShellOf where the code took the view's parent for the shell (session
save, clone). TermParse.c: a title set by a program goes to its tab, and
to the window only from the tab in front.
Found on the way: XmTabStack has a child of its own (the bar of tabs);
counting it as a tab crashed Ctrl+Shift+Left and kept the first tab from
registering the close callback.
Tested on Xvfb with dtwm and xdotool (build/mcde-shots/tabs-*.png): two
tabs, titles 'second' / 'first' on switching, one closed, dtterm running.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fonts:
- fonts/hack: Hack 3.003 (Expat + Bitstream Vera, from Debian fonts-hack),
installed to dt/fonts; config/fonts.conf (the system's fontconfig plus
that directory) exported by Xsession.d/0070.dtfonts and
Dtlogin*environment.
- sys.resources and dtlogin Xresources: Xft render tables in Hack 10 for
renderTable, textRenderTable, labelRenderTable, buttonRenderTable (a
render table wins over sys.font's *FontList; dtterm and text fields read
the text table).
dtterm (ported from MakroDE -- setlocale and the Xft renderer -- then fixed):
- configure: Xft on by default, --disable-xft for machines without it.
- TermPrimRenderXft.c: reads wchar_t in multibyte locales (it read the
buffer as UTF-8 bytes: three boxes after every character), places every
character in its cell on the baseline, fills the background, draws
underline/overstrike/secure, wcwidth for wide and combining characters,
borrows glyphs from fontconfig fallbacks (check mark, CJK), and makes its
XftDraw at the first drawing (made in Initialize it was window 0, and the
first string a BadDrawable that ended dtterm).
- TermPrim.c AdjustWindowUnits: the cell from the renderer's extents when
there is no XFontStruct (crashed with Xft); _DtTermPrimRenderFontExtents.
- TermPrimRenderFont.c: with setlocale the buffer is wchar_t in UTF-8, the
single-font renderer draws it as XChar2b (it drew boxes too).
Screenshots: build/mcde-shots/dtterm-utf8b-crop.png, dtterm-classic-crop.png.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cde-2.5.3.tar.gz, SHA512 a01b413b... as in pkgsrc distinfo; recipe from
pkgsrc 3c1118e94432. Added with -f: CDE's .gitignore hides 612 files of
the archive.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>