Skip to content

Commit

Permalink
Merge branch 'main' into leolost/recognizing-instead-with-gesture
Browse files Browse the repository at this point in the history
  • Loading branch information
lenemter authored Jan 26, 2025
2 parents c941e5b + 741f2ac commit b0575c6
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/WindowManager.vala
Original file line number Diff line number Diff line change
Expand Up @@ -2325,6 +2325,10 @@ namespace Gala {
bool success = false;
string filename_used = "";
yield screenshot_manager.screenshot_window (true, false, true, filename, out success, out filename_used);

if (success) {
send_screenshot_notification (clipboard);
}
} catch (Error e) {
// Ignore this error
}
Expand All @@ -2339,6 +2343,10 @@ namespace Gala {
int x, y, w, h;
yield screenshot_manager.select_area (out x, out y, out w, out h);
yield screenshot_manager.screenshot_area (x, y, w, h, true, filename, out success, out filename_used);

if (success) {
send_screenshot_notification (clipboard);
}
} catch (Error e) {
// Ignore this error
}
Expand All @@ -2350,9 +2358,23 @@ namespace Gala {
bool success = false;
string filename_used = "";
yield screenshot_manager.screenshot (false, true, filename, out success, out filename_used);

if (success) {
send_screenshot_notification (clipboard);
}
} catch (Error e) {
// Ignore this error
}
}

private void send_screenshot_notification (bool clipboard) {
notifications_manager.send.begin (
"ScreenshotManager",
"image-x-generic",
_("Screenshot taken"),
clipboard ? _("Screenshot is saved to clipboard") : _("Screenshot saved to screenshots folder"),
new GLib.HashTable<string, Variant> (null, null)
);
}
}
}

0 comments on commit b0575c6

Please sign in to comment.