ext_surface_capture_control_v1
- external
This protocol allows clients to control and receive notifications about screen capture activities affecting their surfaces.
It provides two main features: 1. Capture exclude regions - areas that should not be included in captures 2. Capture state notifications - informing clients when their surface is being captured
This is useful for protecting sensitive content (passwords, private messages, personal information) and allowing applications to adapt their UI when being recorded or shared.
Warning! The protocol described in this file is currently in the testing phase. Backward compatible changes may be added together with the corresponding interface version bump. Backward incompatible changes can only be done by creating a new major version of the extension.
This interface is a factory for ext_surface_capture_control_v1 objects, which provide capture control and notification for individual surfaces.
get_surface_capture_control(id: new_id<ext_surface_capture_control_v1>, surface: object<wl_surface>)
Argument | Type | Description |
---|---|---|
id | new_id<ext_surface_capture_control_v1> | |
surface | object<wl_surface> |
Create a capture control object for a wl_surface. This object provides capture exclusion and state notification capabilities for the surface.
If a capture control object already exists for the surface, the already_constructed protocol error is raised.
destroy()
Destroy the manager. This does not affect existing capture control objects.
error { already_constructed }
Argument | Value | Description |
---|---|---|
already_constructed | 0 | surface already has a capture control object |
ext_surface_capture_control_v1
This interface allows clients to control capture behavior and receive notifications about capture activities for a specific surface.
Capture control state is double-buffered and applied on wl_surface.commit.
Argument | Type | Description |
---|---|---|
region | object<wl_region>allow null | region to exclude from capture, or null to clear |
Set the region of the surface that should be excluded from screen capture and recording. This is useful for protecting sensitive content such as password fields, private messages, or personal information.
The exclude region is specified in surface-local coordinates.
The compositor ignores parts of the exclude region that fall outside the surface boundaries.
This is double-buffered state, see wl_surface.commit.
Setting a new exclude region replaces the previous one. Setting the region to NULL clears the exclude region (everything can be captured).
The initial exclude region is empty (nothing is excluded).
The compositor should respect this region when performing screen capture operations. However, compositors may choose to ignore this request for security, accessibility, or policy reasons (e.g., when screen capture is required by administrators or assistive technologies).
destroy()
Destroy the capture control object. Any pending exclude region state is discarded.
capture_state(state: uint<ext_surface_capture_control_v1.capture_state>)
Argument | Type | Description |
---|---|---|
state | uint<ext_surface_capture_control_v1.capture_state> | current capture state |
This event is sent whenever the capture state of the surface changes. It indicates whether the surface is currently being captured (recorded, or shared) by the compositor or client applications.
This event is sent immediately after the capture control object is created, with the current capture state. Subsequent events are sent whenever the state changes.
Capturing state is a hint intended to help the client make an informed decision about whether to alert the user.
Note: This is a best-effort notification. The compositor may not be able to detect all capture activities, especially those performed by external hardware or software outside the compositor's control. Additionally, this event is only sent when the surface is being captured individually (e.g., via ext_image_capture_source_v1). It is not sent when the surface is captured as part of a larger area, such as output or workspace capture.
Indicates whether the surface is currently being captured.
Compositor Support
Copyright
Copyright © 2025 YaoBing Xiao
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.