summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelipe Contreras2023-02-24 18:09:10 -0600
committerFelipe Contreras2023-02-24 18:09:10 -0600
commita79aa6cf8d7c754315b10805d79e8e9216ef45e6 (patch)
treed3aac6575f158564cda17744fd3b55745b7a8fcc
parent3ab9a481bbddf6938b88b828e4769ffd978c0f7a (diff)
downloadaur-a79aa6cf8d7c754315b10805d79e8e9216ef45e6.tar.gz
Add desktop-notification patch
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
-rw-r--r--.SRCINFO3
-rw-r--r--PKGBUILD9
-rw-r--r--desktop-notification.patch237
3 files changed, 246 insertions, 3 deletions
diff --git a/.SRCINFO b/.SRCINFO
index c6c76792d553..e7bf678ac857 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -16,12 +16,15 @@ pkgbase = vte3-nohang
depends = systemd-libs
depends = vte-common
provides = vte3=0.70.3
+ provides = vte3-notification=0.70.3
provides = libvte-2.91.so
conflicts = vte3
options = !lto
source = https://gitlab.gnome.org/GNOME/vte/-/archive/0.70.3/vte-0.70.3.tar.bz2
source = fix-exit-regression.patch
+ source = desktop-notification.patch
sha256sums = 94d0b6776d55252bc1f15995c1ade7eb44b4a2c99531487eba9b8bded1a0fe2f
sha256sums = 7c2e392a6178c6926458a7c79bfdbacac911632f799a98d581b69d2c5d1f9b86
+ sha256sums = 905672bd0e2b5685aeddd035e502a7062c4ada16f8a8eae9813cca1974ea0f77
pkgname = vte3-nohang
diff --git a/PKGBUILD b/PKGBUILD
index 123ce4508e8b..d12db48a68b5 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -13,16 +13,19 @@ depends=(fribidi gnutls gtk3 pcre2 systemd-libs vte-common)
makedepends=(gobject-introspection gperf meson vala)
options=(!lto)
source=("https://gitlab.gnome.org/GNOME/vte/-/archive/$pkgver/vte-$pkgver.tar.bz2"
- fix-exit-regression.patch)
+ fix-exit-regression.patch
+ desktop-notification.patch)
sha256sums=('94d0b6776d55252bc1f15995c1ade7eb44b4a2c99531487eba9b8bded1a0fe2f'
- '7c2e392a6178c6926458a7c79bfdbacac911632f799a98d581b69d2c5d1f9b86')
+ '7c2e392a6178c6926458a7c79bfdbacac911632f799a98d581b69d2c5d1f9b86'
+ '905672bd0e2b5685aeddd035e502a7062c4ada16f8a8eae9813cca1974ea0f77')
-provides=("vte3=$pkgver" libvte-2.91.so)
+provides=("vte3=$pkgver" "vte3-notification=$pkgver" libvte-2.91.so)
conflicts=(vte3)
prepare() {
cd "vte-$pkgver" || exit 1
patch -p1 -i "$srcdir/fix-exit-regression.patch"
+ patch -p1 -i "$srcdir/desktop-notification.patch"
}
build() {
diff --git a/desktop-notification.patch b/desktop-notification.patch
new file mode 100644
index 000000000000..7799073ea3a1
--- /dev/null
+++ b/desktop-notification.patch
@@ -0,0 +1,237 @@
+From 629e6738b6633bd89bc2ba0065c2bb490accdcdf Mon Sep 17 00:00:00 2001
+From: Debarshi Ray <debarshir@gnome.org>
+Date: Wed, 7 Jan 2015 16:01:00 +0100
+Subject: [PATCH] Add sequences and signals for desktop notification
+
+Add sequences
+ OSC 777 ; notify ; SUMMARY ; BODY BEL
+ OSC 777 ; notify ; SUMMARY BEL
+ OSC 777 ; notify ; SUMMARY ; BODY ST
+ OSC 777 ; notify ; SUMMARY ST
+
+that let terminal applications send a notification to the desktop
+environment.
+
+Based on Enlightenment's Terminology:
+https://phab.enlightenment.org/T1765
+
+https://bugzilla.gnome.org/show_bug.cgi?id=711059
+---
+ src/marshal.list | 1 +
+ src/vte.cc | 10 ++++++++++
+ src/vte/vteterminal.h | 4 +++-
+ src/vtegtk.cc | 25 +++++++++++++++++++++++++
+ src/vtegtk.hh | 3 +++
+ src/vteinternal.hh | 14 ++++++++++++++
+ src/vteseq.cc | 37 +++++++++++++++++++++++++++++++++++++
+ 7 files changed, 93 insertions(+), 1 deletion(-)
+
+diff --git a/src/marshal.list b/src/marshal.list
+index 241128c3..4412cf3d 100644
+--- a/src/marshal.list
++++ b/src/marshal.list
+@@ -1,3 +1,4 @@
+ VOID:STRING,BOXED
++VOID:STRING,STRING
+ VOID:STRING,UINT
+ VOID:UINT,UINT
+diff --git a/src/vte.cc b/src/vte.cc
+index 80f26454..fcb9356d 100644
+--- a/src/vte.cc
++++ b/src/vte.cc
+@@ -10181,6 +10181,16 @@ Terminal::emit_pending_signals()
+
+ emit_adjustment_changed();
+
++#if _VTE_GTK == 3
++ if (m_pending_changes & vte::to_integral(PendingChanges::NOTIFICATION)) {
++ _vte_debug_print (VTE_DEBUG_SIGNALS,
++ "Emitting `notification-received'.\n");
++ g_signal_emit(freezer.get(), signals[SIGNAL_NOTIFICATION_RECEIVED], 0,
++ m_notification_summary.c_str(),
++ m_notification_body.c_str());
++ }
++#endif
++
+ if (m_pending_changes & vte::to_integral(PendingChanges::TITLE)) {
+ if (m_window_title != m_window_title_pending) {
+ m_window_title.swap(m_window_title_pending);
+diff --git a/src/vte/vteterminal.h b/src/vte/vteterminal.h
+index 78176f97..ac762498 100644
+--- a/src/vte/vteterminal.h
++++ b/src/vte/vteterminal.h
+@@ -109,9 +109,11 @@ struct _VteTerminalClass {
+ void (*bell)(VteTerminal* terminal);
+
+ #if _VTE_GTK == 3
++ void (*notification_received)(VteTerminal* terminal, const gchar *summary, const gchar *body);
++
+ /* Compatibility padding due to fedora patches intruding on our ABI */
+ /*< private >*/
+- gpointer _extra_padding[3];
++ gpointer _extra_padding[2];
+ #endif /* _VTE_GTK == 3 */
+
+ /* Add new vfuncs here, and subtract from the padding below. */
+diff --git a/src/vtegtk.cc b/src/vtegtk.cc
+index 591c127e..25268735 100644
+--- a/src/vtegtk.cc
++++ b/src/vtegtk.cc
+@@ -1251,6 +1251,9 @@ vte_terminal_class_init(VteTerminalClass *klass)
+ klass->child_exited = NULL;
+ klass->encoding_changed = NULL;
+ klass->char_size_changed = NULL;
++#if _VTE_GTK == 3
++ klass->notification_received = NULL;
++#endif
+ klass->window_title_changed = NULL;
+ klass->icon_title_changed = NULL;
+ klass->selection_changed = NULL;
+@@ -1334,6 +1337,28 @@ vte_terminal_class_init(VteTerminalClass *klass)
+ G_OBJECT_CLASS_TYPE(klass),
+ g_cclosure_marshal_VOID__INTv);
+
++#if _VTE_GTK == 3
++ /**
++ * VteTerminal::notification-received:
++ * @vteterminal: the object which received the signal
++ * @summary: The summary
++ * @body: (allow-none): Extra optional text
++ *
++ * Emitted when a process running in the terminal wants to
++ * send a notification to the desktop environment.
++ */
++ signals[SIGNAL_NOTIFICATION_RECEIVED] =
++ g_signal_new(I_("notification-received"),
++ G_OBJECT_CLASS_TYPE(klass),
++ G_SIGNAL_RUN_LAST,
++ G_STRUCT_OFFSET(VteTerminalClass, notification_received),
++ NULL,
++ NULL,
++ _vte_marshal_VOID__STRING_STRING,
++ G_TYPE_NONE,
++ 2, G_TYPE_STRING, G_TYPE_STRING);
++#endif
++
+ /**
+ * VteTerminal::window-title-changed:
+ * @vteterminal: the object which received the signal
+diff --git a/src/vtegtk.hh b/src/vtegtk.hh
+index 6b7a1ea2..d5379b16 100644
+--- a/src/vtegtk.hh
++++ b/src/vtegtk.hh
+@@ -52,6 +52,9 @@ enum {
+ SIGNAL_RESIZE_WINDOW,
+ SIGNAL_RESTORE_WINDOW,
+ SIGNAL_SELECTION_CHANGED,
++#if _VTE_GTK == 3
++ SIGNAL_NOTIFICATION_RECEIVED,
++#endif
+ SIGNAL_WINDOW_TITLE_CHANGED,
+ LAST_SIGNAL
+ };
+diff --git a/src/vteinternal.hh b/src/vteinternal.hh
+index 0d454649..8dba726c 100644
+--- a/src/vteinternal.hh
++++ b/src/vteinternal.hh
+@@ -662,6 +662,12 @@ public:
+ gboolean m_cursor_moved_pending;
+ gboolean m_contents_changed_pending;
+
++#if _VTE_GTK == 3
++ /* desktop notification */
++ std::string m_notification_summary;
++ std::string m_notification_body;
++#endif
++
+ std::string m_window_title{};
+ std::string m_current_directory_uri{};
+ std::string m_current_file_uri{};
+@@ -675,6 +681,9 @@ public:
+ TITLE = 1u << 0,
+ CWD = 1u << 1,
+ CWF = 1u << 2,
++#if _VTE_GTK == 3
++ NOTIFICATION = 1u << 3,
++#endif
+ };
+ unsigned m_pending_changes{0};
+
+@@ -1506,6 +1515,11 @@ public:
+ int osc) noexcept;
+
+ /* OSC handlers */
++#if _VTE_GTK == 3
++ void handle_urxvt_extension(vte::parser::Sequence const& seq,
++ vte::parser::StringTokeniser::const_iterator& token,
++ vte::parser::StringTokeniser::const_iterator const& endtoken) noexcept;
++#endif
+ void set_color(vte::parser::Sequence const& seq,
+ vte::parser::StringTokeniser::const_iterator& token,
+ vte::parser::StringTokeniser::const_iterator const& endtoken,
+diff --git a/src/vteseq.cc b/src/vteseq.cc
+index 874d2405..dda487c4 100644
+--- a/src/vteseq.cc
++++ b/src/vteseq.cc
+@@ -1376,6 +1376,35 @@ Terminal::delete_lines(vte::grid::row_t param)
+ m_text_deleted_flag = TRUE;
+ }
+
++#if _VTE_GTK == 3
++void
++Terminal::handle_urxvt_extension(vte::parser::Sequence const& seq,
++ vte::parser::StringTokeniser::const_iterator& token,
++ vte::parser::StringTokeniser::const_iterator const& endtoken) noexcept
++{
++ if (token == endtoken)
++ return;
++
++ if (*token == "notify") {
++ ++token;
++
++ if (token == endtoken)
++ return;
++
++ m_notification_summary = *token;
++ m_notification_body.clear();
++ m_pending_changes |= vte::to_integral(PendingChanges::NOTIFICATION);
++ ++token;
++
++ if (token == endtoken)
++ return;
++
++ m_notification_body = *token;
++ return;
++ }
++}
++#endif
++
+ bool
+ Terminal::get_osc_color_index(int osc,
+ int value,
+@@ -6541,6 +6570,12 @@ Terminal::OSC(vte::parser::Sequence const& seq)
+ reset_color(VTE_HIGHLIGHT_FG, VTE_COLOR_SOURCE_ESCAPE);
+ break;
+
++#if _VTE_GTK == 3
++ case VTE_OSC_URXVT_EXTENSION:
++ handle_urxvt_extension(seq, it, cend);
++ break;
++#endif
++
+ case VTE_OSC_XTERM_SET_ICON_TITLE:
+ case VTE_OSC_XTERM_SET_XPROPERTY:
+ case VTE_OSC_XTERM_SET_COLOR_MOUSE_CURSOR_FG:
+@@ -6582,7 +6617,9 @@ Terminal::OSC(vte::parser::Sequence const& seq)
+ case VTE_OSC_URXVT_SET_FONT_BOLD_ITALIC:
+ case VTE_OSC_URXVT_VIEW_UP:
+ case VTE_OSC_URXVT_VIEW_DOWN:
++#if _VTE_GTK != 3
+ case VTE_OSC_URXVT_EXTENSION:
++#endif
+ case VTE_OSC_YF_RQGWR:
+ default:
+ break;
+--
+2.39.2
+