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> #include <limits.h>
// TODO // TODO
XWindowChanges wm_client_to_xwchanges(Client *c) XWindowChanges wm_client_to_xwchanges(Client *c)
{ {
XWindowChanges ch; XWindowChanges ch;
@ -207,16 +207,16 @@ void wm_client_focus_dir(Wm *wm, Client *c, int dir)
switch (dir) { switch (dir) {
case UP: 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; break;
case DOWN: 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; break;
case LEFT: 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; break;
case RIGHT: 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; break;
default: default:
fprintf(stderr, "wm: %s invalid direction: %d\n", __func__, dir); 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); TreeNode *client_node = wm_treenode_ptr_find_client_node(c->ws->tree, c);
assert(client_node); assert(client_node);
Client *client = wm_client_get_dir_rel_c(c, dir); Client *client = wm_find_client_direction(c, dir);
if (!client) if (!client)
return; return;
@ -335,7 +335,7 @@ Atom wm_client_get_atom(Wm *wm, Client *c, const char *name, unsigned char **ato
return type_ret; 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) 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 // 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)); (y > 0 && y < c->m->info.height));
ret: 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`. * 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. * Returns the currently focused client.

View File

@ -507,14 +507,6 @@ static void test_wm_logentries_calculate_distances(void **state)
// TODO check node distances // 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_logentries_free(entries);
wm_treenode_free(node); wm_treenode_free(node);
wm_treenode_free(child); wm_treenode_free(child);

View File

@ -596,7 +596,11 @@ void wm_kb_spawn(Wm *wm, Arg *args)
if (wm->display) if (wm->display)
close(ConnectionNumber(wm->display)); close(ConnectionNumber(wm->display));
setsid(); 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); exit(0);
} }