Skip to content

Commit

Permalink
Wlroots Scene: Add wlr_scene_subsurface_tree_set_clip
Browse files Browse the repository at this point in the history
  • Loading branch information
jwijenbergh committed May 12, 2024
1 parent 575a816 commit 2b4919b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
3 changes: 3 additions & 0 deletions wlroots/ffi_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -1898,6 +1898,9 @@ def has_xwayland() -> bool:
struct wlr_scene_tree *wlr_scene_subsurface_tree_create(
struct wlr_scene_tree *parent, struct wlr_surface *surface);
void wlr_scene_subsurface_tree_set_clip(struct wlr_scene_node *node,
struct wlr_box *clip);
struct wlr_scene_tree *wlr_scene_xdg_surface_create(
struct wlr_scene_tree *parent, struct wlr_xdg_surface *xdg_surface);
Expand Down
11 changes: 11 additions & 0 deletions wlroots/wlr_types/scene.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,17 @@ def for_each_buffer(
self._ptr, lib.buffer_iterator_callback, handle
)

def subsurface_tree_set_clip(self, clip: Box | None):
"""
Sets a cropping region for any subsurface trees that are children of this scene node.
A None value will disable clipping
"""
clip_ptr = ffi.NULL
if clip is not None:
clip_ptr = clip._ptr
lib.wlr_scene_subsurface_tree_set_clip(self._ptr, clip_ptr)


class SceneSurface(Ptr):
def __init__(self, ptr) -> None:
Expand Down

0 comments on commit 2b4919b

Please sign in to comment.