Unify the duplicated focus_{in,_out}_cb functions

This commit is contained in:
Simon Gomizelj 2012-06-16 03:41:43 -04:00
parent 85e69bf58c
commit adf0df826b
1 changed files with 4 additions and 10 deletions

View File

@ -36,8 +36,7 @@ static gboolean entry_key_press_cb(GtkEntry *entry, GdkEventKey *event, search_p
static gboolean position_overlay_cb(GtkBin *overlay, GtkWidget *widget, GdkRectangle *alloc); static gboolean position_overlay_cb(GtkBin *overlay, GtkWidget *widget, GdkRectangle *alloc);
static gboolean button_press_cb(VteTerminal *vte, GdkEventButton *event); static gboolean button_press_cb(VteTerminal *vte, GdkEventButton *event);
static void beep_cb(GtkWindow *window); static void beep_cb(GtkWindow *window);
static gboolean focus_in_cb(GtkWindow *window); static gboolean focus_cb(GtkWindow *window);
static gboolean focus_out_cb(GtkWindow *window);
static gboolean add_to_list_store(char *key, void *value, GtkListStore *store); static gboolean add_to_list_store(char *key, void *value, GtkListStore *store);
static GtkTreeModel *create_completion_model(VteTerminal *vte); static GtkTreeModel *create_completion_model(VteTerminal *vte);
@ -167,12 +166,7 @@ void beep_cb(GtkWindow *window) {
gtk_window_set_urgency_hint(window, TRUE); gtk_window_set_urgency_hint(window, TRUE);
} }
gboolean focus_in_cb(GtkWindow *window) { gboolean focus_cb(GtkWindow *window) {
gtk_window_set_urgency_hint(window, FALSE);
return FALSE;
}
gboolean focus_out_cb(GtkWindow *window) {
gtk_window_set_urgency_hint(window, FALSE); gtk_window_set_urgency_hint(window, FALSE);
return FALSE; return FALSE;
} }
@ -560,8 +554,8 @@ int main(int argc, char **argv) {
if (urgent_on_bell) { if (urgent_on_bell) {
g_signal_connect_swapped(vte, "beep", G_CALLBACK(beep_cb), window); g_signal_connect_swapped(vte, "beep", G_CALLBACK(beep_cb), window);
g_signal_connect(window, "focus-in-event", G_CALLBACK(focus_in_cb), NULL); g_signal_connect(window, "focus-in-event", G_CALLBACK(focus_cb), NULL);
g_signal_connect(window, "focus-out-event", G_CALLBACK(focus_out_cb), NULL); g_signal_connect(window, "focus-out-event", G_CALLBACK(focus_cb), NULL);
} }
if (dynamic_title) { if (dynamic_title) {