Merge ~enr0n/ubuntu/+source/apport:lp.1952947 into ubuntu/+source/apport:ubuntu/devel

Proposed by Nick Rosbrook
Status: Needs review
Proposed branch: ~enr0n/ubuntu/+source/apport:lp.1952947
Merge into: ubuntu/+source/apport:ubuntu/devel
Diff against target: 54 lines (+24/-0)
3 files modified
apport/ui.py (+13/-0)
debian/changelog (+6/-0)
man/apport-cli.1 (+5/-0)
Reviewer Review Type Date Requested Status
Brian Murray (community) Needs Fixing
Review via email: mp+415620@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Brian Murray (brian-murray) wrote :

Could the error message be even more helpful? Is there some desktop app that lists processes that we can point people at? (I've no idea but want to help people report their bug.)

Could you also update the apport-cli man page? Thanks!

review: Needs Fixing
Revision history for this message
Nick Rosbrook (enr0n) wrote :

> Could the error message be even more helpful? Is there some desktop app that
> lists processes that we can point people at? (I've no idea but want to help
> people report their bug.)

Both GNOME and KDE have "System Monitor" applications that we could direct people to.
>
> Could you also update the apport-cli man page? Thanks!

Will do. Thanks for reviewing.

Revision history for this message
Brian Murray (brian-murray) wrote :

Ah yeah, the system monitor application seems to have icons that match the programs which could help people sort out the PID.

Unmerged commits

d42081c... by Nick Rosbrook

apport: error out when -w option is used on wayland

The -w,--window command line flag results in apport using xprop to get
the window's PID. On wayland, xprop cannot be used, and trying to call
xprop results in a non-responsive apport UI. Due to wayland's
architecture, there is no viable replacement for xprop. When the -w
option is used on wayland, error out with a helpful message.

LP: #1952947

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/apport/ui.py b/apport/ui.py
2index 200f7ff..3de0aa6 100644
3--- a/apport/ui.py
4+++ b/apport/ui.py
5@@ -727,6 +727,19 @@ class UserInterface:
6 self.ui_error_message(_('Invalid problem report'), excstr(e))
7 return True
8 elif self.options.window:
9+ if os.getenv('XDG_SESSION_TYPE') == 'wayland':
10+ self.ui_error_message(_('Cannot create report'),
11+ _('The window option cannot be used on '
12+ 'Wayland.\n\nPlease find the window\'s '
13+ 'process ID and then run \'ubuntu-bug '
14+ '<process ID>\'.'
15+ '\n\nThe process ID can be found '
16+ 'by running the System Monitor application. '
17+ 'In the Processes tab, scroll until you '
18+ 'find the correct application. The process '
19+ 'ID is the number listed in the ID column.'))
20+ return True
21+
22 self.ui_info_message('', _('After closing this message '
23 'please click on an application window to report a problem about it.'))
24 xprop = subprocess.Popen(['xprop', '_NET_WM_PID'],
25diff --git a/debian/changelog b/debian/changelog
26index 6e892e9..14df5c3 100644
27--- a/debian/changelog
28+++ b/debian/changelog
29@@ -1,3 +1,9 @@
30+apport (2.20.11-0ubuntu77) UNRELEASED; urgency=medium
31+
32+ * apport/ui.py: Error out when -w option is used on wayland (LP: #1952947).
33+
34+ -- Nick Rosbrook <nick.rosbrook@canonical.com> Tue, 15 Feb 2022 10:10:59 -0500
35+
36 apport (2.20.11-0ubuntu76) jammy; urgency=medium
37
38 * data/package-hooks/ubuntu-desktop-installer.py: Add in a new package hook
39diff --git a/man/apport-cli.1 b/man/apport-cli.1
40index 298a07f..575a9b0 100644
41--- a/man/apport-cli.1
42+++ b/man/apport-cli.1
43@@ -125,6 +125,11 @@ for you. This option can be specially useful in situations when you do not know
44 the name of the package, or if the application window has stopped responding
45 and you cannot report the problem from the "Help" menu of the application.
46
47+This option is not supported on Wayland. Users running Wayland should use another
48+option such as
49+.B -P
50+to specify the application.
51+
52 .SH ENVIRONMENT
53
54 .TP

Subscribers

People subscribed via source and target branches