1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-01 15:26:37 +02:00

core: add signal "window_switch"

This commit is contained in:
Sebastien Helleu
2012-01-28 17:18:15 +01:00
parent 3ecd3d7a26
commit 8ea2b93a28
7 changed files with 28 additions and 2 deletions
+3
View File
@@ -1178,6 +1178,9 @@ gui_window_switch (struct t_gui_window *window)
old_window->refresh_needed = 1;
gui_input_move_to_buffer (old_window->buffer, window->buffer);
hook_signal_send ("window_switch",
WEECHAT_HOOK_SIGNAL_POINTER, gui_current_window);
}
/*
+5
View File
@@ -30,7 +30,9 @@
#include "../../core/weechat.h"
#include "../../core/wee-config.h"
#include "../../core/wee-hook.h"
#include "../../core/wee-log.h"
#include "../../plugins/plugin.h"
#include "../gui-window.h"
#include "../gui-bar.h"
#include "../gui-buffer.h"
@@ -185,6 +187,9 @@ gui_window_switch (struct t_gui_window *window)
gui_window_switch_to_buffer (gui_current_window, gui_current_window->buffer, 1);
gui_window_redraw_buffer (gui_current_window->buffer);
hook_signal_send ("window_switch",
WEECHAT_HOOK_SIGNAL_POINTER, window);
}
/*
+9 -1
View File
@@ -889,9 +889,11 @@ gui_window_coords_alloc (struct t_gui_window *window)
void
gui_window_free (struct t_gui_window *window)
{
struct t_gui_window *ptr_win;
struct t_gui_window *ptr_win, *old_current_window;
int i;
old_current_window = gui_current_window;
hook_signal_send ("window_closing", WEECHAT_HOOK_SIGNAL_POINTER, window);
if (window->buffer)
@@ -946,6 +948,12 @@ gui_window_free (struct t_gui_window *window)
hook_signal_send ("window_closed", WEECHAT_HOOK_SIGNAL_POINTER, window);
free (window);
if (gui_current_window != old_current_window)
{
hook_signal_send ("window_switch",
WEECHAT_HOOK_SIGNAL_POINTER, gui_current_window);
}
}
/*