old-cross-binutils/gdb/tui
Patrick Palka c4ef48c6b2 Asynchronously resize the TUI
This patch teaches the TUI to resize itself asynchronously instead of
synchronously.  Asynchronously resizing the screen when the underlying
terminal gets resized is the more intuitive behavior and is surprisingly
simple to implement thanks to GDB's async infrastructure.

The implementation is straightforward.  TUI's SIGWINCH handler is just
tweaked to asynchronously invoke a new callback,
tui_async_resize_screen, which is responsible for safely resizing the
screen.  Care must be taken to not to attempt to asynchronously resize
the screen while the TUI is not active.  When the TUI is not active, the
callback will do nothing, but the screen will yet be resized in the next
call to tui_enable() by virtue of win_resized being TRUE.

(So, after the patch there are still two places where the screen gets
resized: one in tui_enable() and the other now in
tui_async_resize_screen() as opposed to being in
tui_handle_resize_during_io().  The one in tui_enable() is still
necessary to handle the case where the terminal gets resized inside the
CLI: in that case, the TUI still needs resizing, but it must wait until
the TUI gets re-enabled.)

gdb/ChangeLog:

	* tui/tui-io.c (tui_handle_resize_during_io): Remove this
	function.
	(tui_putc): Don't call tui_handle_resize_during_io.
	(tui_getc): Likewise.
	(tui_mld_getc): Likewise.
	* tui/tui-win.c: Include event-loop.h and tui/tui-io.h.
	(tui_sigwinch_token): New static variable.
	(tui_initialize_win): Adjust documentation.  Set
	tui_sigwinch_token.
	(tui_async_resize_screen): New asynchronous callback.
	(tui_sigwinch_handler): Adjust documentation.  Asynchronously
	invoke tui_async_resize_screen.
2015-02-18 17:26:06 -05:00
..
ChangeLog-1998-2003
tui-command.c Speed up GDB's TUI output 2015-02-04 12:27:28 +01:00
tui-command.h Speed up GDB's TUI output 2015-02-04 12:27:28 +01:00
tui-data.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
tui-data.h Leave more space in TUI mode for thread ID. 2015-01-16 13:24:20 +02:00
tui-disasm.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
tui-disasm.h Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
tui-file.c Speed up GDB's TUI output 2015-02-04 12:27:28 +01:00
tui-file.h Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
tui-hooks.c Consolidate the custom TUI query hook with the default query hook 2015-01-09 13:27:56 -05:00
tui-hooks.h Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
tui-interp.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
tui-io.c Asynchronously resize the TUI 2015-02-18 17:26:06 -05:00
tui-io.h Make sure TABs are expanded in TUI windows on MS-Windows. 2015-01-31 10:47:14 +02:00
tui-layout.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
tui-layout.h Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
tui-out.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
tui-regs.c Make sure TABs are expanded in TUI windows on MS-Windows. 2015-01-31 10:47:14 +02:00
tui-regs.h Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
tui-source.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
tui-source.h Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
tui-stack.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
tui-stack.h Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
tui-win.c Asynchronously resize the TUI 2015-02-18 17:26:06 -05:00
tui-win.h Really add a prototype for tui_rehighlight_all. 2015-01-16 19:58:04 +02:00
tui-windata.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
tui-windata.h Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
tui-wingeneral.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
tui-wingeneral.h Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
tui-winsource.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
tui-winsource.h Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
tui.c TUI: resize windows to new terminal size before displaying them 2015-02-17 10:05:52 +00:00
tui.h Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00