#define FRAME_EVENT_MASK (XCB_EVENT_MASK_BUTTON_PRESS | /* …mouse is pressed/released */ \
XCB_EVENT_MASK_BUTTON_RELEASE | \
XCB_EVENT_MASK_EXPOSURE | /* …our window needs to be redrawn */ \
- XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT | /* …user moves cursor inside our window */ \
- XCB_EVENT_MASK_ENTER_WINDOW) /* …the application tries to resize itself */
+ XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT | /* …the application tries to resize itself */ \
+ XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY | /* …subwindows get notifies */ \
+ XCB_EVENT_MASK_ENTER_WINDOW) /* …user moves cursor inside our window */
enum { _NET_SUPPORTED = 0,
_NET_WM_STRUT_PARTIAL,
WM_PROTOCOLS,
WM_DELETE_WINDOW,
- UTF8_STRING
+ UTF8_STRING,
+ WM_STATE
};
extern unsigned int xcb_numlock_mask;
/* Yo dawg, I heard you like windows, so I create a window around your window… */
new->frame = create_window(conn, framerect, XCB_WINDOW_CLASS_INPUT_OUTPUT, XCB_CURSOR_LEFT_PTR, mask, values);
+ long data[] = { XCB_WM_STATE_NORMAL, XCB_NONE };
+ xcb_change_property(conn, XCB_PROP_MODE_REPLACE, new->child, atoms[WM_STATE], atoms[WM_STATE], 32, 2, data);
+
/* Put the client inside the save set. Upon termination (whether killed or normal exit
does not matter) of the window manager, these clients will be correctly reparented
to their most closest living ancestor (= cleanup) */
REQUEST_ATOM(WM_PROTOCOLS);
REQUEST_ATOM(WM_DELETE_WINDOW);
REQUEST_ATOM(UTF8_STRING);
+ REQUEST_ATOM(WM_STATE);
/* TODO: this has to be more beautiful somewhen */
int major, minor, error;
GET_ATOM(WM_PROTOCOLS);
GET_ATOM(WM_DELETE_WINDOW);
GET_ATOM(UTF8_STRING);
+ GET_ATOM(WM_STATE);
xcb_property_set_handler(&prophs, atoms[_NET_WM_WINDOW_TYPE], UINT_MAX, handle_window_type, NULL);
/* TODO: In order to comply with EWMH, we have to watch _NET_WM_STRUT_PARTIAL */
void fake_absolute_configure_notify(xcb_connection_t *conn, Client *client) {
Rect absolute;
- absolute.x = client->rect.x;
- absolute.y = client->rect.y;
+ absolute.x = client->rect.x + client->child_rect.x;
+ absolute.y = client->rect.y + client->child_rect.y;
absolute.width = client->rect.width - (2 * client->child_rect.x);
absolute.height = client->rect.height - client->child_rect.y - 1;