diff --git a/wlroots/ffi_build.py b/wlroots/ffi_build.py index 8a0a0747..720a247d 100644 --- a/wlroots/ffi_build.py +++ b/wlroots/ffi_build.py @@ -3151,7 +3151,14 @@ def has_xwayland() -> bool: typedef uint32_t xcb_window_t; typedef uint32_t xcb_atom_t; typedef struct { - ...; + int32_t flags; + uint32_t input; + int32_t initial_state; + xcb_pixmap_t icon_pixmap; + xcb_window_t icon_window; + int32_t icon_x, icon_y; + xcb_pixmap_t icon_mask; + xcb_window_t window_group; } xcb_icccm_wm_hints_t; typedef struct { uint32_t flags; diff --git a/wlroots/xwayland.py b/wlroots/xwayland.py index c6853a87..a39f9066 100644 --- a/wlroots/xwayland.py +++ b/wlroots/xwayland.py @@ -312,6 +312,13 @@ def protocols(self) -> list[int]: """This is an array of xcb_atom_t.""" return ffi.unpack(self._ptr.protocols, self._ptr.protocols_len) + @property + def hints(self) -> Hints | None: + ptr = self._ptr.hints + if ptr == ffi.NULL: + return None + return Hints(ptr) + @property def size_hints(self) -> SizeHints | None: ptr = self._ptr.size_hints @@ -423,6 +430,47 @@ def minimize(self) -> bool: return self._ptr.minimize +class Hints(Ptr): + def __init__(self, ptr) -> None: + self._ptr = ffi.cast("xcb_icccm_wm_hints_t *", ptr) + + @property + def flags(self) -> int: + return self._ptr.flags + + @property + def input(self) -> int: + return self._ptr.input + + @property + def initial_state(self) -> int: + return self._ptr.initial_state + + @property + def icon_pixmap(self) -> int: + return self._ptr.icon_pixmap + + @property + def icon_window(self) -> int: + return self._ptr.icon_window + + @property + def icon_x(self) -> int: + return self._ptr.icon_x + + @property + def icon_y(self) -> int: + return self._ptr.icon_y + + @property + def icon_mask(self) -> int: + return self._ptr.icon_mask + + @property + def window_group(self) -> int: + return self._ptr.window_group + + class SizeHints(Ptr): def __init__(self, ptr) -> None: self._ptr = ffi.cast("xcb_size_hints_t *", ptr)