aboutsummaryrefslogtreecommitdiff
path: root/xwayland/xwm.c
diff options
context:
space:
mode:
Diffstat (limited to 'xwayland/xwm.c')
-rw-r--r--xwayland/xwm.c26
1 files changed, 20 insertions, 6 deletions
diff --git a/xwayland/xwm.c b/xwayland/xwm.c
index 1fb6f331..8c1777b7 100644
--- a/xwayland/xwm.c
+++ b/xwayland/xwm.c
@@ -313,6 +313,7 @@ static void xwayland_surface_destroy(
wl_list_for_each_safe(child, next, &xsurface->children, parent_link) {
wl_list_remove(&child->parent_link);
wl_list_init(&child->parent_link);
+ child->parent = NULL;
}
if (xsurface->surface_id) {
@@ -522,6 +523,12 @@ static void read_surface_hints(struct wlr_xwm *xwm,
memcpy(xsurface->hints, &hints, sizeof(struct wlr_xwayland_surface_hints));
xsurface->hints_urgency = xcb_icccm_wm_hints_get_urgency(&hints);
+ if (!(xsurface->hints->flags & XCB_ICCCM_WM_HINT_INPUT)) {
+ // The client didn't specify whether it wants input.
+ // Assume it does.
+ xsurface->hints->input = true;
+ }
+
wlr_log(WLR_DEBUG, "WM_HINTS (%d)", reply->value_len);
wlr_signal_emit_safe(&xsurface->events.set_hints, xsurface);
}
@@ -797,8 +804,6 @@ static void xwm_handle_destroy_notify(struct wlr_xwm *xwm,
static void xwm_handle_configure_request(struct wlr_xwm *xwm,
xcb_configure_request_event_t *ev) {
- wlr_log(WLR_DEBUG, "XCB_CONFIGURE_REQUEST (%u) [%ux%u+%d,%d]", ev->window,
- ev->width, ev->height, ev->x, ev->y);
struct wlr_xwayland_surface *surface = lookup_surface(xwm, ev->window);
if (surface == NULL) {
return;
@@ -806,13 +811,22 @@ static void xwm_handle_configure_request(struct wlr_xwm *xwm,
// TODO: handle ev->{parent,sibling}?
+ uint16_t mask = ev->value_mask;
+ uint16_t geo_mask = XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y |
+ XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT;
+ if ((mask & geo_mask) == 0) {
+ return;
+ }
+
struct wlr_xwayland_surface_configure_event wlr_event = {
.surface = surface,
- .x = ev->x,
- .y = ev->y,
- .width = ev->width,
- .height = ev->height,
+ .x = mask & XCB_CONFIG_WINDOW_X ? ev->x : surface->x,
+ .y = mask & XCB_CONFIG_WINDOW_Y ? ev->y : surface->y,
+ .width = mask & XCB_CONFIG_WINDOW_WIDTH ? ev->width : surface->width,
+ .height = mask & XCB_CONFIG_WINDOW_HEIGHT ? ev->height : surface->height,
};
+ wlr_log(WLR_DEBUG, "XCB_CONFIGURE_REQUEST (%u) [%ux%u+%d,%d]", ev->window,
+ wlr_event.width, wlr_event.height, wlr_event.x, wlr_event.y);
wlr_signal_emit_safe(&surface->events.request_configure, &wlr_event);
}