<html>
    <head>
      <base href="https://bugs.freedesktop.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - It is impossible to screenshot a user selected window."
   href="https://bugs.freedesktop.org/show_bug.cgi?id=99635">99635</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>It is impossible to screenshot a user selected window.
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>Wayland
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>1.2.x
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>wayland
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>wayland-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>naelstrof@gmail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>With the current security of Wayland, it's impossible to allow a user to select
a window to screenshot. A coveted feature of screen shooting in X11.

There's multiple things that'd have to happen for this to work properly:
1. Gnome would have to add a "surface-handle" parameter to their
org.gnome.Shell.Screenshot.ScreenshotWindow function. (other compositors would
have to do something similar)
2. Wayland OR Gnome's compositor would need to publicly expose window
positions, sizes, and "surface-handles".

The reason I put surface-handle in quotes is because that'd be an obviously bad
security flaw, it doesn't have to be a REAL surface handle. Just some sort of
identification number in order to communicate with the compositor which window
needs to be captured. Anytime I refer to "surface-handles" I actually mean an
identification number referring to a specific surface.

So my question is: in order to make screen shooting on Wayland more robust-- is
it the responsibility of the Compositor or Wayland itself to expose surface
information?

As for security, I don't think exposing surface positions or sizes is bad at
all since it's already possible to make global silent screenshots through
gnome's compositor. As for exposing "surface-handles" I can see that reducing
security somewhat, since that'd allow a Wayland application to see even
off-screen windows. Though I don't see the utility of scrying off-screen
windows from the perspective of a malicious application.

The reason I need window positions and sizes is because I'm porting
[slop](<a href="https://github.com/naelstrof/slop">https://github.com/naelstrof/slop</a>) to Wayland. The reason I need
"surface-handles" is for [maim](<a href="https://github.com/naelstrof/maim">https://github.com/naelstrof/maim</a>).

P.S. Here's some reasons for including this feature:
A user might write a script that screenshots a minimized/off-screen
Counter-Strike game repeatedly to check to see if a match has been found to
send him an email/text/sound.
Time-lapses of specific applications, even if they get minimized or moved
off-screen.
Screen shooting specific locations in games (like a healthbar, dps graph in
path of exile).
Computer-illiterates would appreciate if gnome-screenshot's --interactive
option would easily allow for responsive, automatic window selection.
(Especially if the window is poorly placed or only partially visible.)

Thanks for reading!</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>