Skip to content

Commit f0031ea

Browse files
authored
Merge pull request #203 from RFCreate/hints_flags
Add xcb_icccm_wm_hints_t attributes
2 parents 73d99ac + bb926f1 commit f0031ea

File tree

2 files changed

+56
-1
lines changed

2 files changed

+56
-1
lines changed

wlroots/ffi_build.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3151,7 +3151,14 @@ def has_xwayland() -> bool:
31513151
typedef uint32_t xcb_window_t;
31523152
typedef uint32_t xcb_atom_t;
31533153
typedef struct {
3154-
...;
3154+
int32_t flags;
3155+
uint32_t input;
3156+
int32_t initial_state;
3157+
xcb_pixmap_t icon_pixmap;
3158+
xcb_window_t icon_window;
3159+
int32_t icon_x, icon_y;
3160+
xcb_pixmap_t icon_mask;
3161+
xcb_window_t window_group;
31553162
} xcb_icccm_wm_hints_t;
31563163
typedef struct {
31573164
uint32_t flags;

wlroots/xwayland.py

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,13 @@ def protocols(self) -> list[int]:
312312
"""This is an array of xcb_atom_t."""
313313
return ffi.unpack(self._ptr.protocols, self._ptr.protocols_len)
314314

315+
@property
316+
def hints(self) -> Hints | None:
317+
ptr = self._ptr.hints
318+
if ptr == ffi.NULL:
319+
return None
320+
return Hints(ptr)
321+
315322
@property
316323
def size_hints(self) -> SizeHints | None:
317324
ptr = self._ptr.size_hints
@@ -423,6 +430,47 @@ def minimize(self) -> bool:
423430
return self._ptr.minimize
424431

425432

433+
class Hints(Ptr):
434+
def __init__(self, ptr) -> None:
435+
self._ptr = ffi.cast("xcb_icccm_wm_hints_t *", ptr)
436+
437+
@property
438+
def flags(self) -> int:
439+
return self._ptr.flags
440+
441+
@property
442+
def input(self) -> int:
443+
return self._ptr.input
444+
445+
@property
446+
def initial_state(self) -> int:
447+
return self._ptr.initial_state
448+
449+
@property
450+
def icon_pixmap(self) -> int:
451+
return self._ptr.icon_pixmap
452+
453+
@property
454+
def icon_window(self) -> int:
455+
return self._ptr.icon_window
456+
457+
@property
458+
def icon_x(self) -> int:
459+
return self._ptr.icon_x
460+
461+
@property
462+
def icon_y(self) -> int:
463+
return self._ptr.icon_y
464+
465+
@property
466+
def icon_mask(self) -> int:
467+
return self._ptr.icon_mask
468+
469+
@property
470+
def window_group(self) -> int:
471+
return self._ptr.window_group
472+
473+
426474
class SizeHints(Ptr):
427475
def __init__(self, ptr) -> None:
428476
self._ptr = ffi.cast("xcb_size_hints_t *", ptr)

0 commit comments

Comments
 (0)