Skip to content

Commit

Permalink
[base] correctly handle serialization of optional proxy value
Browse files Browse the repository at this point in the history
  • Loading branch information
aslpavel committed Sep 28, 2024
1 parent 41563d7 commit b307f0a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion examples/metaballs.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def draw(self, now: int | None = None) -> None:
self._buf_index = (self._buf_index + 1) % len(self._bufs)
self.render(image, now)
self._wl_surf.attach(buf, 0, 0)
self._wl_surf.damage_buffer(0, 0, INT32_MAX, INT32_MAX)
self._wl_surf.damage_buffer(0, 0, self._width, self._height)

def _on_buf_release(self, index: int) -> Callable[[], bool]:
def _on_buf_release() -> bool:
Expand Down
1 change: 1 addition & 0 deletions wayland/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,7 @@ def __init__(self, name: str, interface: str | None, optional: bool = False):
def pack(self, write: io.BytesIO, value: Any) -> None:
if self.optional and value is None:
write.write(self.struct.pack(0))
return
if not isinstance(value, Proxy):
raise TypeError(f"[{self.name}] proxy object expected {value}")
if self.interface is not None and self.interface != value._interface.name:
Expand Down

0 comments on commit b307f0a

Please sign in to comment.