diff options
author | korei999 <ju7t1xe@gmail.com> | 2024-04-01 15:13:11 +0300 |
---|---|---|
committer | Squibid <me@zacharyscheiman.com> | 2025-02-11 22:48:19 -0600 |
commit | 95065adb2a1081d9d1a2ad6a3cdda6f5f80bbb4a (patch) | |
tree | 9afa7788f466bca44dd6278f8016fee15cdcdba0 /dwl.c | |
parent | 22891d3da5c7f06e80620d24599c0f12b6c5d18b (diff) | |
download | dwl-95065adb2a1081d9d1a2ad6a3cdda6f5f80bbb4a.tar.gz dwl-95065adb2a1081d9d1a2ad6a3cdda6f5f80bbb4a.tar.bz2 dwl-95065adb2a1081d9d1a2ad6a3cdda6f5f80bbb4a.zip |
handle minimize request for xwayland clients
Diffstat (limited to 'dwl.c')
-rw-r--r-- | dwl.c | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -132,6 +132,7 @@ typedef struct { #ifdef XWAYLAND struct wl_listener activate; struct wl_listener associate; + struct wl_listener minimize; struct wl_listener dissociate; struct wl_listener configure; struct wl_listener set_hints; @@ -469,6 +470,8 @@ static void associatex11(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 void dissociatex11(struct wl_listener *listener, void *data); +static xcb_atom_t getatom(xcb_connection_t *xc, const char *name); +static void minimizenotify(struct wl_listener *listener, void *data); static void sethints(struct wl_listener *listener, void *data); static void xwaylandready(struct wl_listener *listener, void *data); static struct wl_listener new_xwayland_surface = {.notify = createnotifyx11}; @@ -1365,6 +1368,7 @@ destroynotify(struct wl_listener *listener, void *data) wl_list_remove(&c->activate.link); wl_list_remove(&c->associate.link); wl_list_remove(&c->configure.link); + wl_list_remove(&c->minimize.link); wl_list_remove(&c->dissociate.link); wl_list_remove(&c->set_hints.link); } else @@ -3396,6 +3400,7 @@ createnotifyx11(struct wl_listener *listener, void *data) LISTEN(&xsurface->events.destroy, &c->destroy, destroynotify); LISTEN(&xsurface->events.dissociate, &c->dissociate, dissociatex11); LISTEN(&xsurface->events.request_activate, &c->activate, activatex11); + LISTEN(&xsurface->events.request_minimize, &c->minimize, minimizenotify); LISTEN(&xsurface->events.request_configure, &c->configure, configurex11); LISTEN(&xsurface->events.request_fullscreen, &c->fullscreen, fullscreennotify); LISTEN(&xsurface->events.set_hints, &c->set_hints, sethints); @@ -3411,6 +3416,21 @@ dissociatex11(struct wl_listener *listener, void *data) } void +minimizenotify(struct wl_listener *listener, void *data) +{ + Client *c = wl_container_of(listener, c, minimize); + struct wlr_xwayland_surface *xsurface = c->surface.xwayland; + struct wlr_xwayland_minimize_event *e = data; + int focused; + + if (xsurface->surface == NULL || !xsurface->surface->mapped) + return; + + focused = seat->keyboard_state.focused_surface == xsurface->surface; + wlr_xwayland_surface_set_minimized(xsurface, !focused && e->minimize); +} + +void sethints(struct wl_listener *listener, void *data) { Client *c = wl_container_of(listener, c, set_hints); |