Commit Graph

98 Commits

Author SHA1 Message Date
Dane Jensen
1503f91446 Fixed two null dereferences. 2026-07-20 21:18:32 -07:00
Dane Jensen
94f47287fe fixes from feedback.
Also moved away from individual allocations and implemented basic string
views.
2026-07-20 15:46:37 -07:00
Dane Jensen
b448cf8726 Cleaned up some of the implementation and moved flags to the front. 2026-07-19 14:22:29 -07:00
Dane Jensen
5b6498ace4 Updated the layout string format to be more readable and include flags. 2026-07-19 14:22:29 -07:00
nicm
d98635e1bd Add modal panes, created currently with new-pane -O. There is one modal
pane per window and it must be a floating pane. These are intended to
replace popups. Currently a modal pane will unzoom a zoomed window and
rezoom it when it is closed (a bit like modes do), but this is planned
to change when we get an always-on-top flag.
2026-07-15 15:53:04 +00:00
nicm
1a02c9957c Convert display-panes away from an overlay and into a mode. This is
another step on the road of getting rid of overlays altogether (they are
full of special cases; popups and menus are to go also eventually). We
lose some of the styling of borders but gain the ability to run
display-panes in another pane (perhaps not hugely useful but one never
knows). The -b flag goes away as no longer useful.
2026-07-14 19:57:30 +00:00
nicm
2b091d91d3 Make split-window inside a floating pane work more nicely and not
immediately create an overlapping pane, from Dane Jensen.
2026-07-13 14:35:33 +00:00
nicm
d29aa12117 Replace the notification system with events. Events can carry a payload of
additional payload (to reduce problems with lifetime of objects) and are
delivered to one or more event sinks. This is more powerful and reduces the
complex dependencies between control mode and hooks. Events are now used for
hooks, control mode notifications and for monitors (set-hook -B).

wait-for can now wait for an event to fire (-E flag, with -F to for filter),
with -v to print the payload, as well as listing (-l) waiting clients on an
event and forcing one to wake (-w).

A few additional hooks are also now available (pane-created, pane-resized, etc)
and some of the existing ones have additional format variables available.
2026-07-10 13:38:45 +00:00
nicm
28c2005a2a Fix a typo (use right var), from Dane Jensen. 2026-07-08 07:55:17 +00:00
nicm
7188391a22 Add a layout_geometry container struct, from Dane Jensen. 2026-07-07 08:07:26 +00:00
nicm
ff09914327 Could of minor tidy ups. 2026-07-06 21:44:26 +00:00
nicm
d565fd3b54 Do not create zero size panes, from Uzair Aftab. 2026-07-06 11:28:39 +00:00
nicm
913e503296 Unzoom before creating a floating pane (for now). 2026-07-06 07:57:45 +00:00
nicm
898a91903a Add some missing checks which make new pane positions off, from Dane
Jensen.
2026-07-04 18:54:18 +00:00
nicm
fa2c9f4551 Allow join-pane to tile floating panes, from Dane Jensen. 2026-07-03 10:47:32 +00:00
nicm
824ef37f5f Change layout sets to build the layout using the new mechanics, from
Dane Jensen.
2026-07-01 16:43:14 +00:00
nicm
e06207c914 Cache scrollbar options in window to avoid a slow lookup when working
out visible ranges.
2026-06-29 19:03:34 +00:00
nicm
c29b41e527 Make pane scrollbars able to auto-hide after a short timeout. This
replaces the previous "modal" behaviour where the pane would be resized,
which tended to make a mess. Instead, the scrollbar appears when
scrolling or when hovered over with the mouse and disappears a
(configurable) short period later. From Michael Grant.
2026-06-29 07:45:09 +00:00
nicm
5e0b0a2aa3 Pulled code out of layout_split_pane for reuse and added
layout_insert_tile. From Dane Jensen.
2026-06-27 10:21:26 +00:00
nicm
e24969b422 Add a helper to swap a node into the place of a leaf, from Dane Jensen. 2026-06-27 10:18:32 +00:00
nicm
d0bf3bf06d Add ability to float a tiled pane to break-pane, from Dane Jensen. 2026-06-26 10:02:01 +00:00
nicm
9dba08ac8b Allow -p more than 100%, and account for borders when sizing new panes.
From Dane Jensen.
2026-06-23 09:29:26 +00:00
nicm
3ec115115d Do not leak error message, use it instead. From Dane Jensen. 2026-06-23 09:13:30 +00:00
nicm
02b37b3c69 Fix scrollbar pad to work even if not set in style. 2026-06-22 13:57:33 +00:00
nicm
95afd7549c Rewrite screen-redraw.c to make it tidier and more maintainable. A scene
is generated and cached in the client: it holds positions and sizes of
panes, borders and so on. The scene is invalidated when a pane is moved
or resized or relevant option is changed. This scene is then drawn to
the client as needed and text and colours are filled in. With Michael
Grant.
2026-06-22 08:47:45 +00:00
nicm
e680420c89 Place floating cells meaningfully into the layouts, from Dane Jensen. 2026-06-22 08:10:16 +00:00
nicm
b1b184cdb8 Add functions to work out cell neighbours, and to remove a tiled cell.
From Dane Jensen.
2026-06-18 09:11:24 +00:00
nicm
eafd2bed5d FIx a couple of minor errors in use of layout_cell_is_tiled. 2026-06-17 07:43:55 +00:00
nicm
0890df5891 Add layout_cell_is_tiled and layout_cell_has_tiled_child helper
functions, from Dane Jensen.
2026-06-16 07:06:32 +00:00
nicm
b86bd1fcd0 Add pane-border-lines none like popups (-B to new-pane). 2026-06-15 17:34:25 +00:00
nicm
cc27470cb6 Skip floating panes when working out the top or bottom cell. Fixes
missing bottom status pane status line when floating panes exist.
2026-06-14 20:37:57 +00:00
nicm
87976aa48e Add a helper to get pane-border-status for a window for some other
changes to come.
2026-06-14 19:31:37 +00:00
nicm
778a15b64a Take account of borders when resizing floating panes. 2026-06-14 18:59:15 +00:00
nicm
d23a2b7e97 Skip floating cells when moving to previous cell for resize of tiled cells. 2026-06-13 20:03:10 +00:00
nicm
b182791052 Tidy up error messages from split-window. 2026-06-13 18:30:16 +00:00
nicm
3ea458b9dc Add support for floating panes to resize-pane, from Dane Jensen. 2026-06-11 10:16:19 +00:00
nicm
5744021ac9 Allow floating panes to be created partially off the window, based on a
change from Michael Grant.
2026-06-07 09:54:25 +00:00
nicm
35709a30ee Change so that floating panes are always part of the root layout. From
Dane Jensen.
2026-06-06 17:30:48 +00:00
nicm
a3bf632276 Move cell creation into layout.c, from Dane Jensen. 2026-06-02 19:25:06 +00:00
nicm
ae6a749d3a Move the PANE_FLOATING flag into the layout cell and add an accessor.
From Dane Jensen.
2026-06-02 08:13:50 +00:00
nicm
b368e89bea Remove LAYOUT_FLOATING and disable custom layouts with floating panes
for now, from Dane Jensen.
2026-06-01 20:09:26 +00:00
nicm
f047b3f8e7 Do not crash when freeing layout cell, reported by Jere Viikari. 2026-05-24 08:40:43 +00:00
nicm
5c3a4746b7 Some code tidying up. 2026-05-23 07:22:50 +00:00
nicm
f5a086ac98 Some more easy floating panes bits. 2026-05-19 12:16:25 +00:00
nicm
34e2035bad More bits for pane Z index tracking from floating panes, mostly by
Michael Grant.
2026-05-19 09:48:14 +00:00
nicm
a8520ba59e Bring over some of layout and positioning code for floating panes, by
Michael Grant.
2026-05-17 16:01:42 +00:00
nicm
ee9cf1bbaa Fix the size caluation for left-right windows used to spread out cells
horizontally evenly. From Michael Grant in GitHub issue 4724.
2025-12-03 07:35:32 +00:00
nicm
e149d29803 Assign excess space more evenly when spreading out cells, from Torbjorn
Lonnemark.
2024-12-17 08:40:24 +00:00
nicm
350a151ee4 Add two new style parameters, width and pad, which apply to scrollbars.
From Michael Grant, GitHub issue 4241.
2024-11-15 13:12:20 +00:00
nicm
d6883c0266 Turn off scrollbar when pane is in alternate screen, from Michael Grant,
GitHub issue 4231.
2024-11-15 09:01:16 +00:00