mirror of
https://github.com/swaywm/sway.git
synced 2024-11-26 18:01:29 +00:00
Fix xwayland configure in set_size
This commit is contained in:
parent
0f7936735c
commit
98b67e2399
|
@ -247,11 +247,13 @@ static void render_output(struct sway_output *output, struct timespec *when,
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct wlr_xwayland_surface *xsurface = view->wlr_xwayland_surface;
|
||||||
|
|
||||||
const struct wlr_box view_box = {
|
const struct wlr_box view_box = {
|
||||||
.x = view->wlr_xwayland_surface->x,
|
.x = xsurface->x,
|
||||||
.y = view->wlr_xwayland_surface->y,
|
.y = xsurface->y,
|
||||||
.width = view->wlr_xwayland_surface->width,
|
.width = xsurface->width,
|
||||||
.height = view->wlr_xwayland_surface->height,
|
.height = xsurface->height,
|
||||||
};
|
};
|
||||||
struct wlr_box intersection;
|
struct wlr_box intersection;
|
||||||
if (!wlr_box_intersection(&view_box, output_box, &intersection)) {
|
if (!wlr_box_intersection(&view_box, output_box, &intersection)) {
|
||||||
|
|
|
@ -41,7 +41,7 @@ static void set_size(struct sway_view *view, int width, int height) {
|
||||||
view->sway_xwayland_surface->pending_height = height;
|
view->sway_xwayland_surface->pending_height = height;
|
||||||
|
|
||||||
struct wlr_xwayland_surface *xsurface = view->wlr_xwayland_surface;
|
struct wlr_xwayland_surface *xsurface = view->wlr_xwayland_surface;
|
||||||
wlr_xwayland_surface_configure(xsurface, view->swayc->x, view->swayc->y,
|
wlr_xwayland_surface_configure(xsurface, xsurface->x, xsurface->y,
|
||||||
width, height);
|
width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -151,7 +151,7 @@ static void handle_map(struct wl_listener *listener, void *data) {
|
||||||
view_damage_whole(sway_surface->view);
|
view_damage_whole(sway_surface->view);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void handle_configure_request(struct wl_listener *listener, void *data) {
|
static void handle_request_configure(struct wl_listener *listener, void *data) {
|
||||||
struct sway_xwayland_surface *sway_surface =
|
struct sway_xwayland_surface *sway_surface =
|
||||||
wl_container_of(listener, sway_surface, request_configure);
|
wl_container_of(listener, sway_surface, request_configure);
|
||||||
struct wlr_xwayland_surface_configure_event *ev = data;
|
struct wlr_xwayland_surface_configure_event *ev = data;
|
||||||
|
@ -206,7 +206,7 @@ void handle_xwayland_surface(struct wl_listener *listener, void *data) {
|
||||||
|
|
||||||
wl_signal_add(&xsurface->events.request_configure,
|
wl_signal_add(&xsurface->events.request_configure,
|
||||||
&sway_surface->request_configure);
|
&sway_surface->request_configure);
|
||||||
sway_surface->request_configure.notify = handle_configure_request;
|
sway_surface->request_configure.notify = handle_request_configure;
|
||||||
|
|
||||||
wl_signal_add(&xsurface->events.unmap, &sway_surface->unmap);
|
wl_signal_add(&xsurface->events.unmap, &sway_surface->unmap);
|
||||||
sway_surface->unmap.notify = handle_unmap;
|
sway_surface->unmap.notify = handle_unmap;
|
||||||
|
|
|
@ -50,7 +50,10 @@ static struct sway_container *container_at_cursor(struct sway_cursor *cursor,
|
||||||
struct wl_list *unmanaged = &root_container.sway_root->unmanaged_views;
|
struct wl_list *unmanaged = &root_container.sway_root->unmanaged_views;
|
||||||
struct sway_view *view;
|
struct sway_view *view;
|
||||||
wl_list_for_each_reverse(view, unmanaged, unmanaged_view_link) {
|
wl_list_for_each_reverse(view, unmanaged, unmanaged_view_link) {
|
||||||
if (view->type == SWAY_XWAYLAND_VIEW) {
|
if (view->type != SWAY_XWAYLAND_VIEW) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
struct wlr_xwayland_surface *xsurface = view->wlr_xwayland_surface;
|
struct wlr_xwayland_surface *xsurface = view->wlr_xwayland_surface;
|
||||||
struct wlr_box box = {
|
struct wlr_box box = {
|
||||||
.x = xsurface->x,
|
.x = xsurface->x,
|
||||||
|
@ -66,7 +69,6 @@ static struct sway_container *container_at_cursor(struct sway_cursor *cursor,
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// find the output the cursor is on
|
// find the output the cursor is on
|
||||||
struct wlr_output_layout *output_layout =
|
struct wlr_output_layout *output_layout =
|
||||||
|
|
Loading…
Reference in a new issue