Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Application: Fix open button in toasts #1597

Merged
merged 3 commits into from
Aug 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 12 additions & 0 deletions data/io.elementary.appcenter.appdata.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,18 @@
<p>The open source, pay-what-you-want app store from elementary. Reviewed and curated by elementary to ensure a native, privacy-respecting, and secure experience. Browse by categories or search and discover new apps. AppCenter is also used for updating your system to the latest and greatest version for new features and fixes.</p>
</description>
<releases>
<release version="3.6.3" date="2021-08-13" urgency="medium">
<description>
<p>Fixes:</p>
<ul>
<li>Fix opening apps from app installed toasts</li>
</ul>
<p>Improvements:</p>
<ul>
<li>Updated translations</li>
</ul>
</description>
</release>
<release version="3.6.2" date="2021-08-09" urgency="medium">
<description>
<p>Fixes:</p>
Expand Down
28 changes: 15 additions & 13 deletions src/Application.vala
Original file line number Diff line number Diff line change
Expand Up @@ -282,22 +282,24 @@ public class AppCenter.App : Gtk.Application {
switch (operation) {
case AppCenterCore.Package.State.INSTALLING:
if (error == null) {
// Check if window is focused
if (main_window != null) {
var win = main_window.get_window ();
if (win != null && (win.get_state () & Gdk.WindowState.FOCUSED) != 0) {
main_window.send_installed_toast (package);

break;
if (package.get_can_launch ()) {
// Check if window is focused
if (main_window != null) {
var win = main_window.get_window ();
if (win != null && (win.get_state () & Gdk.WindowState.FOCUSED) != 0) {
main_window.send_installed_toast (package);

break;
}
}
}

var notification = new Notification (_("The app has been installed"));
notification.set_body (_("“%s” has been installed").printf (package.get_name ()));
notification.set_icon (new ThemedIcon ("process-completed"));
notification.set_default_action ("app.open-application");
var notification = new Notification (_("The app has been installed"));
notification.set_body (_("“%s” has been installed").printf (package.get_name ()));
notification.set_icon (new ThemedIcon ("process-completed"));
notification.set_default_action ("app.open-application");

send_notification ("installed", notification);
send_notification ("installed", notification);
}
} else {
// Check if permission was denied or the operation was cancelled
if (error.matches (IOError.quark (), 19) || error.matches (Pk.ClientError.quark (), 303)) {
Expand Down