/terminal-urgency/Terminal-beep-urgencyhint.patch
Patch | 61 lines | 55 code | 6 blank | 0 comment | 0 complexity | fb48f437b01080c91aba01d3888db4c1 MD5 | raw file
Possible License(s): IPL-1.0, Apache-2.0, LGPL-2.0, Unlicense, MPL-2.0-no-copyleft-exception, LGPL-2.1, JSON, GPL-3.0, MPL-2.0, CC0-1.0, CC-BY-SA-3.0, LGPL-3.0, WTFPL, BSD-2-Clause, 0BSD, BitTorrent-1.0, Cube, EPL-1.0, ISC, BSD-3-Clause, AGPL-3.0, GPL-2.0, MIT, AGPL-1.0, CC-BY-3.0
- Index: terminal-widget.c
- ===================================================================
- --- terminal-widget.c (revision 26983)
- +++ terminal-widget.c (working copy)
- @@ -80,6 +80,10 @@
- static void terminal_widget_class_init (TerminalWidgetClass *klass);
- static void terminal_widget_init (TerminalWidget *widget);
- static void terminal_widget_finalize (GObject *object);
- +static void terminal_widget_beep (TerminalWidget *widget);
- +static gboolean terminal_widget_focus_in (TerminalWidget *widget,
- + GdkEventFocus *event,
- + gpointer data);
- static gboolean terminal_widget_button_press_event (GtkWidget *widget,
- GdkEventButton *event);
- static void terminal_widget_drag_data_received (GtkWidget *widget,
- @@ -195,6 +199,12 @@
-
- /* apply the initial misc-highlight-urls setting */
- terminal_widget_update_highlight_urls (widget);
- +
- + /* handle vte ringing the bell */
- + g_signal_connect_swapped (G_OBJECT (widget), "beep",
- + G_CALLBACK (terminal_widget_beep), widget);
- + g_signal_connect_swapped (G_OBJECT (widget), "focus-in-event",
- + G_CALLBACK (terminal_widget_focus_in), widget);
- }
-
-
- @@ -214,7 +224,32 @@
- }
-
-
- +static void
- +terminal_widget_beep (TerminalWidget *widget)
- +{
- + if (!GTK_WIDGET_HAS_FOCUS (widget))
- + {
- + GdkWindow *window = widget->__parent__.widget.window;
- + GdkWindow *toplevel = gdk_window_get_toplevel (window);
- + gdk_window_set_urgency_hint (toplevel, TRUE);
- + }
- +}
-
- +
- +static gboolean
- +terminal_widget_focus_in (TerminalWidget *widget,
- + GdkEventFocus *event,
- + gpointer data)
- +{
- + GdkWindow *window = widget->__parent__.widget.window;
- + GdkWindow *toplevel = gdk_window_get_toplevel (window);
- + gdk_window_set_urgency_hint (toplevel, FALSE);
- +
- + /* don't stop event propagation - allow VTE to handle it too */
- + return FALSE;
- +}
- +
- +
- static void
- terminal_widget_context_menu_copy (TerminalWidget *widget,
- GtkWidget *item)