rename wm_client_get_dir_rel_c to wm_find_client_direction

This commit is contained in:
Akos Horvath 2024-04-06 17:58:40 +02:00
parent a1c5adece5
commit 8d32587144
2 changed files with 9 additions and 9 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.