Compare commits

..

18 Commits

Author SHA1 Message Date
rasmusq
40948d22ba Merge branch 'main' into feature/dual-row-scroller-clean 2025-11-29 20:18:53 +01:00
DreamMaoMao
c0eceeb3bf fix: avoid toggle overview when setfullscreen and setmaximziescreen
Some checks failed
Close manually marked stale issues / close-issues (push) Has been cancelled
Lock Threads / lock (push) Has been cancelled
2025-11-29 22:46:47 +08:00
DreamMaoMao
09c1920515 opt: correct var isminized to isminimized 2025-11-29 17:33:57 +08:00
DreamMaoMao
b3ccf43453 opt: not swallow the isminied window 2025-11-29 17:30:22 +08:00
DreamMaoMao
7c7a9437e6 opt: optimize option name transparent_wlr_lock to allow_lock_transparent 2025-11-29 16:31:09 +08:00
DreamMaoMao
66bf6d5cff Merge pull request #448 from Rexcrazy804/xray-lockscreen
feat: support transparent wlr session lock
2025-11-29 16:23:42 +08:00
Rexiel Scarlet
006cf46c52 feat: support transparent wlr session lock 2025-11-29 16:22:19 +08:00
DreamMaoMao
16368a8781 opt: optimize code struct
Some checks failed
Close manually marked stale issues / close-issues (push) Has been cancelled
Lock Threads / lock (push) Has been cancelled
2025-11-28 12:49:06 +08:00
DreamMaoMao
b768f72eaa opt: allow ime in on-demand layer 2025-11-28 12:42:18 +08:00
DreamMaoMao
28ab0e6343 opt: re-judge the focus strategy of the layer when re-arrangelayer 2025-11-28 12:15:47 +08:00
rasmusq
94a051e266 add: configuration options and keybinds for the dual-scroller layout 2025-11-27 20:57:20 +01:00
dd6223d383 fix do not scroll to index zero when no window in row is focused 2025-11-27 20:57:20 +01:00
f7d4420685 update use dedicated row identifiers 2025-11-27 20:57:20 +01:00
09847dd09e add only respect scroller centering on bottom row 2025-11-27 20:57:20 +01:00
50b24942e7 fix row consistent movement and focus 2025-11-27 20:57:20 +01:00
8994b4cee2 fix rows keep their position when left 2025-11-27 20:57:20 +01:00
5089995cfa fix overlapping tiles 2025-11-27 20:57:20 +01:00
9db45cbb52 add first running version 2025-11-27 20:57:20 +01:00
10 changed files with 93 additions and 154 deletions

46
flake.lock generated
View File

@@ -18,27 +18,6 @@
"type": "github"
}
},
"flake-utils": {
"inputs": {
"systems": [
"scenefx",
"systems"
]
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1750386251,
@@ -79,18 +58,16 @@
},
"scenefx": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": [
"nixpkgs"
],
"systems": "systems"
]
},
"locked": {
"lastModified": 1762447505,
"narHash": "sha256-VEBQ8KXkSS4c+kdAhmvq06lEd9WNeCXdRK1U+qSilFw=",
"lastModified": 1750785057,
"narHash": "sha256-tGX6j4W91rcb+glXJo43sjPI9zQvPotonknG1BdihR4=",
"owner": "wlrfx",
"repo": "scenefx",
"rev": "7f9e7409f6169fa637f1265895c121a8f8b70272",
"rev": "3a6cfb12e4ba97b43326357d14f7b3e40897adfc",
"type": "github"
},
"original": {
@@ -98,21 +75,6 @@
"repo": "scenefx",
"type": "github"
}
},
"systems": {
"locked": {
"lastModified": 1689347949,
"narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",
"owner": "nix-systems",
"repo": "default-linux",
"rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default-linux",
"type": "github"
}
}
},
"root": "root",

View File

@@ -25,13 +25,12 @@
perSystem = {
config,
system,
pkgs,
...
}: let
inherit (pkgs) callPackage;
inherit (pkgs) callPackage ;
mango = callPackage ./nix {
scenefx = inputs.scenefx.packages.${system}.default;
inherit (inputs.scenefx.packages.${pkgs.stdenv.hostPlatform.system}) scenefx;
};
shellOverride = old: {
nativeBuildInputs = old.nativeBuildInputs ++ [];

View File

@@ -245,10 +245,6 @@ void buffer_set_effect(Client *c, BufferData data) {
data.corner_location = CORNER_LOCATION_NONE;
}
if (blur && !c->noblur) {
wlr_scene_blur_set_corner_radius(c->blur, border_radius,
data.corner_location);
}
wlr_scene_node_for_each_buffer(&c->scene_surface->node,
scene_buffer_apply_effect, &data);
}
@@ -353,19 +349,6 @@ void client_draw_shadow(Client *c) {
wlr_scene_shadow_set_clipped_region(c->shadow, clipped_region);
}
void client_draw_blur(Client *c, struct wlr_box clip_box, struct ivec2 offset) {
if (blur && !c->noblur) {
if (c->scene_surface->node.enabled && !c->blur->node.enabled)
wlr_scene_node_set_enabled(&c->blur->node, true);
wlr_scene_node_set_position(&c->blur->node, offset.x, offset.y);
wlr_scene_blur_set_size(c->blur, clip_box.width - c->bw,
clip_box.height - c->bw);
} else {
if (c->blur->node.enabled)
wlr_scene_node_set_enabled(&c->blur->node, false);
}
}
void apply_border(Client *c) {
if (!c || c->iskilling || !client_surface(c)->mapped)
return;
@@ -550,14 +533,12 @@ void client_apply_clip(Client *c, float factor) {
apply_border(c);
client_draw_shadow(c);
client_draw_blur(c, clip_box, offset);
if (clip_box.width <= 0 || clip_box.height <= 0) {
return;
}
wlr_scene_subsurface_tree_set_clip(&c->scene_surface->node, &clip_box);
buffer_set_effect(c, (BufferData){1.0f, 1.0f, clip_box.width,
clip_box.height,
current_corner_location, true});
@@ -589,7 +570,6 @@ void client_apply_clip(Client *c, float factor) {
// 应用窗口装饰
apply_border(c);
client_draw_shadow(c);
client_draw_blur(c, clip_box, offset);
// 如果窗口剪切区域已经剪切到0则不渲染窗口表面
if (clip_box.width <= 0 || clip_box.height <= 0) {
@@ -1011,10 +991,6 @@ void resize(Client *c, struct wlr_box geo, int interact) {
apply_border(c);
client_get_clip(c, &clip);
wlr_scene_subsurface_tree_set_clip(&c->scene_surface->node, &clip);
if (blur && !c->noblur)
wlr_scene_blur_set_size(c->blur,
c->animation.current.width - 2 * c->bw,
c->animation.current.height - 2 * c->bw);
return;
}
// 如果不是工作区切换时划出去的窗口,就让动画的结束位置,就是上面的真实位置和大小

View File

@@ -158,6 +158,12 @@ static bool scene_node_snapshot(struct wlr_scene_node *node, int lx, int ly,
scene_buffer->corner_radius,
scene_buffer->corners);
// wlr_scene_buffer_set_backdrop_blur_optimized(
// snapshot_buffer, scene_buffer->backdrop_blur_optimized);
// wlr_scene_buffer_set_backdrop_blur_ignore_transparent(
// snapshot_buffer, scene_buffer->backdrop_blur_ignore_transparent);
wlr_scene_buffer_set_backdrop_blur(snapshot_buffer, false);
snapshot_buffer->node.data = scene_buffer->node.data;
struct wlr_scene_surface *scene_surface =
@@ -192,8 +198,6 @@ static bool scene_node_snapshot(struct wlr_scene_node *node, int lx, int ly,
break;
}
case WLR_SCENE_NODE_BLUR:
break;
case WLR_SCENE_NODE_OPTIMIZED_BLUR:
return true;
}

View File

@@ -356,10 +356,6 @@ void layer_animation_next_tick(LayerSurface *l) {
.height = height,
};
if (blur && blur_layer && !l->noblur && l->blur)
wlr_scene_blur_set_size(l->blur, l->animation.current.width,
l->animation.current.height);
if (animation_passed >= 1.0) {
l->animation.running = false;
l->need_output_flush = false;

View File

@@ -340,6 +340,7 @@ typedef struct {
int adaptive_sync;
int allow_tearing;
int allow_shortcuts_inhibit;
int allow_lock_transparent;
struct xkb_rule_names xkb_rules;
@@ -1229,6 +1230,8 @@ void parse_option(Config *config, char *key, char *value) {
config->allow_tearing = atoi(value);
} else if (strcmp(key, "allow_shortcuts_inhibit") == 0) {
config->allow_shortcuts_inhibit = atoi(value);
} else if (strcmp(key, "allow_lock_transparent") == 0) {
config->allow_lock_transparent = atoi(value);
} else if (strcmp(key, "no_border_when_single") == 0) {
config->no_border_when_single = atoi(value);
} else if (strcmp(key, "no_radius_when_single") == 0) {
@@ -2681,6 +2684,7 @@ void override_config(void) {
adaptive_sync = CLAMP_INT(config.adaptive_sync, 0, 1);
allow_tearing = CLAMP_INT(config.allow_tearing, 0, 2);
allow_shortcuts_inhibit = CLAMP_INT(config.allow_shortcuts_inhibit, 0, 1);
allow_lock_transparent = CLAMP_INT(config.allow_lock_transparent, 0, 1);
axis_bind_apply_timeout =
CLAMP_INT(config.axis_bind_apply_timeout, 0, 1000);
focus_on_activate = CLAMP_INT(config.focus_on_activate, 0, 1);
@@ -2860,6 +2864,7 @@ void set_value_default() {
config.adaptive_sync = adaptive_sync;
config.allow_tearing = allow_tearing;
config.allow_shortcuts_inhibit = allow_shortcuts_inhibit;
config.allow_lock_transparent = allow_lock_transparent;
config.no_border_when_single = no_border_when_single;
config.no_radius_when_single = no_radius_when_single;
config.snap_distance = snap_distance;

View File

@@ -104,6 +104,7 @@ int warpcursor = 1; /* Warp cursor to focused client */
int xwayland_persistence = 1; /* xwayland persistence */
int syncobj_enable = 0;
int adaptive_sync = 0;
int allow_lock_transparent = 0;
double drag_refresh_interval = 30.0;
int allow_tearing = TEARING_DISABLED;
int allow_shortcuts_inhibit = SHORTCUTS_INHIBIT_ENABLE;

View File

@@ -156,7 +156,7 @@ int focuslast(const Arg *arg) {
unsigned int target = 0;
wl_list_for_each(c, &fstack, flink) {
if (c->iskilling || c->isminied || c->isunglobal ||
if (c->iskilling || c->isminimized || c->isunglobal ||
!client_surface(c)->mapped || client_is_unmanaged(c) ||
client_is_x11_popup(c))
continue;
@@ -516,7 +516,7 @@ int restore_minimized(const Arg *arg) {
if (selmon && selmon->sel && selmon->sel->is_in_scratchpad &&
selmon->sel->is_scratchpad_show) {
selmon->sel->isminied = 0;
selmon->sel->isminimized = 0;
selmon->sel->is_scratchpad_show = 0;
selmon->sel->is_in_scratchpad = 0;
selmon->sel->isnamedscratchpad = 0;
@@ -525,7 +525,7 @@ int restore_minimized(const Arg *arg) {
}
wl_list_for_each(c, &clients, link) {
if (c->isminied && !c->isnamedscratchpad) {
if (c->isminimized && !c->isnamedscratchpad) {
c->is_scratchpad_show = 0;
c->is_in_scratchpad = 0;
c->isnamedscratchpad = 0;
@@ -1167,7 +1167,7 @@ int toggle_scratchpad(const Arg *arg) {
continue;
}
if (single_scratchpad && c->isnamedscratchpad && !c->isminied) {
if (single_scratchpad && c->isnamedscratchpad && !c->isminimized) {
set_minimized(c);
continue;
}
@@ -1492,7 +1492,7 @@ int minimized(const Arg *arg) {
if (selmon && selmon->isoverview)
return 0;
if (selmon->sel && !selmon->sel->isminied) {
if (selmon->sel && !selmon->sel->isminimized) {
set_minimized(selmon->sel);
}
return 0;
@@ -1514,7 +1514,7 @@ int toggleoverview(const Arg *arg) {
wl_list_for_each(c, &clients, link) if (c && c->mon == selmon &&
!client_is_unmanaged(c) &&
!client_is_x11_popup(c) &&
!c->isminied &&
!c->isminimized &&
!c->isunglobal) {
visible_client_number++;
}

View File

@@ -9,12 +9,12 @@ void handle_foreign_activate_request(struct wl_listener *listener, void *data) {
if (c && c->swallowing)
return;
if (c && !c->isminied && c == selmon->sel) {
if (c && !c->isminimized && c == selmon->sel) {
set_minimized(c);
return;
}
if (c->isminied) {
if (c->isminimized) {
c->is_in_scratchpad = 0;
c->isnamedscratchpad = 0;
c->is_scratchpad_show = 0;

View File

@@ -102,10 +102,10 @@
A->geom.x + A->geom.width <= A->mon->m.x + A->mon->m.width && \
A->geom.y + A->geom.height <= A->mon->m.y + A->mon->m.height)
#define ISTILED(A) \
(A && !(A)->isfloating && !(A)->isminied && !(A)->iskilling && \
(A && !(A)->isfloating && !(A)->isminimized && !(A)->iskilling && \
!(A)->ismaximizescreen && !(A)->isfullscreen && !(A)->isunglobal)
#define ISSCROLLTILED(A) \
(A && !(A)->isfloating && !(A)->isminied && !(A)->iskilling && \
(A && !(A)->isfloating && !(A)->isminimized && !(A)->iskilling && \
!(A)->isunglobal)
#define VISIBLEON(C, M) \
((C) && (M) && (C)->mon == (M) && ((C)->tags & (M)->tagset[(M)->seltags]))
@@ -285,7 +285,6 @@ struct Client {
struct wlr_scene_tree *scene;
struct wlr_scene_rect *border; /* top, bottom, left, right */
struct wlr_scene_shadow *shadow;
struct wlr_scene_blur *blur;
struct wlr_scene_tree *scene_surface;
struct wl_list link;
struct wl_list flink;
@@ -316,7 +315,7 @@ struct Client {
unsigned int configure_serial;
struct wlr_foreign_toplevel_handle_v1 *foreign_toplevel;
int isfloating, isurgent, isfullscreen, isfakefullscreen,
need_float_size_reduce, isminied, isoverlay, isnosizehint,
need_float_size_reduce, isminimized, isoverlay, isnosizehint,
ignore_maximize, ignore_minimize;
int ismaximizescreen;
int overview_backup_bw;
@@ -425,7 +424,6 @@ typedef struct {
struct wlr_scene_tree *scene;
struct wlr_scene_tree *popups;
struct wlr_scene_shadow *shadow;
struct wlr_scene_blur *blur;
struct wlr_scene_layer_surface_v1 *scene_layer;
struct wl_list link;
struct wl_list fadeout_link;
@@ -1013,7 +1011,7 @@ void swallow(Client *c, Client *w) {
c->isurgent = w->isurgent;
c->isfullscreen = w->isfullscreen;
c->ismaximizescreen = w->ismaximizescreen;
c->isminied = w->isminied;
c->isminimized = w->isminimized;
c->is_in_scratchpad = w->is_in_scratchpad;
c->is_scratchpad_show = w->is_scratchpad_show;
c->tags = w->tags;
@@ -1033,7 +1031,7 @@ void swallow(Client *c, Client *w) {
if (!c->foreign_toplevel && c->mon)
add_foreign_toplevel(c);
if (c->isminied && c->foreign_toplevel) {
if (c->isminimized && c->foreign_toplevel) {
wlr_foreign_toplevel_handle_v1_set_activated(c->foreign_toplevel,
false);
wlr_foreign_toplevel_handle_v1_set_minimized(c->foreign_toplevel, true);
@@ -1380,7 +1378,7 @@ void applyrules(Client *c) {
if (!c->noswallow && !c->isfloating && !client_is_float_type(c) &&
!c->surface.xdg->initial_commit) {
Client *p = termforwin(c);
if (p) {
if (p && !p->isminimized) {
c->swallowedby = p;
p->swallowing = c;
wl_list_remove(&c->link);
@@ -1561,12 +1559,19 @@ void apply_window_snap(Client *c) {
resize(c, c->geom, 0);
}
void focuslayer(LayerSurface *l) {
focusclient(NULL, 0);
dwl_im_relay_set_focus(dwl_input_method_relay, l->layer_surface->surface);
client_notify_enter(l->layer_surface->surface, wlr_seat_get_keyboard(seat));
}
void reset_exclusive_layer(Monitor *m) {
LayerSurface *l = NULL;
int i;
unsigned int layers_above_shell[] = {
ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY,
ZWLR_LAYER_SHELL_V1_LAYER_TOP,
ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM,
};
if (!m)
@@ -1574,18 +1579,24 @@ void reset_exclusive_layer(Monitor *m) {
for (i = 0; i < (int)LENGTH(layers_above_shell); i++) {
wl_list_for_each_reverse(l, &m->layers[layers_above_shell[i]], link) {
if (l == exclusive_focus &&
l->layer_surface->current.keyboard_interactive !=
ZWLR_LAYER_SURFACE_V1_KEYBOARD_INTERACTIVITY_EXCLUSIVE)
exclusive_focus = NULL;
if (l->layer_surface->current.keyboard_interactive ==
ZWLR_LAYER_SURFACE_V1_KEYBOARD_INTERACTIVITY_NONE &&
l->layer_surface->surface ==
seat->keyboard_state.focused_surface)
focusclient(focustop(selmon), 1);
if (locked ||
l->layer_surface->current.keyboard_interactive !=
ZWLR_LAYER_SURFACE_V1_KEYBOARD_INTERACTIVITY_EXCLUSIVE ||
!l->mapped || l == exclusive_focus)
continue;
/* Deactivate the focused client. */
focusclient(NULL, 0);
exclusive_focus = l;
dwl_im_relay_set_focus(dwl_input_method_relay,
l->layer_surface->surface);
client_notify_enter(l->layer_surface->surface,
wlr_seat_get_keyboard(seat));
focuslayer(l);
return;
}
}
@@ -1886,11 +1897,7 @@ buttonpress(struct wl_listener *listener, void *data) {
if (l && !exclusive_focus &&
l->layer_surface->current.keyboard_interactive ==
ZWLR_LAYER_SURFACE_V1_KEYBOARD_INTERACTIVITY_ON_DEMAND) {
focusclient(NULL, 0);
dwl_im_relay_set_focus(dwl_input_method_relay,
l->layer_surface->surface);
client_notify_enter(l->layer_surface->surface,
wlr_seat_get_keyboard(seat));
focuslayer(l);
}
}
@@ -2147,16 +2154,12 @@ static void iter_layer_scene_buffers(struct wlr_scene_buffer *buffer, int sx,
return;
}
LayerSurface *l = (LayerSurface *)user_data;
wlr_scene_node_set_enabled(&l->blur->node, true);
wlr_scene_blur_set_transparency_mask_source(l->blur, buffer);
wlr_scene_blur_set_size(l->blur, l->geom.width, l->geom.height);
wlr_scene_buffer_set_backdrop_blur(buffer, true);
wlr_scene_buffer_set_backdrop_blur_ignore_transparent(buffer, true);
if (blur_optimized) {
wlr_scene_blur_set_should_only_blur_bottom_layer(l->blur, true);
wlr_scene_buffer_set_backdrop_blur_optimized(buffer, true);
} else {
wlr_scene_blur_set_should_only_blur_bottom_layer(l->blur, false);
wlr_scene_buffer_set_backdrop_blur_optimized(buffer, false);
}
}
@@ -2201,19 +2204,15 @@ void maplayersurfacenotify(struct wl_listener *listener, void *data) {
}
// 初始化阴影
if (layer_surface->current.layer != ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM &&
if (layer_surface->current.exclusive_zone == 0 &&
layer_surface->current.layer != ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM &&
layer_surface->current.layer != ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND) {
if (layer_surface->current.exclusive_zone == 0) {
l->shadow = wlr_scene_shadow_create(l->scene, 0, 0, border_radius,
shadows_blur, shadowscolor);
wlr_scene_node_lower_to_bottom(&l->shadow->node);
wlr_scene_node_set_enabled(&l->shadow->node, true);
}
l->blur = wlr_scene_blur_create(l->scene, 0, 0);
wlr_scene_node_lower_to_bottom(&l->blur->node);
}
// 初始化动画
if (animations && layer_animations && !l->noanim) {
l->animation.duration = animation_duration_open;
@@ -2227,9 +2226,7 @@ void maplayersurfacenotify(struct wl_listener *listener, void *data) {
if (!exclusive_focus &&
l->layer_surface->current.keyboard_interactive ==
ZWLR_LAYER_SURFACE_V1_KEYBOARD_INTERACTIVITY_ON_DEMAND) {
focusclient(NULL, 0);
client_notify_enter(l->layer_surface->surface,
wlr_seat_get_keyboard(seat));
focuslayer(l);
}
}
@@ -2277,8 +2274,7 @@ void commitlayersurfacenotify(struct wl_listener *listener, void *data) {
if (!l->noblur &&
layer_surface->current.layer != ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM &&
layer_surface->current.layer !=
ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND &&
l->blur) {
ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND) {
wlr_scene_node_for_each_buffer(&l->scene->node,
iter_layer_scene_buffers, l);
@@ -3043,7 +3039,9 @@ void destroylock(SessionLock *lock, int unlock) {
if ((locked = !unlock))
goto destroy;
if (locked_bg->node.enabled) {
wlr_scene_node_set_enabled(&locked_bg->node, false);
}
focusclient(focustop(selmon), 0);
motionnotify(0, NULL, 0, 0, 0, 0);
@@ -3581,7 +3579,9 @@ void pending_kill_client(Client *c) {
void locksession(struct wl_listener *listener, void *data) {
struct wlr_session_lock_v1 *session_lock = data;
SessionLock *lock;
if (!allow_lock_transparent) {
wlr_scene_node_set_enabled(&locked_bg->node, true);
}
if (cur_lock) {
wlr_session_lock_v1_destroy(session_lock);
return;
@@ -3617,15 +3617,15 @@ static void iter_xdg_scene_buffers(struct wlr_scene_buffer *buffer, int sx,
return;
if (blur && c && !c->noblur) {
wlr_scene_node_set_enabled(&c->blur->node, true);
// wlr_scene_blur_set_transparency_mask_source(c->blur, buffer);
wlr_scene_buffer_set_backdrop_blur(buffer, true);
wlr_scene_buffer_set_backdrop_blur_ignore_transparent(buffer, false);
if (blur_optimized) {
wlr_scene_blur_set_should_only_blur_bottom_layer(c->blur, true);
wlr_scene_buffer_set_backdrop_blur_optimized(buffer, true);
} else {
wlr_scene_blur_set_should_only_blur_bottom_layer(c->blur, false);
wlr_scene_buffer_set_backdrop_blur_optimized(buffer, false);
}
} else {
wlr_scene_node_set_enabled(&c->blur->node, false);
wlr_scene_buffer_set_backdrop_blur(buffer, false);
}
}
@@ -3636,7 +3636,7 @@ void init_client_properties(Client *c) {
c->iskilling = 0;
c->istagswitching = 0;
c->isglobal = 0;
c->isminied = 0;
c->isminimized = 0;
c->isoverlay = 0;
c->isunglobal = 0;
c->is_in_scratchpad = 0;
@@ -3740,9 +3740,6 @@ mapnotify(struct wl_listener *listener, void *data) {
c->shadow = wlr_scene_shadow_create(c->scene, 0, 0, border_radius,
shadows_blur, shadowscolor);
c->blur = wlr_scene_blur_create(c->scene_surface, 0, 0);
wlr_scene_node_lower_to_bottom(&c->blur->node);
wlr_scene_node_lower_to_bottom(&c->shadow->node);
wlr_scene_node_set_enabled(&c->shadow->node, true);
@@ -3814,7 +3811,7 @@ void maximizenotify(struct wl_listener *listener, void *data) {
void unminimize(Client *c) {
if (c && c->is_in_scratchpad && c->is_scratchpad_show) {
c->isminied = 0;
c->isminimized = 0;
c->is_scratchpad_show = 0;
c->is_in_scratchpad = 0;
c->isnamedscratchpad = 0;
@@ -3822,7 +3819,7 @@ void unminimize(Client *c) {
return;
}
if (c && c->isminied) {
if (c && c->isminimized) {
show_hide_client(c);
c->is_scratchpad_show = 0;
c->is_in_scratchpad = 0;
@@ -3842,7 +3839,7 @@ void set_minimized(Client *c) {
c->oldtags = c->mon->tagset[c->mon->seltags];
c->mini_restore_tag = c->tags;
c->tags = 0;
c->isminied = 1;
c->isminimized = 1;
c->is_in_scratchpad = 1;
c->is_scratchpad_show = 0;
focusclient(focustop(selmon), 1);
@@ -3857,15 +3854,15 @@ void minimizenotify(struct wl_listener *listener, void *data) {
Client *c = wl_container_of(listener, c, minimize);
if (!c || !c->mon || c->iskilling || c->isminied)
if (!c || !c->mon || c->iskilling || c->isminimized)
return;
if (client_request_minimize(c, data) && !c->ignore_minimize) {
if (!c->isminied)
if (!c->isminimized)
set_minimized(c);
client_set_minimized(c, true);
} else {
if (c->isminied)
if (c->isminimized)
unminimize(c);
client_set_minimized(c, false);
}
@@ -4570,6 +4567,9 @@ void setmaximizescreen(Client *c, int maximizescreen) {
if (!c || !c->mon || !client_surface(c)->mapped || c->iskilling)
return;
if (c->mon->isoverview)
return;
c->ismaximizescreen = maximizescreen;
if (maximizescreen) {
@@ -4579,10 +4579,6 @@ void setmaximizescreen(Client *c, int maximizescreen) {
if (c->isfloating)
c->float_geom = c->geom;
if (selmon->isoverview) {
Arg arg = {0};
toggleoverview(&arg);
}
maximizescreen_box.x = c->mon->w.x + gappoh;
maximizescreen_box.y = c->mon->w.y + gappov;
@@ -4626,11 +4622,15 @@ void setfakefullscreen(Client *c, int fakefullscreen) {
void setfullscreen(Client *c, int fullscreen) // 用自定义全屏代理自带全屏
{
c->isfullscreen = fullscreen;
if (!c || !c->mon || !client_surface(c)->mapped || c->iskilling)
return;
if (c->mon->isoverview)
return;
c->isfullscreen = fullscreen;
client_set_fullscreen(c, fullscreen);
if (fullscreen) {
@@ -4639,10 +4639,6 @@ void setfullscreen(Client *c, int fullscreen) // 用自定义全屏代理自带
if (c->isfloating)
c->float_geom = c->geom;
if (selmon->isoverview) {
Arg arg = {0};
toggleoverview(&arg);
}
c->bw = 0;
wlr_scene_node_raise_to_top(&c->scene->node); // 将视图提升到顶层
@@ -4856,7 +4852,7 @@ void show_hide_client(Client *c) {
c->tags = c->oldtags;
arrange(c->mon, false);
}
c->isminied = 0;
c->isminimized = 0;
wlr_foreign_toplevel_handle_v1_set_minimized(c->foreign_toplevel, false);
focusclient(c, 1);
wlr_foreign_toplevel_handle_v1_set_activated(c->foreign_toplevel, true);
@@ -5345,7 +5341,7 @@ void unmapnotify(struct wl_listener *listener, void *data) {
Monitor *m = NULL;
c->iskilling = 1;
if (animations && !c->is_clip_to_hide && !c->isminied &&
if (animations && !c->is_clip_to_hide && !c->isminimized &&
(!c->mon || VISIBLEON(c, c->mon)))
init_fadeout_client(c);
@@ -5756,8 +5752,8 @@ void activatex11(struct wl_listener *listener, void *data) {
if (c && c->swallowing)
return;
if (c->isminied) {
c->isminied = 0;
if (c->isminimized) {
c->isminimized = 0;
c->tags = c->mini_restore_tag;
c->is_scratchpad_show = 0;
c->is_in_scratchpad = 0;