File: clean-up-vte-notification-received-signal.check.patch

package info (click to toggle)
terminator 2.1.4-4
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 5,928 kB
  • sloc: python: 10,891; sh: 26; makefile: 15
file content (39 lines) | stat: -rw-r--r-- 1,431 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
From: Colin Watson <cjwatson@debian.org>
Date: Wed, 15 Jan 2025 11:11:07 +0000
Subject: Clean up VTE notification-received signal check

This prompts a crash with some versions of VTE and Python (see
https://gitlab.gnome.org/GNOME/vte/-/issues/2858), and although the
crash has been fixed in VTE, VTE's main developer said that creating an
instance and connecting to a signal isn't the right way to do this
check.  Use the test they recommend instead.

Fixes: #984

Forwarded: https://github.com/gnome-terminator/terminator/pull/986
Bug: https://github.com/gnome-terminator/terminator/issues/984
Bug-Debian: https://bugs.debian.org/1092532
Last-Update: 2025-01-15
---
 terminatorlib/plugins/command_notify.py | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/terminatorlib/plugins/command_notify.py b/terminatorlib/plugins/command_notify.py
index 0001c56..f07f90b 100644
--- a/terminatorlib/plugins/command_notify.py
+++ b/terminatorlib/plugins/command_notify.py
@@ -22,12 +22,10 @@ from gi.repository import GObject, GLib, Notify, Vte
 VERSION = '0.1.0'
 
 ### Test for proper signal
-try:
-    Vte.Terminal().connect('notification-received',lambda *args: None,None)
+if GObject.signal_lookup('notification-received', Vte.Terminal):
     AVAILABLE = ['CommandNotify']
-except TypeError as e:
+else:
     AVAILABLE = []
-    pass
 
 class CommandNotify(plugin.Plugin):
     capabilities = ['command_watch']