Compare commits

...

2 Commits

2 changed files with 6 additions and 3 deletions

View File

@ -168,9 +168,9 @@ void wm_client_focus(Wm *wm, Client *c)
Client *old_focused_client = wm->focused_client;
if (!old_focused_client)
old_focused_client = wm_client_get_focused(wm);
assert(old_focused_client);
old_focused_client->focused = false;
if (old_focused_client)
old_focused_client->focused = false;
XSetInputFocus(wm->display, c->window, RevertToPointerRoot, CurrentTime);
wm_client_set_atom(wm, c, "_NET_ACTIVE_WINDOW", (unsigned char*) &c->window,
@ -376,7 +376,9 @@ Client* wm_client_get_focused(Wm *wm)
Workspace *ws = &wm->smon->workspaces[wm->smon->selws];
TreeNode *node = wm_treenode_ptr_find_focused_client_node(&ws->tree);
assert(node);
if (!node)
return NULL;
return node->client;
}

View File

@ -16,6 +16,7 @@ TreeNode wm_treenode_new(NodeType type, TreeNode *parent)
node_id++;
node.id = node_id;
node.client = NULL;
return node;
}