Skip to content

Commit

Permalink
Merge branch 'main' into wlr-0.17
Browse files Browse the repository at this point in the history
  • Loading branch information
flacjacket authored May 13, 2024
2 parents 13a4fb3 + 8cbea97 commit 2477830
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 22 deletions.
13 changes: 11 additions & 2 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
0.17.0
0.17.0 -- 2024-mm-dd
------
* Support for wlroots 0.17.x
* rename all declarations of XdgTopLevel.* to XdgToplevel.*
* **Breaking change** Rename all declarations of XdgTopLevel.* to XdgToplevel.*


0.16.9 -- 2024-05-12
--------------------
* Fixed ``Seat.touch_point_clear_focus``: The method took too many arguments
which were not aligned to the wlroots counterpart and lead to a runtime error.
* Fixed ``Renderer.autocreate`` return value check. This also replaces some of
the exceptions from render_texture and render_texture_with_matrix with
boolean return values.


0.16.8 -- 2024-05-04
Expand Down
20 changes: 7 additions & 13 deletions wlroots/renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ def __init__(self, ptr) -> None:
@staticmethod
def autocreate(backend: Backend) -> Renderer:
"""Creates a suitable renderer for a backend."""
ret = lib.wlr_renderer_autocreate(backend._ptr)
if not ret:
renderer_ptr = lib.wlr_renderer_autocreate(backend._ptr)
if renderer_ptr == ffi.NULL:
raise RuntimeError("Unable to create a renderer.")
return Renderer(ret)
return Renderer(renderer_ptr)

def init_display(self, display: Display) -> None:
"""Creates necessary shm and invokes the initialization of the implementation
Expand Down Expand Up @@ -66,25 +66,19 @@ def clear(self, color: ColorType) -> None:

def render_texture(
self, texture: Texture, projection: Matrix, x: int, y: int, alpha: float
) -> None:
) -> bool:
"""Renders the requested texture"""
ret = lib.wlr_render_texture(
return lib.wlr_render_texture(
self._ptr, texture._ptr, projection._ptr, x, y, alpha
)
if not ret:
# TODO: get a better exception type
raise Exception("Bad render")

def render_texture_with_matrix(
self, texture: Texture, matrix: Matrix, alpha: float
) -> None:
) -> bool:
"""Renders the requested texture using the provided matrix"""
ret = lib.wlr_render_texture_with_matrix(
return lib.wlr_render_texture_with_matrix(
self._ptr, texture._ptr, matrix._ptr, alpha
)
if not ret:
# TODO: get a better exception type
raise Exception("Bad render")

def render_rect(self, box: Box, color: ColorType, projection: Matrix) -> None:
"""Renders a solid rectangle in the specified color."""
Expand Down
2 changes: 1 addition & 1 deletion wlroots/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Copyright (c) Sean Vig 2021

version = "0.16.8"
version = "0.16.9"
7 changes: 1 addition & 6 deletions wlroots/wlr_types/seat.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,16 +382,11 @@ def touch_point_focus(

def touch_point_clear_focus(
self,
surface: Surface,
time_msec: int,
touch_id: int,
surface_x: float,
surface_y: float,
) -> None:
"""Clear the focused surface for the touch point given by `touch_id`."""
lib.wlr_seat_touch_point_clear_focus(
self._ptr, surface._ptr, time_msec, touch_id, surface_x, surface_y
)
lib.wlr_seat_touch_point_clear_focus(self._ptr, time_msec, touch_id)

def touch_notify_cancel(self, surface: Surface):
"""Notify the seat that this is a global gesture and the client should
Expand Down

0 comments on commit 2477830

Please sign in to comment.