aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2018-04-05 17:22:39 -0400
committeremersion <contact@emersion.fr>2018-04-05 17:22:39 -0400
commit07f3bb3ad126e48247207126b977688a77e03928 (patch)
tree872b6f42ad6adee7e82ac7985f49462fd62aeaa0
parenta528aea2ee87a211edd3e6df83f2d408656430ab (diff)
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 {
struct wlr_xwayland_surface *wlr_xwayland_surface;
struct wl_list link;
+ struct wl_listener request_configure;
struct wl_listener commit;
struct wl_listener map;
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 @@
#include "sway/input/input-manager.h"
#include "log.h"
+static void unmanaged_handle_request_configure(struct wl_listener *listener,
+ void *data) {
+ struct sway_xwayland_unmanaged *surface =
+ wl_container_of(listener, surface, request_configure);
+ struct wlr_xwayland_surface *xsurface = surface->wlr_xwayland_surface;
+ struct wlr_xwayland_surface_configure_event *ev = data;
+ wlr_xwayland_surface_configure(xsurface, ev->x, ev->y,
+ ev->width, ev->height);
+}
+
static void unmanaged_handle_commit(struct wl_listener *listener, void *data) {
struct sway_xwayland_unmanaged *surface =
wl_container_of(listener, surface, commit);
@@ -63,6 +73,9 @@ static struct sway_xwayland_unmanaged *create_unmanaged(
surface->wlr_xwayland_surface = xsurface;
+ wl_signal_add(&xsurface->events.request_configure,
+ &surface->request_configure);
+ surface->request_configure.notify = unmanaged_handle_request_configure;
wl_signal_add(&xsurface->events.map, &surface->map);
surface->map.notify = unmanaged_handle_map;
wl_signal_add(&xsurface->events.unmap, &surface->unmap);