updated on Thu Jan 19 20:01:47 UTC 2012
[aur-mirror.git] / terminal-urgency / Terminal-beep-urgencyhint.patch
bloba62af7ee1f301ded4574a33f0d6a90668b1f4908
1 Index: terminal-widget.c
2 ===================================================================
3 --- terminal-widget.c (revision 26983)
4 +++ terminal-widget.c (working copy)
5 @@ -80,6 +80,10 @@
6 static void terminal_widget_class_init (TerminalWidgetClass *klass);
7 static void terminal_widget_init (TerminalWidget *widget);
8 static void terminal_widget_finalize (GObject *object);
9 +static void terminal_widget_beep (TerminalWidget *widget);
10 +static gboolean terminal_widget_focus_in (TerminalWidget *widget,
11 + GdkEventFocus *event,
12 + gpointer data);
13 static gboolean terminal_widget_button_press_event (GtkWidget *widget,
14 GdkEventButton *event);
15 static void terminal_widget_drag_data_received (GtkWidget *widget,
16 @@ -195,6 +199,12 @@
18 /* apply the initial misc-highlight-urls setting */
19 terminal_widget_update_highlight_urls (widget);
21 + /* handle vte ringing the bell */
22 + g_signal_connect_swapped (G_OBJECT (widget), "beep",
23 + G_CALLBACK (terminal_widget_beep), widget);
24 + g_signal_connect_swapped (G_OBJECT (widget), "focus-in-event",
25 + G_CALLBACK (terminal_widget_focus_in), widget);
29 @@ -214,7 +224,32 @@
33 +static void
34 +terminal_widget_beep (TerminalWidget *widget)
36 + if (!GTK_WIDGET_HAS_FOCUS (widget))
37 + {
38 + GdkWindow *window = widget->__parent__.widget.window;
39 + GdkWindow *toplevel = gdk_window_get_toplevel (window);
40 + gdk_window_set_urgency_hint (toplevel, TRUE);
41 + }
45 +static gboolean
46 +terminal_widget_focus_in (TerminalWidget *widget,
47 + GdkEventFocus *event,
48 + gpointer data)
50 + GdkWindow *window = widget->__parent__.widget.window;
51 + GdkWindow *toplevel = gdk_window_get_toplevel (window);
52 + gdk_window_set_urgency_hint (toplevel, FALSE);
54 + /* don't stop event propagation - allow VTE to handle it too */
55 + return FALSE;
59 static void
60 terminal_widget_context_menu_copy (TerminalWidget *widget,
61 GtkWidget *item)