aboutsummaryrefslogtreecommitdiffstats
path: root/sway
diff options
context:
space:
mode:
authorLibravatar emersion <contact@emersion.fr>2018-03-31 11:30:15 -0400
committerLibravatar emersion <contact@emersion.fr>2018-03-31 11:30:15 -0400
commit98b67e2399df70d1e8354d5641744d1730a60189 (patch)
tree74db4df45a42e0c652b2dc98f2e9f5e2c9e7560c /sway
parentFix unmanaged views rendering on all outputs (diff)
downloadsway-98b67e2399df70d1e8354d5641744d1730a60189.tar.gz
sway-98b67e2399df70d1e8354d5641744d1730a60189.tar.zst
sway-98b67e2399df70d1e8354d5641744d1730a60189.zip
Fix xwayland configure in set_size
Diffstat (limited to 'sway')
-rw-r--r--sway/desktop/output.c10
-rw-r--r--sway/desktop/xwayland.c6
-rw-r--r--sway/input/cursor.c32
3 files changed, 26 insertions, 22 deletions
diff --git a/sway/desktop/output.c b/sway/desktop/output.c
index 24c0bf40..0d706c52 100644
--- a/sway/desktop/output.c
+++ b/sway/desktop/output.c
@@ -247,11 +247,13 @@ static void render_output(struct sway_output *output, struct timespec *when,
247 continue; 247 continue;
248 } 248 }
249 249
250 struct wlr_xwayland_surface *xsurface = view->wlr_xwayland_surface;
251
250 const struct wlr_box view_box = { 252 const struct wlr_box view_box = {
251 .x = view->wlr_xwayland_surface->x, 253 .x = xsurface->x,
252 .y = view->wlr_xwayland_surface->y, 254 .y = xsurface->y,
253 .width = view->wlr_xwayland_surface->width, 255 .width = xsurface->width,
254 .height = view->wlr_xwayland_surface->height, 256 .height = xsurface->height,
255 }; 257 };
256 struct wlr_box intersection; 258 struct wlr_box intersection;
257 if (!wlr_box_intersection(&view_box, output_box, &intersection)) { 259 if (!wlr_box_intersection(&view_box, output_box, &intersection)) {
diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c
index 5f9c99a3..bbaa88c8 100644
--- a/sway/desktop/xwayland.c
+++ b/sway/desktop/xwayland.c
@@ -41,7 +41,7 @@ static void set_size(struct sway_view *view, int width, int height) {
41 view->sway_xwayland_surface->pending_height = height; 41 view->sway_xwayland_surface->pending_height = height;
42 42
43 struct wlr_xwayland_surface *xsurface = view->wlr_xwayland_surface; 43 struct wlr_xwayland_surface *xsurface = view->wlr_xwayland_surface;
44 wlr_xwayland_surface_configure(xsurface, view->swayc->x, view->swayc->y, 44 wlr_xwayland_surface_configure(xsurface, xsurface->x, xsurface->y,
45 width, height); 45 width, height);
46} 46}
47 47
@@ -151,7 +151,7 @@ static void handle_map(struct wl_listener *listener, void *data) {
151 view_damage_whole(sway_surface->view); 151 view_damage_whole(sway_surface->view);
152} 152}
153 153
154static void handle_configure_request(struct wl_listener *listener, void *data) { 154static void handle_request_configure(struct wl_listener *listener, void *data) {
155 struct sway_xwayland_surface *sway_surface = 155 struct sway_xwayland_surface *sway_surface =
156 wl_container_of(listener, sway_surface, request_configure); 156 wl_container_of(listener, sway_surface, request_configure);
157 struct wlr_xwayland_surface_configure_event *ev = data; 157 struct wlr_xwayland_surface_configure_event *ev = data;
@@ -206,7 +206,7 @@ void handle_xwayland_surface(struct wl_listener *listener, void *data) {
206 206
207 wl_signal_add(&xsurface->events.request_configure, 207 wl_signal_add(&xsurface->events.request_configure,
208 &sway_surface->request_configure); 208 &sway_surface->request_configure);
209 sway_surface->request_configure.notify = handle_configure_request; 209 sway_surface->request_configure.notify = handle_request_configure;
210 210
211 wl_signal_add(&xsurface->events.unmap, &sway_surface->unmap); 211 wl_signal_add(&xsurface->events.unmap, &sway_surface->unmap);
212 sway_surface->unmap.notify = handle_unmap; 212 sway_surface->unmap.notify = handle_unmap;
diff --git a/sway/input/cursor.c b/sway/input/cursor.c
index 74af6426..67776f8f 100644
--- a/sway/input/cursor.c
+++ b/sway/input/cursor.c
@@ -50,21 +50,23 @@ static struct sway_container *container_at_cursor(struct sway_cursor *cursor,
50 struct wl_list *unmanaged = &root_container.sway_root->unmanaged_views; 50 struct wl_list *unmanaged = &root_container.sway_root->unmanaged_views;
51 struct sway_view *view; 51 struct sway_view *view;
52 wl_list_for_each_reverse(view, unmanaged, unmanaged_view_link) { 52 wl_list_for_each_reverse(view, unmanaged, unmanaged_view_link) {
53 if (view->type == SWAY_XWAYLAND_VIEW) { 53 if (view->type != SWAY_XWAYLAND_VIEW) {
54 struct wlr_xwayland_surface *xsurface = view->wlr_xwayland_surface; 54 continue;
55 struct wlr_box box = { 55 }
56 .x = xsurface->x, 56
57 .y = xsurface->y, 57 struct wlr_xwayland_surface *xsurface = view->wlr_xwayland_surface;
58 .width = xsurface->width, 58 struct wlr_box box = {
59 .height = xsurface->height, 59 .x = xsurface->x,
60 }; 60 .y = xsurface->y,
61 61 .width = xsurface->width,
62 if (wlr_box_contains_point(&box, cursor->x, cursor->y)) { 62 .height = xsurface->height,
63 *surface = xsurface->surface; 63 };
64 *sx = cursor->x - box.x; 64
65 *sy = cursor->y - box.y; 65 if (wlr_box_contains_point(&box, cursor->x, cursor->y)) {
66 return NULL; 66 *surface = xsurface->surface;
67 } 67 *sx = cursor->x - box.x;
68 *sy = cursor->y - box.y;
69 return NULL;
68 } 70 }
69 } 71 }
70 72