flacjacket / pywlroots

Python binding to the wlroots library using cffi
University of Illinois/NCSA Open Source License
51 stars 12 forks source link

Seat.set_keyboard should accept None #137

Closed heuer closed 6 months ago

heuer commented 6 months ago

Acc. to https://wayland.emersion.fr/wlroots/wlr/types/wlr_seat.h.html#func-wlr_seat_set_keyboard NULL values are accepted, at least they are not forbidden.

Proposal: Change https://github.com/flacjacket/pywlroots/blob/main/wlroots/wlr_types/seat.py#L232

    def set_keyboard(self, keyboard: Keyboard) -> None:

to:

    def set_keyboard(self, keyboard: Keyboard | None) -> None:
heuer commented 6 months ago

See also https://github.com/flacjacket/pywlroots/blob/b38b6ceab0a4cf7cc8d755217b365702f59692cb/wlroots/wlr_types/seat.py#L119 which may return None

heuer commented 6 months ago

Apart from the mentioned problem: keyboard is a property, set_keyboard could be converted to a property setter?

flacjacket commented 6 months ago

Great point!

heuer commented 6 months ago

I'll provide a PR