style issues

This commit is contained in:
nicolas3121 2024-04-20 10:45:10 +02:00
parent 06b0e36d2a
commit e059e781f3

View file

@ -695,7 +695,9 @@ directional_target_window(struct view *view, struct server *server, enum view_ed
distance_wrap = INT_MAX; distance_wrap = INT_MAX;
switch (direction) { switch (direction) {
case VIEW_EDGE_LEFT: case VIEW_EDGE_LEFT:
if (dx == 0) continue; if (dx == 0) {
continue;
}
if (dx > 0) { if (dx > 0) {
distance = INT_MAX; distance = INT_MAX;
dx = usable.width - dx; dx = usable.width - dx;
@ -703,7 +705,9 @@ directional_target_window(struct view *view, struct server *server, enum view_ed
} }
break; break;
case VIEW_EDGE_RIGHT: case VIEW_EDGE_RIGHT:
if (dx == 0) continue; if (dx == 0) {
continue;
}
if (dx < 0) { if (dx < 0) {
distance = INT_MAX; distance = INT_MAX;
dx = usable.width + dx; dx = usable.width + dx;
@ -711,7 +715,9 @@ directional_target_window(struct view *view, struct server *server, enum view_ed
} }
break; break;
case VIEW_EDGE_UP: case VIEW_EDGE_UP:
if (dy == 0) continue; if (dy == 0) {
continue;
}
if (dy > 0) { if (dy > 0) {
distance = INT_MAX; distance = INT_MAX;
dy = usable.height - dy; dy = usable.height - dy;
@ -719,7 +725,9 @@ directional_target_window(struct view *view, struct server *server, enum view_ed
} }
break; break;
case VIEW_EDGE_DOWN: case VIEW_EDGE_DOWN:
if (dy == 0) continue; if (dy == 0) {
continue;
}
if (dy < 0) { if (dy < 0) {
distance = INT_MAX; distance = INT_MAX;
dy = usable.height + dy; dy = usable.height + dy;
@ -836,9 +844,10 @@ actions_run(struct view *activator, struct server *server,
case ACTION_TYPE_DIRECTIONAL_TARGET_WINDOW: case ACTION_TYPE_DIRECTIONAL_TARGET_WINDOW:
if (view) { if (view) {
enum view_edge direction = action_get_int(action, "direction", 0); enum view_edge direction = action_get_int(action, "direction", 0);
struct view* closest_view = directional_target_window(view, server, direction, true); struct view *closest_view = directional_target_window(view, server, direction,
/*wrap*/ true);
if (closest_view) { if (closest_view) {
desktop_focus_view(closest_view, true); desktop_focus_view(closest_view, /*raise*/ true);
} }
} }
break; break;