diff --git a/src/ScreenshotManager.vala b/src/ScreenshotManager.vala index b3c04105..78653d4d 100644 --- a/src/ScreenshotManager.vala +++ b/src/ScreenshotManager.vala @@ -139,6 +139,10 @@ namespace Gala yield; selection_area.destroy (); + if (selection_area.cancelled) { + throw new GLib.IOError.CANCELLED ("Operation was cancelled"); + } + yield wait_stage_repaint (); selection_area.get_selection_rectangle (out x, out y, out width, out height); } diff --git a/src/Widgets/SelectionArea.vala b/src/Widgets/SelectionArea.vala index 30d8616e..13f5ad6b 100644 --- a/src/Widgets/SelectionArea.vala +++ b/src/Widgets/SelectionArea.vala @@ -16,13 +16,15 @@ // namespace Gala -{ +{ public class SelectionArea : Clutter.Actor { public signal void closed (); public WindowManager wm { get; construct; } + public bool cancelled { get; private set; } + private ModalProxy? modal_proxy; private Gdk.Point start_point; private Gdk.Point end_point; @@ -58,6 +60,7 @@ namespace Gala { if (e.keyval == Clutter.Key.Escape) { close (); + cancelled = true; closed (); return true; } @@ -87,6 +90,7 @@ namespace Gala if (!dragging) { close (); + cancelled = true; closed (); return true; } @@ -167,4 +171,4 @@ namespace Gala return true; } } -} \ No newline at end of file +}