*/
void manage_window(xcb_window_t window, xcb_get_window_attributes_cookie_t cookie,
bool needs_to_be_mapped) {
+ DLOG("window 0x%08x\n", window);
+
xcb_drawable_t d = {window};
xcb_get_geometry_cookie_t geomc;
xcb_get_geometry_reply_t *geom;
wm_user_time_cookie = GET_PROPERTY(A__NET_WM_USER_TIME, UINT32_MAX);
wm_desktop_cookie = GET_PROPERTY(A__NET_WM_DESKTOP, UINT32_MAX);
- DLOG("Managing window 0x%08x\n", window);
-
i3Window *cwindow = scalloc(1, sizeof(i3Window));
cwindow->id = window;
cwindow->depth = get_visual_depth(attr->visual);
* cleanup) */
xcb_change_save_set(conn, XCB_SET_MODE_INSERT, window);
+ if (shape_supported) {
+ /* Receive ShapeNotify events whenever the client altered its window
+ * shape. */
+ xcb_shape_select_input(conn, window, true);
+
+ /* Check if the window is shaped. Sadly, we can check only for the
+ * bounding shape, not for the input shape. */
+ xcb_shape_query_extents_cookie_t cookie =
+ xcb_shape_query_extents(conn, window);
+ xcb_shape_query_extents_reply_t *reply =
+ xcb_shape_query_extents_reply(conn, cookie, NULL);
+ if (reply != NULL && reply->bounding_shaped) {
+ cwindow->shaped = true;
+ }
+ FREE(reply);
+ }
+
/* Check if any assignments match */
run_assignments(cwindow);