[effects] Add a screenshot dbus method which takes a file descriptor
ClosedPublic

Authored by graesslin on Nov 18 2016, 9:09 AM.

Details

Summary

The idea behind this mode is to support applications like spectacle
(see T4458). The calling application passes a file descriptor (created
through e.g. a pipe) and the screenshot effect writes the captured image
into that fd.

The advantage over the existing variant which writes to a file in the
/tmp directory is that this is peer-to-peer between the requesting
application and KWin. No other application can get to that image.

The change also includes setting SIGPIPE to ignore. It showed that when
the reading side already cancelled the read prior to KWin writing out
the image we get a SIGPIPE which results in application termination,
which is not what we want in case of a Wayland compositor. The sigpipe
can be ignored as Qt (and libpng) handles that error just fine at
runtime.

Diff Detail

Repository
R108 KWin
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
graesslin updated this revision to Diff 8298.Nov 18 2016, 9:09 AM
graesslin retitled this revision from to [effects] Add a screenshot dbus method which takes a file descriptor.
graesslin updated this object.
graesslin edited the test plan for this revision. (Show Details)
graesslin added reviewers: KWin, Plasma on Wayland.
Restricted Application added projects: Plasma on Wayland, KWin. · View Herald TranscriptNov 18 2016, 9:09 AM
Restricted Application added subscribers: kwin, plasma-devel. · View Herald Transcript
mart accepted this revision.Nov 18 2016, 11:41 AM
mart added a reviewer: mart.
This revision is now accepted and ready to land.Nov 18 2016, 11:41 AM
This revision was automatically updated to reflect the committed changes.