aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar emersion <contact@emersion.fr>2018-04-05 17:22:39 -0400
committerLibravatar emersion <contact@emersion.fr>2018-04-05 17:22:39 -0400
commit07f3bb3ad126e48247207126b977688a77e03928 (patch)
tree872b6f42ad6adee7e82ac7985f49462fd62aeaa0
parentMake xwayland surface destroy more foolproof (diff)
downloadsway-07f3bb3ad126e48247207126b977688a77e03928.tar.gz
sway-07f3bb3ad126e48247207126b977688a77e03928.tar.zst
sway-07f3bb3ad126e48247207126b977688a77e03928.zip
Handle xwayland configure requests for unmanaged surfaces
-rw-r--r--include/sway/tree/view.h1
-rw-r--r--sway/desktop/xwayland.c13
2 files changed, 14 insertions, 0 deletions
diff --git a/include/sway/tree/view.h b/include/sway/tree/view.h
index e52bee66..faf38bdf 100644
--- a/include/sway/tree/view.h
+++ b/include/sway/tree/view.h
@@ -87,6 +87,7 @@ struct sway_xwayland_unmanaged {
87 struct wlr_xwayland_surface *wlr_xwayland_surface; 87 struct wlr_xwayland_surface *wlr_xwayland_surface;
88 struct wl_list link; 88 struct wl_list link;
89 89
90 struct wl_listener request_configure;
90 struct wl_listener commit; 91 struct wl_listener commit;
91 struct wl_listener map; 92 struct wl_listener map;
92 struct wl_listener unmap; 93 struct wl_listener unmap;
diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c
index 0a70b680..3842c2c8 100644
--- a/sway/desktop/xwayland.c
+++ b/sway/desktop/xwayland.c
@@ -14,6 +14,16 @@
14#include "sway/input/input-manager.h" 14#include "sway/input/input-manager.h"
15#include "log.h" 15#include "log.h"
16 16
17static void unmanaged_handle_request_configure(struct wl_listener *listener,
18 void *data) {
19 struct sway_xwayland_unmanaged *surface =
20 wl_container_of(listener, surface, request_configure);
21 struct wlr_xwayland_surface *xsurface = surface->wlr_xwayland_surface;
22 struct wlr_xwayland_surface_configure_event *ev = data;
23 wlr_xwayland_surface_configure(xsurface, ev->x, ev->y,
24 ev->width, ev->height);
25}
26
17static void unmanaged_handle_commit(struct wl_listener *listener, void *data) { 27static void unmanaged_handle_commit(struct wl_listener *listener, void *data) {
18 struct sway_xwayland_unmanaged *surface = 28 struct sway_xwayland_unmanaged *surface =
19 wl_container_of(listener, surface, commit); 29 wl_container_of(listener, surface, commit);
@@ -63,6 +73,9 @@ static struct sway_xwayland_unmanaged *create_unmanaged(
63 73
64 surface->wlr_xwayland_surface = xsurface; 74 surface->wlr_xwayland_surface = xsurface;
65 75
76 wl_signal_add(&xsurface->events.request_configure,
77 &surface->request_configure);
78 surface->request_configure.notify = unmanaged_handle_request_configure;
66 wl_signal_add(&xsurface->events.map, &surface->map); 79 wl_signal_add(&xsurface->events.map, &surface->map);
67 surface->map.notify = unmanaged_handle_map; 80 surface->map.notify = unmanaged_handle_map;
68 wl_signal_add(&xsurface->events.unmap, &surface->unmap); 81 wl_signal_add(&xsurface->events.unmap, &surface->unmap);