]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
TUI window resize should not need invisibility
authorTom Tromey <tom@tromey.com>
Tue, 9 Jul 2019 21:35:17 +0000 (15:35 -0600)
committerTom Tromey <tom@tromey.com>
Thu, 15 Aug 2019 18:29:28 +0000 (12:29 -0600)
commitdb502012fc46b4dd068461aaeafeaa421489c562
tree90e36ac3f6252a2d262ba78ad04efe1d23eaa96e
parent3891b65efe614fe2e2f7e75e7f5ec8964f7fd96b
TUI window resize should not need invisibility

When resizing a window, the TUI currently first makes it invisible,
then changes the size, and then restores its visibility.

I think this is done because curses doesn't truly support resizing a
window -- there is a "wresize" extension, but the man page says it
isn't available in all versions of curses.

First, this is probably not a major problem any more.  I imagine most
of those old systems are gone now.

Second, I think it's a better API to have this detail hidden inside of
the resize method.

This patch changes the code to follow this idea, and changes the
ordinary resize method to use wresize when it is available.  The
special case for the command window is also moved to methods on the
command window.

gdb/ChangeLog
2019-08-15  Tom Tromey  <tom@tromey.com>

* tui/tui-layout.c (show_layout, show_source_disasm_command)
(show_data): Don't change window visibility.
(tui_gen_win_info::resize): Remove special case for command
window.  Use wresize, when available.
(show_source_or_disasm_and_command): Don't change window
visibility.
* tui/tui-command.h (struct tui_cmd_window) <resize>: Declare.
<make_visible>: New method.
* tui/tui-command.c (tui_cmd_window::resize): New method.
gdb/ChangeLog
gdb/tui/tui-command.c
gdb/tui/tui-command.h
gdb/tui/tui-layout.c