diff options
author | Andrew Burgess <aburgess@redhat.com> | 2022-02-01 14:59:11 +0000 |
---|---|---|
committer | Andrew Burgess <aburgess@redhat.com> | 2022-04-03 15:31:47 +0100 |
commit | 357c158f3a1921538a45b72bb635f15cc1abd31a (patch) | |
tree | fc2e8207d41b764237550770eedc113f100579cd /gdb/testsuite/gdb.trace/pending.c | |
parent | b45b7407cdd07900ecc28a36710603edc96ade71 (diff) | |
download | gdb-357c158f3a1921538a45b72bb635f15cc1abd31a.zip gdb-357c158f3a1921538a45b72bb635f15cc1abd31a.tar.gz gdb-357c158f3a1921538a45b72bb635f15cc1abd31a.tar.bz2 |
gdb/tui: fair split of delta after a resize
Currently, in master gdb, when a tui window is changed in size, the
screen delta is mostly just added to the next available window. We
do take care to respect the min/max size, but in most cases, these
limits are just "the terminal size", and so, we end up placing the
whole delta on the next window.
Consider these steps in an 80 column, 24 line terminal:
(gdb) tui enable
(gdb) layout src
(gdb) layout split
(gdb) info win
Name Lines Columns Focus
src 8 80 (has focus)
asm 8 80
status 1 80
cmd 8 80
(gdb) winheight cmd +2
(gdb) info win
Name Lines Columns Focus
src 6 80 (has focus)
asm 8 80
status 1 80
cmd 10 80
Notice that initially, the windows were balanced, 8 lines each for the
major windows. Then, when the cmd window was adjusted, the extra two
lines were given to the asm window.
I think it would be nicer if the delta was spread more evenly over the
available windows. In the example above, after the adjustment the
layout now looks like:
(gdb) info win
Name Lines Columns Focus
src 7 80 (has focus)
asm 7 80
status 1 80
cmd 10 80
This is achieved within tui_layout_split::set_size, by just handing
out the delta in increments of 1 to each window (except for the window
the user adjusted), until there's no more delta left. Of course, we
continue to respect the min/max window sizes.
Diffstat (limited to 'gdb/testsuite/gdb.trace/pending.c')
0 files changed, 0 insertions, 0 deletions