Skip to content

Commit

Permalink
wlroots: Support themes for xcursor manager
Browse files Browse the repository at this point in the history
  • Loading branch information
jwijenbergh committed May 10, 2024
1 parent b1b7b67 commit 6374ed5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tiny/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def main(argv) -> None:
xdg_shell = XdgShell(display)
with OutputLayout() as output_layout, Cursor(
output_layout
) as cursor, XCursorManager(24) as xcursor_manager, Seat(
) as cursor, XCursorManager(None, 24) as xcursor_manager, Seat(
display, "seat0"
) as seat:
scene = Scene()
Expand Down
11 changes: 7 additions & 4 deletions wlroots/wlr_types/xcursor_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,15 @@


class XCursorManager(Ptr):
def __init__(self, size, scale=1):
"""Creates a new XCursor manager
def __init__(self, theme: str | None, size: int = 24, scale: float = 1.):
"""Creates a new XCursor manager using the theme and size
Create cursor with base size and scale.
and ensures an xcursor with scale is loaded
"""
ptr = lib.wlr_xcursor_manager_create(ffi.NULL, size)
theme_ptr = ffi.NULL
if theme is not None:
theme_ptr = theme.encode()
ptr = lib.wlr_xcursor_manager_create(theme_ptr, size)
self._ptr = ffi.gc(ptr, lib.wlr_xcursor_manager_destroy)

lib.wlr_xcursor_manager_load(self._ptr, scale)
Expand Down

0 comments on commit 6374ed5

Please sign in to comment.