update wm_client_get_focused to find focused client in tree structure

This commit is contained in:
Akos Horvath 2023-06-01 15:52:09 +02:00
parent 1298543661
commit 867757734f

View File

@ -20,6 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "client.h"
#include "util.h"
#include "wm.h"
#include <assert.h>
#include <stdio.h>
#include <string.h>
#include <limits.h>
@ -356,14 +357,13 @@ Client* wm_client_get_dir_rel_c(Client *c, int dir)
Client* wm_client_get_focused(Wm *wm)
{
Client *c;
Client *c = NULL;
for (c = wm->smon->clients; c; c = c->next) {
if (wm_client_is_focused(wm, c))
return c;
}
Workspace *ws = &wm->smon->workspaces[wm->smon->selws];
TreeNode *node = wm_treenode_ptr_find_focused_client_node(&ws->tree);
assert(node);
return NULL;
return node->client;
}
void wm_client_border(Wm *wm, Client *c)