Merge lp:~robert-ancell/unity-greeter/screenshot into lp:unity-greeter

Proposed by Robert Ancell
Status: Needs review
Proposed branch: lp:~robert-ancell/unity-greeter/screenshot
Merge into: lp:unity-greeter
Diff against target: 23 lines (+13/-0)
1 file modified
src/main-window.vala (+13/-0)
To merge this branch: bzr merge lp:~robert-ancell/unity-greeter/screenshot
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Needs Fixing
Unity Greeter Development Team Pending
Review via email: mp+221634@code.launchpad.net

Commit message

Save screenshot when pressing Print Screen key

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Khurshid Alam (khurshid-alam) wrote :

I checked this compiles & works. +1 for me

Unmerged revisions

1260. By Robert Ancell

Save screenshot when pressing Print Screen key

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/main-window.vala'
2--- src/main-window.vala 2014-03-26 21:25:01 +0000
3+++ src/main-window.vala 2014-06-01 11:48:09 +0000
4@@ -346,6 +346,19 @@
5 case Gdk.Key.PowerOff:
6 show_shutdown_dialog (ShutdownDialogType.SHUTDOWN);
7 return true;
8+ case Gdk.Key.Print:
9+ debug ("Taking screenshot");
10+ var root = Gdk.get_default_root_window ();
11+ var screenshot = Gdk.pixbuf_get_from_window (root, 0, 0, root.get_width (), root.get_height ());
12+ try
13+ {
14+ screenshot.save ("Screenshot.png", "png", null);
15+ }
16+ catch (Error e)
17+ {
18+ warning ("Failed to save screenshot: %s", e.message);
19+ }
20+ return true;
21 case Gdk.Key.z:
22 if (UnityGreeter.singleton.test_mode && (event.state & Gdk.ModifierType.MOD1_MASK) != 0)
23 {

Subscribers

People subscribed via source and target branches