Skip to content

LayerSurfaceV1: Output setter: Accept None as valid value #224

@heuer

Description

@heuer

In wlroots it's possible to set the output of a layer_surface to NULL.
pywlroots checks in the output getter if output is NULL and returns None, but setting the output to None results in an error:

    self._ptr.output = output._ptr
                       ^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute '_ptr'

See https://github.com/flacjacket/pywlroots/blob/main/wlroots/wlr_types/layer_shell_v1.py#L117

Proposal:

@output.setter
def output(self, output: Output | None):
    self._ptr.output = ptr_or_null(output)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions