mirror of
https://github.com/weechat/weechat.git
synced 2026-06-28 05:46:38 +02:00
Fix "/window refresh" (key ctrl+L): force curses refresh (was broken by previous commit for terminal resize)
This commit is contained in:
@@ -3334,7 +3334,7 @@ command_window (void *data, struct t_gui_buffer *buffer,
|
||||
/* refresh screen */
|
||||
if (string_strcasecmp (argv[1], "refresh") == 0)
|
||||
{
|
||||
gui_window_refresh_needed = 1;
|
||||
gui_window_ask_refresh (2);
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -252,7 +252,7 @@ config_change_buffer_time_format (void *data, struct t_config_option *option)
|
||||
gui_chat_time_length = util_get_time_length (CONFIG_STRING(config_look_buffer_time_format));
|
||||
gui_chat_change_time_format ();
|
||||
if (gui_ok)
|
||||
gui_window_refresh_needed = 1;
|
||||
gui_window_ask_refresh (1);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -280,7 +280,7 @@ config_change_read_marker (void *data, struct t_config_option *option)
|
||||
(void) data;
|
||||
(void) option;
|
||||
|
||||
gui_window_refresh_needed = 1;
|
||||
gui_window_ask_refresh (1);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -234,7 +234,7 @@ gui_main_signal_sigwinch ()
|
||||
gui_term_lines = new_height;
|
||||
}
|
||||
|
||||
gui_window_refresh_needed = 1;
|
||||
gui_window_ask_refresh (1);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -251,7 +251,7 @@ gui_main_refreshs ()
|
||||
/* refresh window if needed */
|
||||
if (gui_window_refresh_needed)
|
||||
{
|
||||
gui_window_refresh_screen ();
|
||||
gui_window_refresh_screen ((gui_window_refresh_needed > 1) ? 1 : 0);
|
||||
gui_window_refresh_needed = 0;
|
||||
}
|
||||
|
||||
@@ -326,7 +326,7 @@ gui_main_loop ()
|
||||
hook_fd_keyboard = hook_fd (NULL, STDIN_FILENO, 1, 0, 0,
|
||||
&gui_keyboard_read_cb, NULL);
|
||||
|
||||
gui_window_refresh_needed = 1;
|
||||
gui_window_ask_refresh (1);
|
||||
|
||||
while (!weechat_quit)
|
||||
{
|
||||
|
||||
@@ -1073,7 +1073,7 @@ gui_window_resize (struct t_gui_window *window, int percentage)
|
||||
1) < 0)
|
||||
parent->split_pct = old_split_pct;
|
||||
else
|
||||
gui_window_refresh_needed = 1;
|
||||
gui_window_ask_refresh (1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1322,15 +1322,19 @@ gui_window_switch_right (struct t_gui_window *window)
|
||||
|
||||
/*
|
||||
* gui_window_refresh_screen: called when term size is modified
|
||||
* force == 1 when Ctrl+L is pressed
|
||||
* full_refresh == 1 when Ctrl+L is pressed
|
||||
*/
|
||||
|
||||
void
|
||||
gui_window_refresh_screen ()
|
||||
gui_window_refresh_screen (int full_refresh)
|
||||
{
|
||||
if (gui_ok)
|
||||
{
|
||||
refresh ();
|
||||
if (full_refresh)
|
||||
{
|
||||
endwin ();
|
||||
refresh ();
|
||||
}
|
||||
gui_window_refresh_windows ();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -778,8 +778,10 @@ gui_window_switch_right (struct t_gui_window *window)
|
||||
*/
|
||||
|
||||
void
|
||||
gui_window_refresh_screen ()
|
||||
gui_window_refresh_screen (int full_refresh)
|
||||
{
|
||||
(void) full_refresh;
|
||||
|
||||
/* TODO: write this function for Gtk */
|
||||
}
|
||||
|
||||
|
||||
@@ -878,7 +878,7 @@ gui_bar_window_set_current_size (struct t_gui_bar_window *bar_window,
|
||||
if (window)
|
||||
window->refresh_needed = 1;
|
||||
else
|
||||
gui_window_refresh_needed = 1;
|
||||
gui_window_ask_refresh (1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+10
-10
@@ -565,7 +565,7 @@ gui_bar_refresh (struct t_gui_bar *bar)
|
||||
struct t_gui_window *ptr_win;
|
||||
|
||||
if (CONFIG_INTEGER(bar->options[GUI_BAR_OPTION_TYPE]) == GUI_BAR_TYPE_ROOT)
|
||||
gui_window_refresh_needed = 1;
|
||||
gui_window_ask_refresh (1);
|
||||
else
|
||||
{
|
||||
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
|
||||
@@ -627,7 +627,7 @@ gui_bar_apply_current_size (struct t_gui_bar *bar)
|
||||
gui_bar_window_set_current_size (bar->bar_window,
|
||||
NULL,
|
||||
CONFIG_INTEGER(bar->options[GUI_BAR_OPTION_SIZE]));
|
||||
gui_window_refresh_needed = 1;
|
||||
gui_window_ask_refresh (1);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -759,7 +759,7 @@ gui_bar_config_change_hidden (void *data, struct t_config_option *option)
|
||||
}
|
||||
}
|
||||
|
||||
gui_window_refresh_needed = 1;
|
||||
gui_window_ask_refresh (1);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -815,7 +815,7 @@ gui_bar_config_change_priority (void *data, struct t_config_option *option)
|
||||
}
|
||||
}
|
||||
|
||||
gui_window_refresh_needed = 1;
|
||||
gui_window_ask_refresh (1);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -850,7 +850,7 @@ gui_bar_config_change_conditions (void *data, struct t_config_option *option)
|
||||
}
|
||||
}
|
||||
|
||||
gui_window_refresh_needed = 1;
|
||||
gui_window_ask_refresh (1);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -869,7 +869,7 @@ gui_bar_config_change_position (void *data, struct t_config_option *option)
|
||||
if (ptr_bar && !CONFIG_BOOLEAN(ptr_bar->options[GUI_BAR_OPTION_HIDDEN]))
|
||||
gui_bar_refresh (ptr_bar);
|
||||
|
||||
gui_window_refresh_needed = 1;
|
||||
gui_window_ask_refresh (1);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -888,7 +888,7 @@ gui_bar_config_change_filling (void *data, struct t_config_option *option)
|
||||
if (ptr_bar && !CONFIG_BOOLEAN(ptr_bar->options[GUI_BAR_OPTION_HIDDEN]))
|
||||
gui_bar_refresh (ptr_bar);
|
||||
|
||||
gui_window_refresh_needed = 1;
|
||||
gui_window_ask_refresh (1);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -987,7 +987,7 @@ gui_bar_config_change_size_max (void *data, struct t_config_option *option)
|
||||
(void) data;
|
||||
(void) option;
|
||||
|
||||
gui_window_refresh_needed = 1;
|
||||
gui_window_ask_refresh (1);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1638,7 +1638,7 @@ gui_bar_new_with_options (const char *name,
|
||||
{
|
||||
/* create only one window for bar */
|
||||
gui_bar_window_new (new_bar, NULL);
|
||||
gui_window_refresh_needed = 1;
|
||||
gui_window_ask_refresh (1);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2214,7 +2214,7 @@ gui_bar_free (struct t_gui_bar *bar)
|
||||
if (bar->bar_window)
|
||||
{
|
||||
gui_bar_window_free (bar->bar_window, NULL);
|
||||
gui_window_refresh_needed = 1;
|
||||
gui_window_ask_refresh (1);
|
||||
}
|
||||
else
|
||||
gui_bar_free_bar_windows (bar);
|
||||
|
||||
+12
-1
@@ -54,7 +54,7 @@ int gui_init_ok = 0; /* = 1 if GUI is initialized*/
|
||||
int gui_ok = 0; /* = 1 if GUI is ok */
|
||||
/* (0 when size too small) */
|
||||
int gui_window_refresh_needed = 0; /* = 1 if refresh needed */
|
||||
|
||||
/* = 2 for full refresh */
|
||||
struct t_gui_window *gui_windows = NULL; /* first window */
|
||||
struct t_gui_window *last_gui_window = NULL; /* last window */
|
||||
struct t_gui_window *gui_current_window = NULL; /* current window */
|
||||
@@ -62,6 +62,17 @@ struct t_gui_window *gui_current_window = NULL; /* current window */
|
||||
struct t_gui_window_tree *gui_windows_tree = NULL; /* windows tree */
|
||||
|
||||
|
||||
/*
|
||||
* gui_window_ask_refresh: set "gui_window_refresh_needed" flag
|
||||
*/
|
||||
|
||||
void
|
||||
gui_window_ask_refresh (int refresh)
|
||||
{
|
||||
if (refresh > gui_window_refresh_needed)
|
||||
gui_window_refresh_needed = refresh;
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_window_tree_init: create first entry in windows tree
|
||||
*/
|
||||
|
||||
@@ -103,6 +103,7 @@ extern struct t_gui_window *gui_current_window;
|
||||
extern struct t_gui_window_tree *gui_windows_tree;
|
||||
|
||||
/* window functions */
|
||||
extern void gui_window_ask_refresh (int refresh);
|
||||
extern int gui_window_tree_init (struct t_gui_window *window);
|
||||
extern void gui_window_tree_node_to_leaf (struct t_gui_window_tree *node,
|
||||
struct t_gui_window *window);
|
||||
@@ -168,7 +169,7 @@ extern void gui_window_switch_up (struct t_gui_window *window);
|
||||
extern void gui_window_switch_down (struct t_gui_window *window);
|
||||
extern void gui_window_switch_left (struct t_gui_window *window);
|
||||
extern void gui_window_switch_right (struct t_gui_window *window);
|
||||
extern void gui_window_refresh_screen ();
|
||||
extern void gui_window_refresh_screen (int full_refresh);
|
||||
extern void gui_window_title_set ();
|
||||
extern void gui_window_title_reset ();
|
||||
extern void gui_window_objects_print_log (struct t_gui_window *window);
|
||||
|
||||
Reference in New Issue
Block a user