Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file modified format.sh
100644 → 100755
Empty file.
4 changes: 3 additions & 1 deletion src/animation/client.h
Original file line number Diff line number Diff line change
Expand Up @@ -1299,7 +1299,9 @@ void resize(Client *c, struct wlr_box geo, int32_t interact) {
// float_geom = c->geom;
bbox = (interact || c->isfloating || c->isfullscreen) ? &sgeom : &c->mon->w;

if (is_scroller_layout(c->mon) && (!c->isfloating || c == grabc)) {
if (is_scroller_layout(c->mon) ||
c->mon->pertag->ltidxs[c->mon->pertag->curtag]->id == INFINITE ||
c->mon->pertag->ltidxs[c->mon->pertag->curtag]->id == FREE_INFINITE) {
c->geom = geo;
c->geom.width = MANGO_MAX(1 + 2 * (int32_t)c->bw, c->geom.width);
c->geom.height = MANGO_MAX(1 + 2 * (int32_t)c->bw, c->geom.height);
Expand Down
17 changes: 17 additions & 0 deletions src/config/parse_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ typedef struct {
int32_t scroller_focus_center;
int32_t scroller_prefer_center;
int32_t scroller_prefer_overspread;
float new_window_scale;
int32_t edge_scroller_pointer_focus;
double edge_scroller_focus_allow_speed;
int32_t focus_cross_monitor;
Expand Down Expand Up @@ -1288,6 +1289,18 @@ FuncType parse_func_name(char *func_name, Arg *arg, char *arg_value,
func = dwindle_split_horizontal;
} else if (strcmp(func_name, "dwindle_split_vertical") == 0) {
func = dwindle_split_vertical;
} else if (strcmp(func_name, "scroll_left") == 0) {
func = scroll_left;
} else if (strcmp(func_name, "scroll_right") == 0) {
func = scroll_right;
} else if (strcmp(func_name, "scroll_up") == 0) {
func = scroll_up;
} else if (strcmp(func_name, "scroll_down") == 0) {
func = scroll_down;
} else if (strcmp(func_name, "home_canvas_wrapper") == 0) {
func = home_canvas_wrapper;
} else if (strcmp(func_name, "center_focused_wrapper") == 0) {
func = center_focused_wrapper;
} else {
return NULL;
}
Expand Down Expand Up @@ -1436,6 +1449,8 @@ bool parse_option(Config *config, char *key, char *value) {
}
} else if (strcmp(key, "scroller_structs") == 0) {
config->scroller_structs = atoi(value);
} else if (strcmp(key, "new_window_scale") == 0) {
config->new_window_scale = atof(value);
} else if (strcmp(key, "scroller_default_proportion") == 0) {
config->scroller_default_proportion = atof(value);
} else if (strcmp(key, "scroller_default_proportion_single") == 0) {
Expand Down Expand Up @@ -3449,6 +3464,7 @@ void override_config(void) {
CLAMP_FLOAT(config.scroller_default_proportion, 0.1f, 1.0f);
config.scroller_default_proportion_single =
CLAMP_FLOAT(config.scroller_default_proportion_single, 0.1f, 1.0f);
config.new_window_scale = CLAMP_FLOAT(config.new_window_scale, 0.1f, 5.0f);
config.scroller_ignore_proportion_single =
CLAMP_INT(config.scroller_ignore_proportion_single, 0, 1);
config.scroller_focus_center =
Expand Down Expand Up @@ -3666,6 +3682,7 @@ void set_value_default() {
config.scratchpad_height_ratio = 0.9f;

config.scroller_structs = 20;
config.new_window_scale = 1.0f;
config.scroller_default_proportion = 0.9f;
config.scroller_default_proportion_single = 1.0f;
config.scroller_ignore_proportion_single = 1;
Expand Down
51 changes: 32 additions & 19 deletions src/fetch/client.h
Original file line number Diff line number Diff line change
Expand Up @@ -324,31 +324,44 @@ Client *get_next_stack_client(Client *c, bool reverse) {
if (!c || !c->mon)
return NULL;

Client *next = NULL;
if (reverse) {
wl_list_for_each_reverse(next, &c->link, link) {
if (&next->link == &clients)
continue; /* wrap past the sentinel node */
float cx = c->geom.x + c->geom.width / 2.0f;
float cy = c->geom.y + c->geom.height / 2.0f;

if (next->isunglobal)
continue;
Client *best_fwd = NULL, *best_wrap = NULL;
float best_fwd_val = reverse ? -1e30f : 1e30f;
float best_wrap_val = reverse ? -1e30f : 1e30f;

if (next != c && next->mon && VISIBLEON(next, c->mon))
return next;
}
} else {
wl_list_for_each(next, &c->link, link) {
if (&next->link == &clients)
continue; /* wrap past the sentinel node */
Client *next;
wl_list_for_each(next, &clients, link) {
if (&next->link == &clients || next == c || next->isunglobal ||
!next->mon || !VISIBLEON(next, c->mon))
continue;

if (next->isunglobal)
continue;
float tx = next->geom.x + next->geom.width / 2.0f;
float ty = next->geom.y + next->geom.height / 2.0f;
float angle = atan2f(ty - cy, tx - cx);

if (next != c && next->mon && VISIBLEON(next, c->mon))
return next;
if (reverse) {
if (angle < 0 && angle > best_fwd_val) {
best_fwd_val = angle;
best_fwd = next;
}
if (angle >= 0 && angle > best_wrap_val) {
best_wrap_val = angle;
best_wrap = next;
}
} else {
if (angle > 0 && angle < best_fwd_val) {
best_fwd_val = angle;
best_fwd = next;
}
if (angle < 0 && angle < best_wrap_val) {
best_wrap_val = angle;
best_wrap = next;
}
}
}
return NULL;
return best_fwd ? best_fwd : best_wrap;
}

float *get_border_color(Client *c) {
Expand Down
Loading