Compare commits

...

3 Commits

4 changed files with 14 additions and 18 deletions

View File

@ -28,7 +28,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <limits.h>
// TODO
XWindowChanges wm_client_to_xwchanges(Client *c)
XWindowChanges wm_client_to_xwchanges(Client *c)
{
XWindowChanges ch;
@ -207,16 +207,16 @@ void wm_client_focus_dir(Wm *wm, Client *c, int dir)
switch (dir) {
case UP:
wm_client_focus(wm, wm_client_get_dir_rel_c(c, dir));
wm_client_focus(wm, wm_find_client_direction(c, dir));
break;
case DOWN:
wm_client_focus(wm, wm_client_get_dir_rel_c(c, dir));
wm_client_focus(wm, wm_find_client_direction(c, dir));
break;
case LEFT:
wm_client_focus(wm, wm_client_get_dir_rel_c(c, dir));
wm_client_focus(wm, wm_find_client_direction(c, dir));
break;
case RIGHT:
wm_client_focus(wm, wm_client_get_dir_rel_c(c, dir));
wm_client_focus(wm, wm_find_client_direction(c, dir));
break;
default:
fprintf(stderr, "wm: %s invalid direction: %d\n", __func__, dir);
@ -231,7 +231,7 @@ void wm_client_swap_dir(Wm* wm, Client *c, int dir)
TreeNode *client_node = wm_treenode_ptr_find_client_node(c->ws->tree, c);
assert(client_node);
Client *client = wm_client_get_dir_rel_c(c, dir);
Client *client = wm_find_client_direction(c, dir);
if (!client)
return;
@ -335,7 +335,7 @@ Atom wm_client_get_atom(Wm *wm, Client *c, const char *name, unsigned char **ato
return type_ret;
}
Client* wm_client_get_dir_rel_c(Client *c, int dir)
Client* wm_find_client_direction(Client *c, int dir)
{
DEBUG_PRINT("%s c: %p\n", __func__, (void*)c)
@ -394,7 +394,7 @@ Client* wm_client_get_dir_rel_c(Client *c, int dir)
}
}
// TODO: bar
} while((x > 0 && x < c->m->info.width) &&
} while((x > 0 && x < c->m->info.width) &&
(y > 0 && y < c->m->info.height));
ret:

View File

@ -126,7 +126,7 @@ Atom wm_client_get_atom(Wm *wm, Client *c, const char *name, unsigned char **ato
/**
* Finds the client in the direction `dir` relative to `c`.
*/
Client* wm_client_get_dir_rel_c(Client *c, int dir);
Client* wm_find_client_direction(Client *c, int dir);
/**
* Returns the currently focused client.

View File

@ -507,14 +507,6 @@ static void test_wm_logentries_calculate_distances(void **state)
// TODO check node distances
free(entry->workspaces->nodes[2]->children->nodes[0]->client->name);
free(entry->workspaces->nodes[2]->children->nodes[0]->client);
free(entry->workspaces->nodes[2]->children->nodes[1]->client->name);
free(entry->workspaces->nodes[2]->children->nodes[1]->client);
wm_treenode_free(entry->workspaces->nodes[2]->children->nodes[0]);
wm_treenode_free(entry->workspaces->nodes[2]->children->nodes[1]);
wm_logentries_free(entries);
wm_treenode_free(node);
wm_treenode_free(child);

View File

@ -596,7 +596,11 @@ void wm_kb_spawn(Wm *wm, Arg *args)
if (wm->display)
close(ConnectionNumber(wm->display));
setsid();
execvp(args->sl[0], &(args->sl[1]));
int ret = execvp(args->sl[0], &(args->sl[1]));
if (ret == -1) {
fprintf(stderr, "wm: could not run %s: %s\n", args->sl[0], strerror(errno));
}
exit(0);
}