Merge branch 'fix_window_type_fallback' of https://github.com/psychon/awesome

This commit is contained in:
Uli Schlachter 2016-05-15 16:39:33 +02:00
commit 959913dcd2
3 changed files with 7 additions and 2 deletions

4
ewmh.c
View File

@ -574,6 +574,7 @@ ewmh_client_check_hints(client_t *c)
reply = xcb_get_property_reply(globalconf.connection, c2, NULL);
if(reply && (data = xcb_get_property_value(reply)))
{
c->has_NET_WM_WINDOW_TYPE = true;
state = (xcb_atom_t *) data;
for(int i = 0; i < xcb_get_property_value_length(reply) / ssizeof(xcb_atom_t); i++)
if(state[i] == _NET_WM_WINDOW_TYPE_DESKTOP)
@ -590,7 +591,8 @@ ewmh_client_check_hints(client_t *c)
c->type = MAX(c->type, WINDOW_TYPE_TOOLBAR);
else if(state[i] == _NET_WM_WINDOW_TYPE_UTILITY)
c->type = MAX(c->type, WINDOW_TYPE_UTILITY);
}
} else
c->has_NET_WM_WINDOW_TYPE = false;
p_delete(&reply);
}

View File

@ -97,6 +97,8 @@ struct client_t
* from Lua. */
bool focusable;
bool focusable_set;
/** True if the client window has a _NET_WM_WINDOW_TYPE proeprty */
bool has_NET_WM_WINDOW_TYPE;
/** Window of the group leader */
xcb_window_t group_window;
/** Window holding command needed to start it (session management related) */

View File

@ -114,7 +114,8 @@ property_update_wm_transient_for(client_t *c, xcb_get_property_cookie_t cookie)
c->transient_for_window = trans;
luaA_object_push(L, c);
client_set_type(L, -1, WINDOW_TYPE_DIALOG);
if (!c->has_NET_WM_WINDOW_TYPE)
client_set_type(L, -1, trans == XCB_NONE ? WINDOW_TYPE_NORMAL : WINDOW_TYPE_DIALOG);
client_set_above(L, -1, false);
lua_pop(L, 1);