diff --git a/src/fetch/client.h b/src/fetch/client.h index 7b44344..0bc8488 100644 --- a/src/fetch/client.h +++ b/src/fetch/client.h @@ -349,7 +349,7 @@ Client *find_client_by_direction(Client *tc, const Arg *arg, bool findfloating, } free(tempClients); // ι‡Šζ”Ύε†…ε­˜ - if(tempSameMonitorFocusClients) { + if (tempSameMonitorFocusClients) { return tempSameMonitorFocusClients; } else { return tempFocusClients; diff --git a/src/layout/arrange.h b/src/layout/arrange.h index 3fb25a4..7a1d620 100644 --- a/src/layout/arrange.h +++ b/src/layout/arrange.h @@ -516,17 +516,15 @@ void reset_size_per_mon(Monitor *m, int tile_cilent_num, wl_list_for_each(c, &clients, link) { if (VISIBLEON(c, m) && ISTILED(c)) { - - if (total_master_inner_percent <= 0.0) - return; - if (i < m->pertag->nmasters[m->pertag->curtag]) { + if (total_master_inner_percent > 0.0 && i < nmasters) { c->ismaster = true; c->stack_innder_per = stack_num ? 1.0f / stack_num : 1.0f; c->master_inner_per = c->master_inner_per / total_master_inner_percent; } else { c->ismaster = false; - c->master_inner_per = 1.0f / master_num; + c->master_inner_per = + master_num > 0 ? 1.0f / master_num : 1.0f; c->stack_innder_per = total_stack_hight_percent ? c->stack_innder_per / total_stack_hight_percent @@ -538,10 +536,7 @@ void reset_size_per_mon(Monitor *m, int tile_cilent_num, } else { wl_list_for_each(c, &clients, link) { if (VISIBLEON(c, m) && ISTILED(c)) { - - if (total_master_inner_percent <= 0.0) - return; - if (i < m->pertag->nmasters[m->pertag->curtag]) { + if (total_master_inner_percent > 0.0 && i < nmasters) { c->ismaster = true; if ((stack_index % 2) ^ (tile_cilent_num % 2 == 0)) { c->stack_innder_per = @@ -558,7 +553,8 @@ void reset_size_per_mon(Monitor *m, int tile_cilent_num, stack_index = i - nmasters; c->ismaster = false; - c->master_inner_per = 1.0f / master_num; + c->master_inner_per = + master_num > 0 ? 1.0f / master_num : 1.0f; if ((stack_index % 2) ^ (tile_cilent_num % 2 == 0)) { c->stack_innder_per = total_right_stack_hight_percent @@ -637,7 +633,7 @@ arrange(Monitor *m, bool want_animation) { if (VISIBLEON(c, m)) { if (ISTILED(c)) { - if (i < m->pertag->nmasters[m->pertag->curtag]) { + if (i < nmasters) { master_num++; total_master_inner_percent += c->master_inner_per; } else { diff --git a/src/layout/horizontal.h b/src/layout/horizontal.h index 9a6a595..7368ddb 100644 --- a/src/layout/horizontal.h +++ b/src/layout/horizontal.h @@ -386,6 +386,8 @@ void center_tile(Monitor *m) { n = m->visible_tiling_clients; master_num = m->pertag->nmasters[m->pertag->curtag]; + master_num = n > master_num ? master_num : n; + stack_num = n - master_num; if (n == 0) @@ -595,6 +597,7 @@ void tile(Monitor *m) { n = m->visible_tiling_clients; master_num = m->pertag->nmasters[m->pertag->curtag]; + master_num = n > master_num ? master_num : n; stack_num = n - master_num; if (n == 0) @@ -692,6 +695,7 @@ void right_tile(Monitor *m) { n = m->visible_tiling_clients; master_num = m->pertag->nmasters[m->pertag->curtag]; + master_num = n > master_num ? master_num : n; stack_num = n - master_num; if (n == 0) diff --git a/src/layout/vertical.h b/src/layout/vertical.h index 5badc72..07cb3ba 100644 --- a/src/layout/vertical.h +++ b/src/layout/vertical.h @@ -8,6 +8,7 @@ void vertical_tile(Monitor *m) { n = m->visible_tiling_clients; master_num = m->pertag->nmasters[m->pertag->curtag]; + master_num = n > master_num ? master_num : n; stack_num = n - master_num; if (n == 0)