Compare commits
2 Commits
f98f9e6826
...
f4aa263368
Author | SHA1 | Date | |
---|---|---|---|
f4aa263368 | |||
72663656e4 |
@ -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;
|
||||
}
|
||||
|
@ -16,6 +16,7 @@ TreeNode wm_treenode_new(NodeType type, TreeNode *parent)
|
||||
|
||||
node_id++;
|
||||
node.id = node_id;
|
||||
node.client = NULL;
|
||||
|
||||
return node;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user