Skip to content

Commit

Permalink
[alien] add snapshot functionality to the alien-manager protocol. JB#…
Browse files Browse the repository at this point in the history
…49069
  • Loading branch information
krnlyng committed Apr 17, 2020
1 parent 1e4ffb0 commit 6ca4701
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
8 changes: 8 additions & 0 deletions protocol/alien-manager.xml
Expand Up @@ -214,5 +214,13 @@
kill it.
</description>
</event>

<request name="snapshot">
<description summary="ask the server to take a snapshot of the surface">
By calling this request the client asks the compositor to snapshot
this surface. The snapshot will be shown on the surface until a new
frame is posted.
</description>
</request>
</interface>
</protocol>
8 changes: 8 additions & 0 deletions src/compositor/alienmanager/aliensurface.cpp
Expand Up @@ -124,6 +124,14 @@ void AlienSurface::alien_surface_set_minimized(Resource *resource)
emit surface()->lowerRequested();
}

void AlienSurface::alien_surface_snapshot(Resource *resource)
{
Q_UNUSED(resource)
// calling configure with hasBuffer = false here will cause
// WindowPixmapItem to take a snapshot
emit surface()->configure(false);
}

void AlienSurface::configure(bool hasBuffer)
{
if (hasBuffer && m_serial == 0) {
Expand Down
1 change: 1 addition & 0 deletions src/compositor/alienmanager/aliensurface.h
Expand Up @@ -36,6 +36,7 @@ class AlienSurface : public QObject, public QWaylandSurfaceInterface, public Qt
void alien_surface_ack_configure(Resource *resource, uint32_t serial) Q_DECL_OVERRIDE;
void alien_surface_request_state(Resource *resource, wl_array *states, uint32_t serial) Q_DECL_OVERRIDE;
void alien_surface_set_minimized(Resource *resource) Q_DECL_OVERRIDE;
void alien_surface_snapshot(Resource *resource) Q_DECL_OVERRIDE;

private:
void configure(bool hasBuffer);
Expand Down

0 comments on commit 6ca4701

Please sign in to comment.