diff --git a/src/Core/FlatpakBackend.vala b/src/Core/FlatpakBackend.vala index f6f649e0a..f44594f13 100644 --- a/src/Core/FlatpakBackend.vala +++ b/src/Core/FlatpakBackend.vala @@ -149,14 +149,14 @@ public class AppCenterCore.FlatpakBackend : Object, Backend { unowned var app = (Gtk.Application) GLib.Application.get_default (); - if (inhibit_token == 0) { + if (inhibit_token == 0 && job.operation.should_inhibit ()) { /* If you came here trying to debug the critical `assertion 'GTK_IS_NATIVE (self)' failed`: This was a bug in GTK and has been fixed so this should go away in OS 9 https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/8638 */ inhibit_token = app.inhibit ( app.get_active_window (), Gtk.ApplicationInhibitFlags.IDLE | Gtk.ApplicationInhibitFlags.SUSPEND, - _("package operations are being performed") + job.operation.to_string () ); } diff --git a/src/Core/Job.vala b/src/Core/Job.vala index a950ffa51..38d8d9322 100644 --- a/src/Core/Job.vala +++ b/src/Core/Job.vala @@ -54,6 +54,18 @@ public class AppCenterCore.Job : Object { return ""; } + + public bool should_inhibit () { + switch (this) { + case INSTALL_PACKAGE: + case UPDATE_PACKAGE: + case REMOVE_PACKAGE: + case REPAIR: + return true; + } + + return false; + } } public Job (Type type) {