xwayland: expose wlr_xwayland_surface_configure

This commit is contained in:
emersion 2017-09-29 16:19:06 +02:00
parent e3917af69d
commit 47d767dbc4
No known key found for this signature in database
GPG Key ID: 0FDE7BE0E88F5E48
2 changed files with 16 additions and 6 deletions

View File

@ -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

View File

@ -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;