diff options
author | leigh123linux <leigh123linux@googlemail.com> | 2017-06-20 15:33:20 +0200 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2017-06-20 15:33:20 +0200 |
commit | b37ceae7c7a8dbbaa76c74a7720f9d77b2aebcd9 (patch) | |
tree | b91e13aaa51b9e8220075c81e123b8e8ebc413f9 /src/main-window.vala | |
parent | 54ff85c43d86c3ec4c02734d7487f2737f03f7ab (diff) | |
download | arctica-greeter-b37ceae7c7a8dbbaa76c74a7720f9d77b2aebcd9.tar.gz arctica-greeter-b37ceae7c7a8dbbaa76c74a7720f9d77b2aebcd9.tar.bz2 arctica-greeter-b37ceae7c7a8dbbaa76c74a7720f9d77b2aebcd9.zip |
Add basic screenshot capability. Ported from slick-greeter.
Diffstat (limited to 'src/main-window.vala')
-rw-r--r-- | src/main-window.vala | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/main-window.vala b/src/main-window.vala index b5252ad..ac87200 100644 --- a/src/main-window.vala +++ b/src/main-window.vala @@ -384,6 +384,19 @@ public class MainWindow : Gtk.Window case Gdk.Key.PowerOff: show_shutdown_dialog (ShutdownDialogType.SHUTDOWN); return true; + case Gdk.Key.Print: + debug ("Taking screenshot"); + var root = Gdk.get_default_root_window (); + var screenshot = Gdk.pixbuf_get_from_window (root, 0, 0, root.get_width (), root.get_height ()); + try + { + screenshot.save ("Screenshot.png", "png", null); + } + catch (Error e) + { + warning ("Failed to save screenshot: %s", e.message); + } + return true; case Gdk.Key.z: if (ArcticaGreeter.singleton.test_mode && (event.state & Gdk.ModifierType.MOD1_MASK) != 0) { |