aboutsummaryrefslogtreecommitdiff
path: root/xwayland
diff options
context:
space:
mode:
authorTony Crisci <tony@dubstepdish.com>2017-10-26 11:39:08 -0400
committerTony Crisci <tony@dubstepdish.com>2017-10-26 11:39:08 -0400
commit930ab0685738a150c6e23b6030877f479accf50f (patch)
tree542742323e9f950165557084e9daddacb318ccea /xwayland
parent263279b7e0f84e9fece884bb3d87d908da8cfb80 (diff)
xwm: send net_wm_state
Diffstat (limited to 'xwayland')
-rw-r--r--xwayland/xwm.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/xwayland/xwm.c b/xwayland/xwm.c
index 93dfdbff..afbc1387 100644
--- a/xwayland/xwm.c
+++ b/xwayland/xwm.c
@@ -615,9 +615,36 @@ static void handle_configure_notify(struct wlr_xwm *xwm,
xsurface->height = ev->height;
}
+#define ICCCM_WITHDRAWN_STATE 0
+#define ICCCM_NORMAL_STATE 1
+#define ICCCM_ICONIC_STATE 3
+
+static void xsurface_set_wm_state(struct wlr_xwayland_surface *xsurface,
+ int32_t state) {
+ struct wlr_xwm *xwm = xsurface->xwm;
+ uint32_t property[2];
+
+ property[0] = state;
+ property[1] = XCB_WINDOW_NONE;
+
+ xcb_change_property(xwm->xcb_conn,
+ XCB_PROP_MODE_REPLACE,
+ xsurface->window_id,
+ xwm->atoms[NET_WM_STATE],
+ xwm->atoms[NET_WM_STATE],
+ 32, // format
+ 2, property);
+}
+
static void handle_map_request(struct wlr_xwm *xwm,
xcb_map_request_event_t *ev) {
wlr_log(L_DEBUG, "XCB_MAP_REQUEST (%u)", ev->window);
+ struct wlr_xwayland_surface *xsurface = lookup_surface(xwm, ev->window);
+ if (!xsurface) {
+ return;
+ }
+
+ xsurface_set_wm_state(xsurface, ICCCM_NORMAL_STATE);
xcb_map_window(xwm->xcb_conn, ev->window);
}
@@ -651,6 +678,8 @@ static void handle_unmap_notify(struct wlr_xwm *xwm,
xsurface->mapped = false;
wl_signal_emit(&xsurface->events.unmap_notify, xsurface);
}
+
+ xsurface_set_wm_state(xsurface, ICCCM_WITHDRAWN_STATE);
}
static void handle_property_notify(struct wlr_xwm *xwm,