KSnapshot is getting an overhaul.

It's actually a little more complicated than that. I started to work on the KF5 port of KSnapshot (EDIT: no, contrary to what Phoronix claims this port is not my work; I simply wanted to fix anything that needed fixing) sometime in early March this year, before I realised that the codebase, while perfectly in order for being a X11-only screenshot taker for KDE (yes, KSnapshot actually has a complete and fairly decent KF5 port in its frameworks branch on KDE Git), was in need of a major overhaul if we were going to get proper Wayland support in.

To that effect, I started working on a completely new screenshot application, copying in the bits and pieces of code from KSnapshot that I could actually use. It's called KScreenGenie, and has been living in KDE's Git infrastructure for quite a long time. It's currently in KDE Review, and will be moved to KDE Graphics in time for the Applications 15.12 release. Not just that, it will be renamed to KSnapshot, so people upgrading their computers will seamlessly upgrade from KSnapshot to KSnapshot 2.0 a.k.a. KScreenGenie.

But KScreenGenie in its current form and with its current name is actually going to see a public release. The code in the master branch of the git repository is currently in doc and string freeze, and is actually considered stable enough for daily use. A distribution called KaOS already ships it, I've been using it as my primary screenshooting tool for months now, and other KDE developers have also spent time using and testing it and fixing minor issues. So barring major blocker bugs that pop up anytime soon, KScreenGenie 2.0.0 will be released (independently of the KDE Applications) on August 15, 2015.

If you're so inclined, here's a little bit of technical information on how KScreenGenie is different from KSnapshot. The biggest internal change is how pictures are actually acquired - instead of using Qt's built in screenshooting APIs, KScreenGenie uses the native API for the platform that it's running on. Currently, only one working platform backend exists, and that's for X11, using xcb. We use libkscreen for properly figuring out screen layout information so that we can take proper multi-monitor screenshots (we don't support Zaphod mode though). On Wayland, because the platform specific bits are so well separated from the platform-independent bits, the application starts up, but does not actually take a screenshot. The reason is that there's no stable API for taking screenshots in Wayland yet (Weston has its own API, and while some of KWin's screenshot effect APIs work, all don't), and thus we don't actually have a working Wayland image grabber yet.

A particularly nice user-facing feature is the ability to take screenshots of transient windows (pop-up menus, for example) along with the parent window. In KSnapshot, if you chose "Window Under Cursor" as your mode and hover over a pop-up menu, only the pop-up menu is captured (technically the pop-up menu is a X11 window). In KScreenGenie, we actually have code to detect if the window is a transient window and if so, we try to figure out who the parent window is and then take a composite shot of both the parent and the transient. Note though, that this currently only works with Gtk3 and Qt5 applications, since only these toolkits set the WM_TRANSIENT_FOR property on their pop-up windows, thus enabling us to figure out who their parent is.

I'm also currently working on a basic image editor integrated into KScreenGenie for editing and annotating screenshots within KScreenGenie itself. The code isn't online yet, since it's nowhere near even half-baked, but hopefully it'll be there by 15.12 or at the very most 16.04.

I'd like to encourage distributions to package KScreenGenie 2.0.0 in their primary repositories, and users to use it, test it and report bugs. Distribution packagers who do include KScreenGenie in their repositories do need to mark the KSnapshot package from Applications 15.12 as replacing, providing and obsoleting the KScreenGenie package though.

Happy clicking!


I use ksnapshot to take Steam game snapshots, it works with pressing print screen while game is full screen-windowed mode, will this still work?

By Shawn at Wed, 12/16/2015 - 22:50

It seems that the latest "official" release of ksnapshot is is 15.08.3 which is still based on kde4... ? Can you tell us what's the current status of the KF5+wayland port this post is about ? Still lying in git but unreleased ?

By Orzel at Fri, 02/19/2016 - 00:19

I think following changes would be great:

1. If I am using "Save as" please allow save dialog to open the last used folder.

2. Default save location should be a separate button (or if an option)

3. For me taking screenshots of "Window Under Cursor" didn't work, it took screenshots of random screen areas.

By KDE User at Mon, 03/07/2016 - 21:28

My workflow has been severely disrupted by the loss of ksnapshot. I've used ksnapshot for many years working on websites, I could easily find the size of images or areas on the screen and within the browser window. When defining a region the image size information was displayed. I could get image size information easily just by opening ksnapshot and dragging the mouse over the area I wanted to see the size of. That was a useful and important tool for me. Now I have to take a screenshot, save it, then tell spectacle to "save as" because it defaults to saving in it's own directory, then reopen the image in gimp.

By Joseph at Wed, 09/27/2017 - 12:38

I need to take screenshots often, why bloat a simple utility with editing. There's the amazing gwenview, there's krita, there's gimp, there's digicam. Please don't bloat the screenshot program with functionality that exists in countless other places.

By Joseph at Wed, 09/27/2017 - 12:45