feat: support scroll maximize and fullscreen window
Some checks failed
Close manually marked stale issues / close-issues (push) Has been cancelled
Lock Threads / lock (push) Has been cancelled

This commit is contained in:
DreamMaoMao
2025-11-15 00:08:57 +08:00
parent b3578344dc
commit 8ab59c1aca
5 changed files with 195 additions and 82 deletions

View File

@@ -142,7 +142,7 @@ Client *center_tiled_select(Monitor *m) {
return target_c; return target_c;
} }
Client *find_client_by_direction(Client *tc, const Arg *arg, bool findfloating, Client *find_client_by_direction(Client *tc, const Arg *arg, bool findfloating,
bool align) { bool ignore_align) {
Client *c = NULL; Client *c = NULL;
Client **tempClients = NULL; // 初始化为 NULL Client **tempClients = NULL; // 初始化为 NULL
int last = -1; int last = -1;
@@ -185,21 +185,23 @@ Client *find_client_by_direction(Client *tc, const Arg *arg, bool findfloating,
switch (arg->i) { switch (arg->i) {
case UP: case UP:
for (int _i = 0; _i <= last; _i++) { if (!ignore_align) {
if (tempClients[_i]->geom.y < sel_y && for (int _i = 0; _i <= last; _i++) {
tempClients[_i]->geom.x == sel_x && if (tempClients[_i]->geom.y < sel_y &&
tempClients[_i]->mon == tc->mon) { tempClients[_i]->geom.x == sel_x &&
int dis_x = tempClients[_i]->geom.x - sel_x; tempClients[_i]->mon == tc->mon) {
int dis_y = tempClients[_i]->geom.y - sel_y; int dis_x = tempClients[_i]->geom.x - sel_x;
long long int tmp_distance = int dis_y = tempClients[_i]->geom.y - sel_y;
dis_x * dis_x + dis_y * dis_y; // 计算距离 long long int tmp_distance =
if (tmp_distance < distance) { dis_x * dis_x + dis_y * dis_y; // 计算距离
distance = tmp_distance; if (tmp_distance < distance) {
tempFocusClients = tempClients[_i]; distance = tmp_distance;
tempFocusClients = tempClients[_i];
}
} }
} }
} }
if (!tempFocusClients && !align) { if (!tempFocusClients) {
for (int _i = 0; _i <= last; _i++) { for (int _i = 0; _i <= last; _i++) {
if (tempClients[_i]->geom.y < sel_y) { if (tempClients[_i]->geom.y < sel_y) {
int dis_x = tempClients[_i]->geom.x - sel_x; int dis_x = tempClients[_i]->geom.x - sel_x;
@@ -215,21 +217,23 @@ Client *find_client_by_direction(Client *tc, const Arg *arg, bool findfloating,
} }
break; break;
case DOWN: case DOWN:
for (int _i = 0; _i <= last; _i++) { if (!ignore_align) {
if (tempClients[_i]->geom.y > sel_y && for (int _i = 0; _i <= last; _i++) {
tempClients[_i]->geom.x == sel_x && if (tempClients[_i]->geom.y > sel_y &&
tempClients[_i]->mon == tc->mon) { tempClients[_i]->geom.x == sel_x &&
int dis_x = tempClients[_i]->geom.x - sel_x; tempClients[_i]->mon == tc->mon) {
int dis_y = tempClients[_i]->geom.y - sel_y; int dis_x = tempClients[_i]->geom.x - sel_x;
long long int tmp_distance = int dis_y = tempClients[_i]->geom.y - sel_y;
dis_x * dis_x + dis_y * dis_y; // 计算距离 long long int tmp_distance =
if (tmp_distance < distance) { dis_x * dis_x + dis_y * dis_y; // 计算距离
distance = tmp_distance; if (tmp_distance < distance) {
tempFocusClients = tempClients[_i]; distance = tmp_distance;
tempFocusClients = tempClients[_i];
}
} }
} }
} }
if (!tempFocusClients && !align) { if (!tempFocusClients) {
for (int _i = 0; _i <= last; _i++) { for (int _i = 0; _i <= last; _i++) {
if (tempClients[_i]->geom.y > sel_y) { if (tempClients[_i]->geom.y > sel_y) {
int dis_x = tempClients[_i]->geom.x - sel_x; int dis_x = tempClients[_i]->geom.x - sel_x;
@@ -245,21 +249,23 @@ Client *find_client_by_direction(Client *tc, const Arg *arg, bool findfloating,
} }
break; break;
case LEFT: case LEFT:
for (int _i = 0; _i <= last; _i++) { if (!ignore_align) {
if (tempClients[_i]->geom.x < sel_x && for (int _i = 0; _i <= last; _i++) {
tempClients[_i]->geom.y == sel_y && if (tempClients[_i]->geom.x < sel_x &&
tempClients[_i]->mon == tc->mon) { tempClients[_i]->geom.y == sel_y &&
int dis_x = tempClients[_i]->geom.x - sel_x; tempClients[_i]->mon == tc->mon) {
int dis_y = tempClients[_i]->geom.y - sel_y; int dis_x = tempClients[_i]->geom.x - sel_x;
long long int tmp_distance = int dis_y = tempClients[_i]->geom.y - sel_y;
dis_x * dis_x + dis_y * dis_y; // 计算距离 long long int tmp_distance =
if (tmp_distance < distance) { dis_x * dis_x + dis_y * dis_y; // 计算距离
distance = tmp_distance; if (tmp_distance < distance) {
tempFocusClients = tempClients[_i]; distance = tmp_distance;
tempFocusClients = tempClients[_i];
}
} }
} }
} }
if (!tempFocusClients && !align) { if (!tempFocusClients) {
for (int _i = 0; _i <= last; _i++) { for (int _i = 0; _i <= last; _i++) {
if (tempClients[_i]->geom.x < sel_x) { if (tempClients[_i]->geom.x < sel_x) {
int dis_x = tempClients[_i]->geom.x - sel_x; int dis_x = tempClients[_i]->geom.x - sel_x;
@@ -275,21 +281,23 @@ Client *find_client_by_direction(Client *tc, const Arg *arg, bool findfloating,
} }
break; break;
case RIGHT: case RIGHT:
for (int _i = 0; _i <= last; _i++) { if (!ignore_align) {
if (tempClients[_i]->geom.x > sel_x && for (int _i = 0; _i <= last; _i++) {
tempClients[_i]->geom.y == sel_y && if (tempClients[_i]->geom.x > sel_x &&
tempClients[_i]->mon == tc->mon) { tempClients[_i]->geom.y == sel_y &&
int dis_x = tempClients[_i]->geom.x - sel_x; tempClients[_i]->mon == tc->mon) {
int dis_y = tempClients[_i]->geom.y - sel_y; int dis_x = tempClients[_i]->geom.x - sel_x;
long long int tmp_distance = int dis_y = tempClients[_i]->geom.y - sel_y;
dis_x * dis_x + dis_y * dis_y; // 计算距离 long long int tmp_distance =
if (tmp_distance < distance) { dis_x * dis_x + dis_y * dis_y; // 计算距离
distance = tmp_distance; if (tmp_distance < distance) {
tempFocusClients = tempClients[_i]; distance = tmp_distance;
tempFocusClients = tempClients[_i];
}
} }
} }
} }
if (!tempFocusClients && !align) { if (!tempFocusClients) {
for (int _i = 0; _i <= last; _i++) { for (int _i = 0; _i <= last; _i++) {
if (tempClients[_i]->geom.x > sel_x) { if (tempClients[_i]->geom.x > sel_x) {
int dis_x = tempClients[_i]->geom.x - sel_x; int dis_x = tempClients[_i]->geom.x - sel_x;
@@ -317,12 +325,12 @@ Client *direction_select(const Arg *arg) {
if (!tc) if (!tc)
return NULL; return NULL;
if (tc && (tc->isfullscreen || tc->ismaximizescreen)) { if (tc && (tc->isfullscreen || tc->ismaximizescreen) &&
// 不支持全屏窗口的焦点切换 !is_scroller_layout(selmon)) {
return NULL; return NULL;
} }
return find_client_by_direction(tc, arg, true, false); return find_client_by_direction(tc, arg, true, is_scroller_layout(selmon));
} }
/* We probably should change the name of this, it sounds like /* We probably should change the name of this, it sounds like

View File

@@ -599,6 +599,7 @@ arrange(Monitor *m, bool want_animation) {
return; return;
m->visible_clients = 0; m->visible_clients = 0;
m->visible_tiling_clients = 0; m->visible_tiling_clients = 0;
m->visible_scroll_tiling_clients = 0;
m->has_visible_fullscreen_client = false; m->has_visible_fullscreen_client = false;
wl_list_for_each(c, &clients, link) { wl_list_for_each(c, &clients, link) {
@@ -619,6 +620,10 @@ arrange(Monitor *m, bool want_animation) {
if (ISTILED(c)) { if (ISTILED(c)) {
m->visible_tiling_clients++; m->visible_tiling_clients++;
} }
if (ISSCROLLTILED(c)) {
m->visible_scroll_tiling_clients++;
}
} }
} }

View File

@@ -189,6 +189,38 @@ void deck(Monitor *m) {
} }
} }
void horizontal_scroll_adjust_fullandmax(Client *c,
struct wlr_box *target_geom) {
Monitor *m = c->mon;
unsigned int cur_gappih = enablegaps ? m->gappih : 0;
unsigned int cur_gappoh = enablegaps ? m->gappoh : 0;
unsigned int cur_gappov = enablegaps ? m->gappov : 0;
cur_gappih =
smartgaps && m->visible_scroll_tiling_clients == 1 ? 0 : cur_gappih;
cur_gappoh =
smartgaps && m->visible_scroll_tiling_clients == 1 ? 0 : cur_gappoh;
cur_gappov =
smartgaps && m->visible_scroll_tiling_clients == 1 ? 0 : cur_gappov;
if (c->isfullscreen) {
target_geom->height = m->m.height;
target_geom->width = m->m.width;
target_geom->y = m->m.y;
return;
}
if (c->ismaximizescreen) {
target_geom->height = m->w.height - 2 * cur_gappov;
target_geom->width = m->w.width - 2 * cur_gappoh;
target_geom->y = m->w.y + cur_gappov;
return;
}
target_geom->height = m->w.height - 2 * cur_gappov;
target_geom->y = m->w.y + (m->w.height - target_geom->height) / 2;
}
// 滚动布局 // 滚动布局
void scroller(Monitor *m) { void scroller(Monitor *m) {
unsigned int i, n, j; unsigned int i, n, j;
@@ -203,14 +235,17 @@ void scroller(Monitor *m) {
unsigned int cur_gappoh = enablegaps ? m->gappoh : 0; unsigned int cur_gappoh = enablegaps ? m->gappoh : 0;
unsigned int cur_gappov = enablegaps ? m->gappov : 0; unsigned int cur_gappov = enablegaps ? m->gappov : 0;
cur_gappih = smartgaps && m->visible_tiling_clients == 1 ? 0 : cur_gappih; cur_gappih =
cur_gappoh = smartgaps && m->visible_tiling_clients == 1 ? 0 : cur_gappoh; smartgaps && m->visible_scroll_tiling_clients == 1 ? 0 : cur_gappih;
cur_gappov = smartgaps && m->visible_tiling_clients == 1 ? 0 : cur_gappov; cur_gappoh =
smartgaps && m->visible_scroll_tiling_clients == 1 ? 0 : cur_gappoh;
cur_gappov =
smartgaps && m->visible_scroll_tiling_clients == 1 ? 0 : cur_gappov;
unsigned int max_client_width = unsigned int max_client_width =
m->w.width - 2 * scroller_structs - cur_gappih; m->w.width - 2 * scroller_structs - cur_gappih;
n = m->visible_tiling_clients; n = m->visible_scroll_tiling_clients;
if (n == 0) { if (n == 0) {
return; // 没有需要处理的客户端,直接返回 return; // 没有需要处理的客户端,直接返回
@@ -226,13 +261,14 @@ void scroller(Monitor *m) {
// 第二次遍历,填充 tempClients // 第二次遍历,填充 tempClients
j = 0; j = 0;
wl_list_for_each(c, &clients, link) { wl_list_for_each(c, &clients, link) {
if (VISIBLEON(c, m) && ISTILED(c)) { if (VISIBLEON(c, m) && ISSCROLLTILED(c)) {
tempClients[j] = c; tempClients[j] = c;
j++; j++;
} }
} }
if (n == 1 && !scroller_ignore_proportion_single) { if (n == 1 && !scroller_ignore_proportion_single &&
!tempClients[0]->isfullscreen && !tempClients[0]->ismaximizescreen) {
c = tempClients[0]; c = tempClients[0];
single_proportion = c->scroller_proportion_single > 0.0f single_proportion = c->scroller_proportion_single > 0.0f
@@ -248,11 +284,10 @@ void scroller(Monitor *m) {
return; return;
} }
if (m->sel && !client_is_unmanaged(m->sel) && !m->sel->isfloating && if (m->sel && !client_is_unmanaged(m->sel) && !m->sel->isfloating) {
!m->sel->ismaximizescreen && !m->sel->isfullscreen) {
root_client = m->sel; root_client = m->sel;
} else if (m->prevsel && ISTILED(m->prevsel) && VISIBLEON(m->prevsel, m) && } else if (m->prevsel && ISSCROLLTILED(m->prevsel) &&
!client_is_unmanaged(m->prevsel)) { VISIBLEON(m->prevsel, m) && !client_is_unmanaged(m->prevsel)) {
root_client = m->prevsel; root_client = m->prevsel;
} else { } else {
root_client = center_tiled_select(m); root_client = center_tiled_select(m);
@@ -289,11 +324,18 @@ void scroller(Monitor *m) {
target_geom.height = m->w.height - 2 * cur_gappov; target_geom.height = m->w.height - 2 * cur_gappov;
target_geom.width = max_client_width * c->scroller_proportion; target_geom.width = max_client_width * c->scroller_proportion;
target_geom.y = m->w.y + (m->w.height - target_geom.height) / 2; target_geom.y = m->w.y + (m->w.height - target_geom.height) / 2;
horizontal_scroll_adjust_fullandmax(tempClients[focus_client_index],
if (need_scroller) { &target_geom);
if (tempClients[focus_client_index]->isfullscreen) {
target_geom.x = m->m.x;
resize(tempClients[focus_client_index], target_geom, 0);
} else if (tempClients[focus_client_index]->ismaximizescreen) {
target_geom.x = m->w.x + cur_gappoh;
resize(tempClients[focus_client_index], target_geom, 0);
} else if (need_scroller) {
if (scroller_focus_center || if (scroller_focus_center ||
((!m->prevsel || ((!m->prevsel ||
(ISTILED(m->prevsel) && (ISSCROLLTILED(m->prevsel) &&
(m->prevsel->scroller_proportion * max_client_width) + (m->prevsel->scroller_proportion * max_client_width) +
(root_client->scroller_proportion * max_client_width) > (root_client->scroller_proportion * max_client_width) >
m->w.width - 2 * scroller_structs - cur_gappih)) && m->w.width - 2 * scroller_structs - cur_gappih)) &&
@@ -316,14 +358,17 @@ void scroller(Monitor *m) {
for (i = 1; i <= focus_client_index; i++) { for (i = 1; i <= focus_client_index; i++) {
c = tempClients[focus_client_index - i]; c = tempClients[focus_client_index - i];
target_geom.width = max_client_width * c->scroller_proportion; target_geom.width = max_client_width * c->scroller_proportion;
horizontal_scroll_adjust_fullandmax(c, &target_geom);
target_geom.x = tempClients[focus_client_index - i + 1]->geom.x - target_geom.x = tempClients[focus_client_index - i + 1]->geom.x -
cur_gappih - target_geom.width; cur_gappih - target_geom.width;
resize(c, target_geom, 0); resize(c, target_geom, 0);
} }
for (i = 1; i < n - focus_client_index; i++) { for (i = 1; i < n - focus_client_index; i++) {
c = tempClients[focus_client_index + i]; c = tempClients[focus_client_index + i];
target_geom.width = max_client_width * c->scroller_proportion; target_geom.width = max_client_width * c->scroller_proportion;
horizontal_scroll_adjust_fullandmax(c, &target_geom);
target_geom.x = tempClients[focus_client_index + i - 1]->geom.x + target_geom.x = tempClients[focus_client_index + i - 1]->geom.x +
cur_gappih + cur_gappih +
tempClients[focus_client_index + i - 1]->geom.width; tempClients[focus_client_index + i - 1]->geom.width;

View File

@@ -155,6 +155,38 @@ void vertical_deck(Monitor *m) {
} }
} }
void vertical_scroll_adjust_fullandmax(Client *c, struct wlr_box *target_geom) {
Monitor *m = c->mon;
unsigned int cur_gappiv = enablegaps ? m->gappiv : 0;
unsigned int cur_gappov = enablegaps ? m->gappov : 0;
unsigned int cur_gappoh = enablegaps ? m->gappoh : 0;
cur_gappiv =
smartgaps && m->visible_scroll_tiling_clients == 1 ? 0 : cur_gappiv;
cur_gappov =
smartgaps && m->visible_scroll_tiling_clients == 1 ? 0 : cur_gappov;
cur_gappoh =
smartgaps && m->visible_scroll_tiling_clients == 1 ? 0 : cur_gappoh;
if (c->isfullscreen) {
target_geom->width = m->m.width;
target_geom->height = m->m.height;
target_geom->x = m->m.x;
return;
}
if (c->ismaximizescreen) {
target_geom->width = m->w.width - 2 * cur_gappoh;
target_geom->height = m->w.height - 2 * cur_gappov;
target_geom->x = m->w.x + cur_gappoh;
return;
}
target_geom->width = m->w.width - 2 * cur_gappoh;
target_geom->x = m->w.x + (m->w.width - target_geom->width) / 2;
}
// 竖屏滚动布局
void vertical_scroller(Monitor *m) { void vertical_scroller(Monitor *m) {
unsigned int i, n, j; unsigned int i, n, j;
float single_proportion = 1.0; float single_proportion = 1.0;
@@ -168,14 +200,17 @@ void vertical_scroller(Monitor *m) {
unsigned int cur_gappov = enablegaps ? m->gappov : 0; unsigned int cur_gappov = enablegaps ? m->gappov : 0;
unsigned int cur_gappoh = enablegaps ? m->gappoh : 0; unsigned int cur_gappoh = enablegaps ? m->gappoh : 0;
cur_gappiv = smartgaps && m->visible_tiling_clients == 1 ? 0 : cur_gappiv; cur_gappiv =
cur_gappov = smartgaps && m->visible_tiling_clients == 1 ? 0 : cur_gappov; smartgaps && m->visible_scroll_tiling_clients == 1 ? 0 : cur_gappiv;
cur_gappoh = smartgaps && m->visible_tiling_clients == 1 ? 0 : cur_gappoh; cur_gappov =
smartgaps && m->visible_scroll_tiling_clients == 1 ? 0 : cur_gappov;
cur_gappoh =
smartgaps && m->visible_scroll_tiling_clients == 1 ? 0 : cur_gappoh;
unsigned int max_client_height = unsigned int max_client_height =
m->w.height - 2 * scroller_structs - cur_gappiv; m->w.height - 2 * scroller_structs - cur_gappiv;
n = m->visible_tiling_clients; n = m->visible_scroll_tiling_clients;
if (n == 0) { if (n == 0) {
return; return;
@@ -188,13 +223,14 @@ void vertical_scroller(Monitor *m) {
j = 0; j = 0;
wl_list_for_each(c, &clients, link) { wl_list_for_each(c, &clients, link) {
if (VISIBLEON(c, m) && ISTILED(c)) { if (VISIBLEON(c, m) && ISSCROLLTILED(c)) {
tempClients[j] = c; tempClients[j] = c;
j++; j++;
} }
} }
if (n == 1 && !scroller_ignore_proportion_single) { if (n == 1 && !scroller_ignore_proportion_single &&
!tempClients[0]->isfullscreen && !tempClients[0]->ismaximizescreen) {
c = tempClients[0]; c = tempClients[0];
single_proportion = c->scroller_proportion_single > 0.0f single_proportion = c->scroller_proportion_single > 0.0f
@@ -203,18 +239,17 @@ void vertical_scroller(Monitor *m) {
target_geom.width = m->w.width - 2 * cur_gappoh; target_geom.width = m->w.width - 2 * cur_gappoh;
target_geom.height = (m->w.height - 2 * cur_gappov) * single_proportion; target_geom.height = (m->w.height - 2 * cur_gappov) * single_proportion;
target_geom.x = m->w.x + (m->w.width - target_geom.width) / 2;
target_geom.y = m->w.y + (m->w.height - target_geom.height) / 2; target_geom.y = m->w.y + (m->w.height - target_geom.height) / 2;
target_geom.x = m->w.x + (m->w.width - target_geom.width) / 2;
resize(c, target_geom, 0); resize(c, target_geom, 0);
free(tempClients); free(tempClients);
return; return;
} }
if (m->sel && !client_is_unmanaged(m->sel) && !m->sel->isfloating && if (m->sel && !client_is_unmanaged(m->sel) && !m->sel->isfloating) {
!m->sel->ismaximizescreen && !m->sel->isfullscreen) {
root_client = m->sel; root_client = m->sel;
} else if (m->prevsel && ISTILED(m->prevsel) && VISIBLEON(m->prevsel, m) && } else if (m->prevsel && ISSCROLLTILED(m->prevsel) &&
!client_is_unmanaged(m->prevsel)) { VISIBLEON(m->prevsel, m) && !client_is_unmanaged(m->prevsel)) {
root_client = m->prevsel; root_client = m->prevsel;
} else { } else {
root_client = center_tiled_select(m); root_client = center_tiled_select(m);
@@ -251,11 +286,19 @@ void vertical_scroller(Monitor *m) {
target_geom.width = m->w.width - 2 * cur_gappoh; target_geom.width = m->w.width - 2 * cur_gappoh;
target_geom.height = max_client_height * c->scroller_proportion; target_geom.height = max_client_height * c->scroller_proportion;
target_geom.x = m->w.x + (m->w.width - target_geom.width) / 2; target_geom.x = m->w.x + (m->w.width - target_geom.width) / 2;
vertical_scroll_adjust_fullandmax(tempClients[focus_client_index],
&target_geom);
if (need_scroller) { if (tempClients[focus_client_index]->isfullscreen) {
target_geom.y = m->m.y;
resize(tempClients[focus_client_index], target_geom, 0);
} else if (tempClients[focus_client_index]->ismaximizescreen) {
target_geom.y = m->w.y + cur_gappov;
resize(tempClients[focus_client_index], target_geom, 0);
} else if (need_scroller) {
if (scroller_focus_center || if (scroller_focus_center ||
((!m->prevsel || ((!m->prevsel ||
(ISTILED(m->prevsel) && (ISSCROLLTILED(m->prevsel) &&
(m->prevsel->scroller_proportion * max_client_height) + (m->prevsel->scroller_proportion * max_client_height) +
(root_client->scroller_proportion * max_client_height) > (root_client->scroller_proportion * max_client_height) >
m->w.height - 2 * scroller_structs - cur_gappiv)) && m->w.height - 2 * scroller_structs - cur_gappiv)) &&
@@ -278,14 +321,17 @@ void vertical_scroller(Monitor *m) {
for (i = 1; i <= focus_client_index; i++) { for (i = 1; i <= focus_client_index; i++) {
c = tempClients[focus_client_index - i]; c = tempClients[focus_client_index - i];
target_geom.height = max_client_height * c->scroller_proportion; target_geom.height = max_client_height * c->scroller_proportion;
vertical_scroll_adjust_fullandmax(c, &target_geom);
target_geom.y = tempClients[focus_client_index - i + 1]->geom.y - target_geom.y = tempClients[focus_client_index - i + 1]->geom.y -
cur_gappiv - target_geom.height; cur_gappiv - target_geom.height;
resize(c, target_geom, 0); resize(c, target_geom, 0);
} }
for (i = 1; i < n - focus_client_index; i++) { for (i = 1; i < n - focus_client_index; i++) {
c = tempClients[focus_client_index + i]; c = tempClients[focus_client_index + i];
target_geom.height = max_client_height * c->scroller_proportion; target_geom.height = max_client_height * c->scroller_proportion;
vertical_scroll_adjust_fullandmax(c, &target_geom);
target_geom.y = tempClients[focus_client_index + i - 1]->geom.y + target_geom.y = tempClients[focus_client_index + i - 1]->geom.y +
cur_gappiv + cur_gappiv +
tempClients[focus_client_index + i - 1]->geom.height; tempClients[focus_client_index + i - 1]->geom.height;

View File

@@ -104,6 +104,9 @@
#define ISTILED(A) \ #define ISTILED(A) \
(A && !(A)->isfloating && !(A)->isminied && !(A)->iskilling && \ (A && !(A)->isfloating && !(A)->isminied && !(A)->iskilling && \
!(A)->ismaximizescreen && !(A)->isfullscreen && !(A)->isunglobal) !(A)->ismaximizescreen && !(A)->isfullscreen && !(A)->isunglobal)
#define ISSCROLLTILED(A) \
(A && !(A)->isfloating && !(A)->isminied && !(A)->iskilling && \
!(A)->isunglobal)
#define VISIBLEON(C, M) \ #define VISIBLEON(C, M) \
((C) && (M) && (C)->mon == (M) && ((C)->tags & (M)->tagset[(M)->seltags])) ((C) && (M) && (C)->mon == (M) && ((C)->tags & (M)->tagset[(M)->seltags]))
#define LENGTH(X) (sizeof X / sizeof X[0]) #define LENGTH(X) (sizeof X / sizeof X[0])
@@ -481,6 +484,7 @@ struct Monitor {
int asleep; int asleep;
unsigned int visible_clients; unsigned int visible_clients;
unsigned int visible_tiling_clients; unsigned int visible_tiling_clients;
unsigned int visible_scroll_tiling_clients;
bool has_visible_fullscreen_client; bool has_visible_fullscreen_client;
struct wlr_scene_optimized_blur *blur; struct wlr_scene_optimized_blur *blur;
char last_surface_ws_name[256]; char last_surface_ws_name[256];
@@ -934,6 +938,10 @@ void applybounds(Client *c, struct wlr_box *bbox) {
/*清除全屏标志,还原全屏时清0的border*/ /*清除全屏标志,还原全屏时清0的border*/
void clear_fullscreen_flag(Client *c) { void clear_fullscreen_flag(Client *c) {
if (is_scroller_layout(c->mon))
return;
if (c->isfullscreen) { if (c->isfullscreen) {
setfullscreen(c, false); setfullscreen(c, false);
} }
@@ -3160,7 +3168,6 @@ void focusclient(Client *c, int lift) {
if (c && selmon->prevsel && if (c && selmon->prevsel &&
(selmon->prevsel->tags & selmon->tagset[selmon->seltags]) && (selmon->prevsel->tags & selmon->tagset[selmon->seltags]) &&
(c->tags & selmon->tagset[selmon->seltags]) && !c->isfloating && (c->tags & selmon->tagset[selmon->seltags]) && !c->isfloating &&
!c->isfullscreen && !c->ismaximizescreen &&
is_scroller_layout(selmon)) { is_scroller_layout(selmon)) {
arrange(selmon, false); arrange(selmon, false);
} }
@@ -3718,7 +3725,7 @@ mapnotify(struct wl_listener *listener, void *data) {
else if (selmon && is_scroller_layout(selmon) && else if (selmon && is_scroller_layout(selmon) &&
selmon->visible_tiling_clients > 0) { selmon->visible_tiling_clients > 0) {
if (selmon->sel && ISTILED(selmon->sel) && if (selmon->sel && ISSCROLLTILED(selmon->sel) &&
VISIBLEON(selmon->sel, selmon)) { VISIBLEON(selmon->sel, selmon)) {
at_client = selmon->sel; at_client = selmon->sel;
} else { } else {
@@ -4550,7 +4557,8 @@ void setmaximizescreen(Client *c, int maximizescreen) {
maximizescreen_box.width = c->mon->w.width - 2 * gappoh; maximizescreen_box.width = c->mon->w.width - 2 * gappoh;
maximizescreen_box.height = c->mon->w.height - 2 * gappov; maximizescreen_box.height = c->mon->w.height - 2 * gappov;
wlr_scene_node_raise_to_top(&c->scene->node); // 将视图提升到顶层 wlr_scene_node_raise_to_top(&c->scene->node); // 将视图提升到顶层
resize(c, maximizescreen_box, 0); if (!is_scroller_layout(c->mon))
resize(c, maximizescreen_box, 0);
c->ismaximizescreen = 1; c->ismaximizescreen = 1;
} else { } else {
c->bw = c->isnoborder ? 0 : borderpx; c->bw = c->isnoborder ? 0 : borderpx;
@@ -4607,7 +4615,8 @@ void setfullscreen(Client *c, int fullscreen) // 用自定义全屏代理自带
c->bw = 0; c->bw = 0;
wlr_scene_node_raise_to_top(&c->scene->node); // 将视图提升到顶层 wlr_scene_node_raise_to_top(&c->scene->node); // 将视图提升到顶层
resize(c, c->mon->m, 1); if (!is_scroller_layout(c->mon))
resize(c, c->mon->m, 1);
c->isfullscreen = 1; c->isfullscreen = 1;
} else { } else {
c->bw = c->isnoborder ? 0 : borderpx; c->bw = c->isnoborder ? 0 : borderpx;