Skip to content
  • Martin Flöser's avatar
    [effects] Add a screenshot dbus method which takes a file descriptor · fbab2049
    Martin Flöser authored
    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.
    
    Reviewers: #kwin, #plasma_on_wayland
    
    Subscribers: plasma-devel, kwin
    
    Tags: #plasma_on_wayland, #kwin
    
    Differential Revision: https://phabricator.kde.org/D3412
    fbab2049