PageRenderTime 42ms CodeModel.GetById 1ms RepoModel.GetById 0ms app.codeStats 0ms

/terminal-urgency/Terminal-beep-urgencyhint.patch

https://bitbucket.org/axil42/aur-mirror
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
  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 @@
  17. /* apply the initial misc-highlight-urls setting */
  18. terminal_widget_update_highlight_urls (widget);
  19. +
  20. + /* handle vte ringing the bell */
  21. + g_signal_connect_swapped (G_OBJECT (widget), "beep",
  22. + G_CALLBACK (terminal_widget_beep), widget);
  23. + g_signal_connect_swapped (G_OBJECT (widget), "focus-in-event",
  24. + G_CALLBACK (terminal_widget_focus_in), widget);
  25. }
  26. @@ -214,7 +224,32 @@
  27. }
  28. +static void
  29. +terminal_widget_beep (TerminalWidget *widget)
  30. +{
  31. + if (!GTK_WIDGET_HAS_FOCUS (widget))
  32. + {
  33. + GdkWindow *window = widget->__parent__.widget.window;
  34. + GdkWindow *toplevel = gdk_window_get_toplevel (window);
  35. + gdk_window_set_urgency_hint (toplevel, TRUE);
  36. + }
  37. +}
  38. +
  39. +static gboolean
  40. +terminal_widget_focus_in (TerminalWidget *widget,
  41. + GdkEventFocus *event,
  42. + gpointer data)
  43. +{
  44. + GdkWindow *window = widget->__parent__.widget.window;
  45. + GdkWindow *toplevel = gdk_window_get_toplevel (window);
  46. + gdk_window_set_urgency_hint (toplevel, FALSE);
  47. +
  48. + /* don't stop event propagation - allow VTE to handle it too */
  49. + return FALSE;
  50. +}
  51. +
  52. +
  53. static void
  54. terminal_widget_context_menu_copy (TerminalWidget *widget,
  55. GtkWidget *item)