diff options
author | emersion <contact@emersion.fr> | 2017-09-29 16:19:06 +0200 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2017-09-29 16:19:06 +0200 |
commit | 47d767dbc4fc88e399a7a2ef3edde9d906a7f773 (patch) | |
tree | 0ff8723810dd0e53ead5881aa1bcca56ab0b7e04 | |
parent | e3917af69d1801a6deafa580f77b0feb10562992 (diff) |
xwayland: expose wlr_xwayland_surface_configure
-rw-r--r-- | include/wlr/xwayland.h | 3 | ||||
-rw-r--r-- | xwayland/xwm.c | 19 |
2 files changed, 16 insertions, 6 deletions
diff --git a/include/wlr/xwayland.h b/include/wlr/xwayland.h index 23910139..17582e7d 100644 --- a/include/wlr/xwayland.h +++ b/include/wlr/xwayland.h @@ -56,5 +56,8 @@ struct wlr_xwayland *wlr_xwayland_create(struct wl_display *wl_display, struct wlr_compositor *compositor); void wlr_xwayland_surface_activate(struct wlr_xwayland *wlr_xwayland, struct wlr_xwayland_surface *surface); +void wlr_xwayland_surface_configure(struct wlr_xwm *xwm, + struct wlr_xwayland_surface *surface, uint32_t x, uint32_t y, + uint32_t width, uint32_t height); #endif diff --git a/xwayland/xwm.c b/xwayland/xwm.c index 37f4298d..83b096aa 100644 --- a/xwayland/xwm.c +++ b/xwayland/xwm.c @@ -199,13 +199,10 @@ static void handle_configure_request(struct wlr_xwm *xwm, surface->y = ev->y; surface->width = ev->width; surface->height = ev->height; - // handle parent/sibling? + // TODO: handle parent/sibling? - uint32_t values[] = {ev->x, ev->y, ev->width, ev->height, 0}; - uint32_t mask = XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y | - XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT | - XCB_CONFIG_WINDOW_BORDER_WIDTH; - xcb_configure_window(xwm->xcb_conn, ev->window, mask, values); + wlr_xwayland_surface_configure(xwm, surface, ev->x, ev->y, ev->width, + ev->height); } static void handle_map_request(struct wlr_xwm *xwm, @@ -430,6 +427,16 @@ void wlr_xwayland_surface_activate(struct wlr_xwayland *wlr_xwayland, xcb_flush(xwm->xcb_conn); } +void wlr_xwayland_surface_configure(struct wlr_xwm *xwm, + struct wlr_xwayland_surface *surface, uint32_t x, uint32_t y, + uint32_t width, uint32_t height) { + uint32_t mask = XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y | + XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT | + XCB_CONFIG_WINDOW_BORDER_WIDTH; + uint32_t values[] = {x, y, width, height, 0}; + xcb_configure_window(xwm->xcb_conn, surface->window_id, mask, values); +} + void xwm_destroy(struct wlr_xwm *xwm) { if (!xwm) { return; |