Add x, y, width, height arguments to wlr_xwayland_surface_configure

This commit is contained in:
emersion 2017-09-30 16:33:04 +02:00
parent e19b39b66b
commit 7f5d0624d6
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48
3 changed files with 15 additions and 18 deletions

View file

@ -81,7 +81,8 @@ struct wlr_xwayland *wlr_xwayland_create(struct wl_display *wl_display,
void wlr_xwayland_surface_activate(struct wlr_xwayland *wlr_xwayland, void wlr_xwayland_surface_activate(struct wlr_xwayland *wlr_xwayland,
struct wlr_xwayland_surface *surface); struct wlr_xwayland_surface *surface);
void wlr_xwayland_surface_configure(struct wlr_xwayland *wlr_xwayland, void wlr_xwayland_surface_configure(struct wlr_xwayland *wlr_xwayland,
struct wlr_xwayland_surface *surface); struct wlr_xwayland_surface *surface, int16_t x, int16_t y,
uint16_t width, uint16_t height);
void wlr_xwayland_surface_close(struct wlr_xwayland *wlr_xwayland, void wlr_xwayland_surface_close(struct wlr_xwayland *wlr_xwayland,
struct wlr_xwayland_surface *surface); struct wlr_xwayland_surface *surface);

View file

@ -12,9 +12,8 @@
static void resize(struct roots_view *view, uint32_t width, uint32_t height) { static void resize(struct roots_view *view, uint32_t width, uint32_t height) {
assert(view->type == ROOTS_XWAYLAND_VIEW); assert(view->type == ROOTS_XWAYLAND_VIEW);
struct wlr_xwayland_surface *xwayland_surface = view->xwayland_surface; struct wlr_xwayland_surface *xwayland_surface = view->xwayland_surface;
xwayland_surface->width = width; wlr_xwayland_surface_configure(view->desktop->xwayland, xwayland_surface,
xwayland_surface->height = height; xwayland_surface->x, xwayland_surface->y, width, height);
wlr_xwayland_surface_configure(view->desktop->xwayland, xwayland_surface);
} }
static void handle_destroy(struct wl_listener *listener, void *data) { static void handle_destroy(struct wl_listener *listener, void *data) {
@ -32,16 +31,11 @@ static void handle_request_configure(struct wl_listener *listener, void *data) {
roots_surface->view->xwayland_surface; roots_surface->view->xwayland_surface;
struct wlr_xwayland_surface_configure_event *event = data; struct wlr_xwayland_surface_configure_event *event = data;
xwayland_surface->x = event->x;
xwayland_surface->y = event->y;
xwayland_surface->width = event->width;
xwayland_surface->height = event->height;
roots_surface->view->x = (double)event->x; roots_surface->view->x = (double)event->x;
roots_surface->view->y = (double)event->y; roots_surface->view->y = (double)event->y;
wlr_xwayland_surface_configure(roots_surface->view->desktop->xwayland, wlr_xwayland_surface_configure(roots_surface->view->desktop->xwayland,
xwayland_surface); xwayland_surface, event->x, event->y, event->width, event->height);
} }
static void activate(struct roots_view *view, bool active) { static void activate(struct roots_view *view, bool active) {

View file

@ -355,11 +355,8 @@ static void handle_configure_request(struct wlr_xwm *xwm,
if (surface->surface == NULL) { if (surface->surface == NULL) {
// Surface has not been mapped yet // Surface has not been mapped yet
surface->x = ev->x; wlr_xwayland_surface_configure(xwm->xwayland, surface, ev->x, ev->y,
surface->y = ev->y; ev->width, ev->height);
surface->width = ev->width;
surface->height = ev->height;
wlr_xwayland_surface_configure(xwm->xwayland, surface);
} else { } else {
struct wlr_xwayland_surface_configure_event *wlr_event = struct wlr_xwayland_surface_configure_event *wlr_event =
calloc(1, sizeof(struct wlr_xwayland_surface_configure_event)); calloc(1, sizeof(struct wlr_xwayland_surface_configure_event));
@ -610,13 +607,18 @@ void wlr_xwayland_surface_activate(struct wlr_xwayland *wlr_xwayland,
} }
void wlr_xwayland_surface_configure(struct wlr_xwayland *wlr_xwayland, void wlr_xwayland_surface_configure(struct wlr_xwayland *wlr_xwayland,
struct wlr_xwayland_surface *surface) { struct wlr_xwayland_surface *surface, int16_t x, int16_t y,
uint16_t width, uint16_t height) {
surface->x = x;
surface->y = y;
surface->width = width;
surface->height = height;
struct wlr_xwm *xwm = wlr_xwayland->xwm; struct wlr_xwm *xwm = wlr_xwayland->xwm;
uint32_t mask = XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y | uint32_t mask = XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y |
XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT | XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT |
XCB_CONFIG_WINDOW_BORDER_WIDTH; XCB_CONFIG_WINDOW_BORDER_WIDTH;
uint32_t values[] = {surface->x, surface->y, surface->width, uint32_t values[] = {x, y, width, height, 0};
surface->height, 0};
xcb_configure_window(xwm->xcb_conn, surface->window_id, mask, values); xcb_configure_window(xwm->xcb_conn, surface->window_id, mask, values);
} }