#include "top.h"
#include "source.h"
#include "event-loop.h"
+#include "gdbcmd.h"
#include "tui/tui.h"
#include "tui/tui-io.h"
tui_rehighlight_all ();
}
+\f
+
+/* True if TUI resizes should print a message. This is used by the
+ test suite. */
+
+static bool resize_message;
+
+static void
+show_tui_resize_message (struct ui_file *file, int from_tty,
+ struct cmd_list_element *c, const char *value)
+{
+ fprintf_filtered (file, _("TUI resize messaging is %s.\n"), value);
+}
+
+\f
+
/* Generic window name completion function. Complete window name pointed
to by TEXT and WORD. If INCLUDE_NEXT_PREV_P is true then the special
window names 'next' and 'prev' will also be considered as possible
#endif
/* Turn keypad off while we resize. */
if (win_with_focus != TUI_CMD_WIN)
- keypad (TUI_CMD_WIN->handle, FALSE);
+ keypad (TUI_CMD_WIN->handle.get (), FALSE);
tui_update_gdb_sizes ();
tui_set_term_height_to (screenheight);
tui_set_term_width_to (screenwidth);
/* Turn keypad back on, unless focus is in the command
window. */
if (win_with_focus != TUI_CMD_WIN)
- keypad (TUI_CMD_WIN->handle, TRUE);
+ keypad (TUI_CMD_WIN->handle.get (), TRUE);
}
}
tui_resize_all ();
tui_refresh_all_win ();
tui_update_gdb_sizes ();
+ if (resize_message)
+ {
+ static int count;
+ printf_unfiltered ("@@ resize done %d, size = %dx%d\n", count,
+ tui_term_width (), tui_term_height ());
+ ++count;
+ }
tui_redisplay_readline ();
}
}
error (_("Window \"%s\" is not visible"), arg);
tui_set_win_focus_to (win_info);
- keypad (TUI_CMD_WIN->handle, (win_info != TUI_CMD_WIN));
+ keypad (TUI_CMD_WIN->handle.get (), win_info != TUI_CMD_WIN);
printf_filtered (_("Focus set to %s window.\n"),
tui_win_with_focus ()->name ());
}
second_win = *(tui_source_windows ().begin ());
}
if (primary_win_info == TUI_CMD_WIN)
- { /* Split the change in height accross the 1st & 2nd
+ { /* Split the change in height across the 1st & 2nd
windows, adjusting them as well. */
/* Subtract the locator. */
int first_split_diff = diff / 2;
second_split_diff++;
}
}
- /* Make sure that the minimum hieghts are
+ /* Make sure that the minimum heights are
honored. */
while ((first_win->height + first_split_diff) < 3)
{
This variable controls how many spaces are used to display a tab character."),
tui_set_tab_width, tui_show_tab_width,
&tui_setlist, &tui_showlist);
+
+ add_setshow_boolean_cmd ("tui-resize-message", class_maintenance,
+ &resize_message, _("\
+Set TUI resize messaging."), _("\
+Show TUI resize messaging."), _("\
+When enabled GDB will print a message when the terminal is resized."),
+ nullptr,
+ show_tui_resize_message,
+ &maintenance_set_cmdlist,
+ &maintenance_show_cmdlist);
}