Ubuntu Pastebin

Paste from martin at Fri, 6 Feb 2015 07:19:06 +0000

Download as text
 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
40
41
42
43
44
45
46
47
48
=== modified file 'bin/apport-bug'
--- bin/apport-bug	2014-07-10 15:10:30 +0000
+++ bin/apport-bug	2015-02-06 07:18:55 +0000
@@ -41,11 +41,11 @@
 export APPORT_INVOKED_AS="$0"
 
 # check for X
-if [ -z "$DISPLAY" ]; then
+if [ -z "$DISPLAY" -a -z "$WAYLAND_DISPLAY" ]; then
     if [ -n "$CLI" ] ; then
         $CLI "$@"
     else
-        echo "\$DISPLAY is not set. You need apport-cli to make this program work." >&2
+        echo "Neither \$DISPLAY nor \$WAYLAND_DISPLAY is set. You need apport-cli to make this program work." >&2
         exit 1
     fi
 

=== modified file 'gtk/apport-gtk'
--- gtk/apport-gtk	2014-10-29 20:35:30 +0000
+++ gtk/apport-gtk	2015-02-06 07:17:30 +0000
@@ -25,6 +25,8 @@
 from apport import unicode_gettext as _
 import apport.ui
 
+have_display = os.environ.get('DISPLAY') or os.environ.get('WAYLAND_DISPLAY')
+
 def find_xid_for_pid (pid):
     '''Return the X11 Window (xid) for the supplied process ID.'''
 
@@ -552,7 +554,7 @@
 
         if not command:
             # test mode
-            return 'DISPLAY' in os.environ and program is not None
+            return have_display and program is not None
 
         subprocess.call([program, '-e', command])
 
@@ -583,7 +585,7 @@
         return True
 
 if __name__ == '__main__':
-    if not os.environ.get('DISPLAY'):
+    if not have_display:
         apport.fatal('This program needs a running X session. Please see "man apport-cli" for a command line version of Apport.')
     app = GTKUserInterface()
     app.run_argv()
Download as text