graesslin created this revision. graesslin added reviewers: KWin, Plasma on Wayland. Restricted Application added subscribers: kwin, plasma-devel. Restricted Application added projects: Plasma on Wayland, KWin.
REVISION SUMMARY The idea behind this mode is to support applications like spectacle (see https://phabricator.kde.org/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. REPOSITORY rKWIN KWin BRANCH screenshot-fd-variant REVISION DETAIL https://phabricator.kde.org/D3412 AFFECTED FILES effects/screenshot/screenshot.cpp effects/screenshot/screenshot.h main_wayland.cpp main_x11.cpp EMAIL PREFERENCES https://phabricator.kde.org/settings/panel/emailpreferences/ To: graesslin, #kwin, #plasma_on_wayland Cc: plasma-devel, kwin, lesliezhai, ali-mohamed, hardening, jensreuterberg, abetts, sebas