mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-10-31 22:25:21 -04:00
Revert "Copy xcb_icccm structs into wlroots"
The original commit introduced a bug by transposing the order of
some of the fields in xcb_size_hints_t. Since XCB ICCCM support is
required now, we can just eliminate the duplicate structs.
With minor changes:
- Remove #ifdef HAS_XCB_ICCCM guards
- Fix #includes
- Fix references to local size_hints struct
This reverts commit 12b9b1a4bd.
This commit is contained in:
parent
d3a2ea33e5
commit
640f3b9f21
2 changed files with 11 additions and 45 deletions
|
|
@ -15,7 +15,6 @@
|
|||
#include <xcb/composite.h>
|
||||
#include <xcb/render.h>
|
||||
#include <xcb/res.h>
|
||||
#include <xcb/xcb_icccm.h>
|
||||
#include <xcb/xfixes.h>
|
||||
#include "util/signal.h"
|
||||
#include "xwayland/xwm.h"
|
||||
|
|
@ -662,17 +661,12 @@ static void read_surface_hints(struct wlr_xwm *xwm,
|
|||
return;
|
||||
}
|
||||
|
||||
xcb_icccm_wm_hints_t hints;
|
||||
xcb_icccm_get_wm_hints_from_reply(&hints, reply);
|
||||
|
||||
free(xsurface->hints);
|
||||
xsurface->hints = calloc(1, sizeof(struct wlr_xwayland_surface_hints));
|
||||
xsurface->hints = calloc(1, sizeof(xcb_icccm_wm_hints_t));
|
||||
if (xsurface->hints == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
memcpy(xsurface->hints, &hints, sizeof(struct wlr_xwayland_surface_hints));
|
||||
xsurface->hints_urgency = xcb_icccm_wm_hints_get_urgency(&hints);
|
||||
xcb_icccm_get_wm_hints_from_reply(xsurface->hints, reply);
|
||||
|
||||
if (!(xsurface->hints->flags & XCB_ICCCM_WM_HINT_INPUT)) {
|
||||
// The client didn't specify whether it wants input.
|
||||
|
|
@ -690,20 +684,16 @@ static void read_surface_normal_hints(struct wlr_xwm *xwm,
|
|||
return;
|
||||
}
|
||||
|
||||
xcb_size_hints_t size_hints;
|
||||
xcb_icccm_get_wm_size_hints_from_reply(&size_hints, reply);
|
||||
|
||||
free(xsurface->size_hints);
|
||||
xsurface->size_hints =
|
||||
calloc(1, sizeof(struct wlr_xwayland_surface_size_hints));
|
||||
xsurface->size_hints = calloc(1, sizeof(xcb_size_hints_t));
|
||||
if (xsurface->size_hints == NULL) {
|
||||
return;
|
||||
}
|
||||
memcpy(xsurface->size_hints, &size_hints,
|
||||
sizeof(struct wlr_xwayland_surface_size_hints));
|
||||
xcb_icccm_get_wm_size_hints_from_reply(xsurface->size_hints, reply);
|
||||
|
||||
bool has_min_size_hints = (size_hints.flags & XCB_ICCCM_SIZE_HINT_P_MIN_SIZE) != 0;
|
||||
bool has_base_size_hints = (size_hints.flags & XCB_ICCCM_SIZE_HINT_BASE_SIZE) != 0;
|
||||
int32_t flags = xsurface->size_hints->flags;
|
||||
bool has_min_size_hints = (flags & XCB_ICCCM_SIZE_HINT_P_MIN_SIZE) != 0;
|
||||
bool has_base_size_hints = (flags & XCB_ICCCM_SIZE_HINT_BASE_SIZE) != 0;
|
||||
/* ICCCM says that if absent, min size is equal to base size and vice versa */
|
||||
if (!has_min_size_hints && !has_base_size_hints) {
|
||||
xsurface->size_hints->min_width = -1;
|
||||
|
|
@ -718,7 +708,7 @@ static void read_surface_normal_hints(struct wlr_xwm *xwm,
|
|||
xsurface->size_hints->min_height = xsurface->size_hints->base_height;
|
||||
}
|
||||
|
||||
if ((size_hints.flags & XCB_ICCCM_SIZE_HINT_P_MAX_SIZE) == 0) {
|
||||
if ((flags & XCB_ICCCM_SIZE_HINT_P_MAX_SIZE) == 0) {
|
||||
xsurface->size_hints->max_width = -1;
|
||||
xsurface->size_hints->max_height = -1;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue