mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-22 12:55:58 +01:00
Use pointers for xwayland hints and size_hints
This commit is contained in:
parent
267f24753f
commit
fc61e82795
2 changed files with 21 additions and 9 deletions
|
@ -59,11 +59,11 @@ struct wlr_xwayland_surface {
|
|||
|
||||
uint32_t motif_hints[5];
|
||||
#ifdef HAS_XCB_ICCCM
|
||||
xcb_icccm_wm_hints_t hints;
|
||||
xcb_size_hints_t size_hints;
|
||||
xcb_icccm_wm_hints_t *hints;
|
||||
xcb_size_hints_t *size_hints;
|
||||
#else
|
||||
char hints_padding[36];
|
||||
char size_hints_padding[72];
|
||||
void *hints;
|
||||
void *size_hints;
|
||||
#endif
|
||||
|
||||
struct {
|
||||
|
|
|
@ -89,12 +89,14 @@ static void wlr_xwayland_surface_destroy(struct wlr_xwayland_surface *surface) {
|
|||
for (size_t i = 0; i < surface->state->length; i++) {
|
||||
free(surface->state->items[i]);
|
||||
}
|
||||
free(surface->title);
|
||||
free(surface->class);
|
||||
free(surface->instance);
|
||||
list_free(surface->state);
|
||||
free(surface->window_type);
|
||||
free(surface->protocols);
|
||||
free(surface->class);
|
||||
free(surface->instance);
|
||||
free(surface->title);
|
||||
free(surface->hints);
|
||||
free(surface->size_hints);
|
||||
free(surface);
|
||||
}
|
||||
|
||||
|
@ -286,7 +288,12 @@ static void read_surface_hints(struct wlr_xwm *xwm,
|
|||
return;
|
||||
}
|
||||
|
||||
xcb_icccm_get_wm_hints_from_reply(&surface->hints, reply);
|
||||
free(surface->hints);
|
||||
surface->hints = calloc(1, sizeof(xcb_icccm_wm_hints_t));
|
||||
if (surface->hints == NULL) {
|
||||
return;
|
||||
}
|
||||
xcb_icccm_get_wm_hints_from_reply(surface->hints, reply);
|
||||
|
||||
wlr_log(L_DEBUG, "WM_HINTS (%d)", reply->value_len);
|
||||
}
|
||||
|
@ -304,7 +311,12 @@ static void read_surface_normal_hints(struct wlr_xwm *xwm,
|
|||
return;
|
||||
}
|
||||
|
||||
xcb_icccm_get_wm_size_hints_from_reply(&surface->size_hints, reply);
|
||||
free(surface->size_hints);
|
||||
surface->size_hints = calloc(1, sizeof(xcb_size_hints_t));
|
||||
if (surface->size_hints == NULL) {
|
||||
return;
|
||||
}
|
||||
xcb_icccm_get_wm_size_hints_from_reply(surface->size_hints, reply);
|
||||
|
||||
wlr_log(L_DEBUG, "WM_NORMAL_HINTS (%d)", reply->value_len);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue