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>
30 lines
1.0 KiB
C
30 lines
1.0 KiB
C
/*
|
|
* Tabs.h -- MCDE: tabs in a dtterm window (Tabs.c)
|
|
*
|
|
* Copyright (c) 2026 The Makronix project. GNU LGPL 2.0 or later, as CDE.
|
|
*/
|
|
|
|
#ifndef _Dtterm_Tabs_h
|
|
#define _Dtterm_Tabs_h
|
|
|
|
#include <X11/Intrinsic.h>
|
|
|
|
/* the tab container of a dtterm shell, made at the first call */
|
|
extern Widget _McdeTabsContainer(Widget shell);
|
|
/* the page (a tab, or the tab being split) a new view of SHELL goes into */
|
|
extern Widget _McdeTabsPageFor(Widget shell);
|
|
/* the number of tabs in a container */
|
|
extern int _McdeTabsCount(Widget container);
|
|
/* a new view in the container: label, keys, selected */
|
|
extern void _McdeTabsAdopt(Widget view);
|
|
/*
|
|
* Close the tab VIEW. True if the window keeps other tabs (the tab is
|
|
* gone, the window stays); False if VIEW is the last tab or no tab at all --
|
|
* then the caller closes the window as before.
|
|
*/
|
|
extern Boolean _McdeTabsClose(Widget view);
|
|
/* how a new tab is made next to VIEW, with PROFILE (NULL: VIEW's) */
|
|
extern void _McdeTabsSetNewProc(void (*proc)(Widget view, const char *profile));
|
|
|
|
#endif /* _Dtterm_Tabs_h */
|