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 15:56:19 +01:00
parent f399c3ef9d
commit 3d13d53ae7
4 changed files with 25 additions and 23 deletions

View File

@ -465,7 +465,8 @@ Client *get_matching_client(xcb_connection_t *conn, const char *window_classtitl
Client *client;
SLIST_FOREACH(client, &(ws->focus_stack), focus_clients) {
LOG("Checking client with class=%s, name=%s\n", client->window_class, client->name);
LOG("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;