Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion wlroots/ffi_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
48 changes: 48 additions & 0 deletions wlroots/xwayland.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
Loading