aboutsummaryrefslogtreecommitdiff
path: root/dwl.c
diff options
context:
space:
mode:
authorGuido Cella <guido@guidocella.xyz>2020-12-08 15:10:41 +0100
committerGuido Cella <guido@guidocella.xyz>2020-12-19 12:34:32 +0100
commit0f48c9552eaec29e1aac0165bc0e472b05e17ecd (patch)
tree50a4cfe50e457cc0fc5dd7f8b3576c3f5b1bbfc6 /dwl.c
parent0016a209e4ecb23159a887d6baf26063287a40a6 (diff)
handle the x11 configure event
This fixes the window size of old games in Wine.
Diffstat (limited to 'dwl.c')
-rw-r--r--dwl.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/dwl.c b/dwl.c
index d883d82..924823b 100644
--- a/dwl.c
+++ b/dwl.c
@@ -96,6 +96,7 @@ typedef struct {
} surface;
#ifdef XWAYLAND
struct wl_listener activate;
+ struct wl_listener configure;
#endif
struct wl_listener commit;
struct wl_listener map;
@@ -335,6 +336,7 @@ static struct wl_listener request_set_sel = {.notify = setsel};
#ifdef XWAYLAND
static void activatex11(struct wl_listener *listener, void *data);
+static void configurex11(struct wl_listener *listener, void *data);
static void createnotifyx11(struct wl_listener *listener, void *data);
static Atom getatom(xcb_connection_t *xc, const char *name);
static void renderindependents(struct wlr_output *output, struct timespec *now);
@@ -2389,6 +2391,15 @@ activatex11(struct wl_listener *listener, void *data)
}
void
+configurex11(struct wl_listener *listener, void *data)
+{
+ Client *c = wl_container_of(listener, c, configure);
+ struct wlr_xwayland_surface_configure_event *event = data;
+ wlr_xwayland_surface_configure(c->surface.xwayland,
+ event->x, event->y, event->width, event->height);
+}
+
+void
createnotifyx11(struct wl_listener *listener, void *data)
{
struct wlr_xwayland_surface *xwayland_surface = data;
@@ -2407,6 +2418,8 @@ createnotifyx11(struct wl_listener *listener, void *data)
wl_signal_add(&xwayland_surface->events.unmap, &c->unmap);
c->activate.notify = activatex11;
wl_signal_add(&xwayland_surface->events.request_activate, &c->activate);
+ c->configure.notify = configurex11;
+ wl_signal_add(&xwayland_surface->events.request_configure, &c->configure);
c->destroy.notify = destroynotify;
wl_signal_add(&xwayland_surface->events.destroy, &c->destroy);
}