Bugfix: Use both parts of WM_CLASS (it contains instance and class) (Thanks fallen)

Actually, WM_CLASS contains two null-terminated strings, so we cannot
use asprintf() to get its value but rather use strdup() to get both
of them. Both values are compared when a client is matched against
a wm_class/title combination (for assignments for example).
This commit is contained in:
Michael Stapelberg
2010-02-12 12:12:25 +01:00
parent 9568836e12
commit 0b6b8e8380
4 changed files with 25 additions and 23 deletions

View File

@ -448,7 +448,8 @@ Client *get_matching_client(xcb_connection_t *conn, const char *window_classtitl
Client *client;
SLIST_FOREACH(client, &(ws->focus_stack), focus_clients) {
DLOG("Checking client with class=%s, name=%s\n", client->window_class, client->name);
DLOG("Checking client with class=%s / %s, name=%s\n", client->window_class_instance,
client->window_class_class, client->name);
if (!client_matches_class_name(client, to_class, to_title, to_title_ucs, to_title_ucs_len))
continue;