From: Michael Stapelberg Date: Sat, 17 Apr 2010 12:21:34 +0000 (+0200) Subject: put container in fullscreen mode if the fullscreen state is set when mapping X-Git-Tag: tree-pr1~242 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=53dcebfd8a900fe4c317985c0160003a8c9e13fc;p=i3%2Fi3 put container in fullscreen mode if the fullscreen state is set when mapping --- diff --git a/src/manage.c b/src/manage.c index 49f10599..ce11a2c1 100644 --- a/src/manage.c +++ b/src/manage.c @@ -167,6 +167,19 @@ void manage_window(xcb_window_t window, xcb_get_window_attributes_cookie_t cooki //xcb_destroy_window(conn, nc->frame); } + xcb_atom_t *state; + xcb_get_property_reply_t *preply; + if ((preply = xcb_get_property_reply(conn, state_cookie, NULL)) != NULL && + (state = xcb_get_property_value(preply)) != NULL) { + /* Check all set _NET_WM_STATEs */ + for (int i = 0; i < xcb_get_property_value_length(preply); i++) { + if (state[i] != atoms[_NET_WM_STATE_FULLSCREEN]) + continue; + con_toggle_fullscreen(nc); + break; + } + } + xcb_change_save_set(conn, XCB_SET_MODE_INSERT, window); tree_render();