mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-05-29 21:37:42 -04:00
fix: error changse surface scene in minimized client
will cause crash if close all client in overview, when has minimized client before toggle overview
This commit is contained in:
parent
46d0d139a5
commit
0950d4da9e
3 changed files with 13 additions and 8 deletions
|
|
@ -264,7 +264,7 @@ void buffer_set_effect(Client *c, BufferData data) {
|
||||||
if (c == grabc)
|
if (c == grabc)
|
||||||
data.should_scale = false;
|
data.should_scale = false;
|
||||||
|
|
||||||
if (c->mon->isoverview && config.ov_no_resize) {
|
if (c->overview_scene_surface) {
|
||||||
wlr_scene_node_for_each_buffer(
|
wlr_scene_node_for_each_buffer(
|
||||||
&c->scene_surface->node, scene_buffer_apply_overview_effect, &data);
|
&c->scene_surface->node, scene_buffer_apply_overview_effect, &data);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -705,7 +705,7 @@ void client_apply_clip(Client *c, float factor) {
|
||||||
struct ivec2 offset;
|
struct ivec2 offset;
|
||||||
BufferData buffer_data;
|
BufferData buffer_data;
|
||||||
|
|
||||||
if (!config.animations && !c->mon->isoverview) {
|
if (!config.animations && !c->overview_scene_surface) {
|
||||||
c->animation.running = false;
|
c->animation.running = false;
|
||||||
c->need_output_flush = false;
|
c->need_output_flush = false;
|
||||||
c->animainit_geom = c->current = c->pending = c->animation.current =
|
c->animainit_geom = c->current = c->pending = c->animation.current =
|
||||||
|
|
@ -722,7 +722,8 @@ void client_apply_clip(Client *c, float factor) {
|
||||||
}
|
}
|
||||||
|
|
||||||
apply_shield(c, clip_box);
|
apply_shield(c, clip_box);
|
||||||
if (!c->mon->isoverview || !config.ov_no_resize) {
|
|
||||||
|
if (!c->overview_scene_surface) {
|
||||||
wlr_scene_subsurface_tree_set_clip(&c->scene_surface->node,
|
wlr_scene_subsurface_tree_set_clip(&c->scene_surface->node,
|
||||||
&clip_box);
|
&clip_box);
|
||||||
}
|
}
|
||||||
|
|
@ -774,7 +775,7 @@ void client_apply_clip(Client *c, float factor) {
|
||||||
// 应用窗口表面剪切
|
// 应用窗口表面剪切
|
||||||
apply_shield(c, clip_box);
|
apply_shield(c, clip_box);
|
||||||
|
|
||||||
if (!c->mon->isoverview || !config.ov_no_resize) {
|
if (!c->overview_scene_surface) {
|
||||||
wlr_scene_subsurface_tree_set_clip(&c->scene_surface->node, &clip_box);
|
wlr_scene_subsurface_tree_set_clip(&c->scene_surface->node, &clip_box);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -792,7 +793,7 @@ void client_apply_clip(Client *c, float factor) {
|
||||||
buffer_data.height_scale =
|
buffer_data.height_scale =
|
||||||
(float)buffer_data.height / acutal_surface_height;
|
(float)buffer_data.height / acutal_surface_height;
|
||||||
|
|
||||||
if (factor == 1.0 && !c->mon->isoverview) {
|
if (factor == 1.0 && !c->overview_scene_surface) {
|
||||||
buffer_data.width_scale = 1.0;
|
buffer_data.width_scale = 1.0;
|
||||||
buffer_data.height_scale = 1.0;
|
buffer_data.height_scale = 1.0;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -1266,6 +1266,9 @@ int32_t toggle_named_scratchpad(const Arg *arg) {
|
||||||
char *arg_id = arg->v;
|
char *arg_id = arg->v;
|
||||||
char *arg_title = arg->v2;
|
char *arg_title = arg->v2;
|
||||||
|
|
||||||
|
if (selmon && selmon->isoverview)
|
||||||
|
return 0;
|
||||||
|
|
||||||
target_client = get_client_by_id_or_title(arg_id, arg_title);
|
target_client = get_client_by_id_or_title(arg_id, arg_title);
|
||||||
|
|
||||||
if (!target_client && arg->v3) {
|
if (!target_client && arg->v3) {
|
||||||
|
|
@ -1744,7 +1747,8 @@ int32_t toggleoverview(const Arg *arg) {
|
||||||
|
|
||||||
wl_list_for_each(c, &clients, link) {
|
wl_list_for_each(c, &clients, link) {
|
||||||
if (c && c->mon == selmon && !client_is_unmanaged(c) &&
|
if (c && c->mon == selmon && !client_is_unmanaged(c) &&
|
||||||
!client_is_x11_popup(c) && !c->isunglobal) {
|
!client_is_x11_popup(c) && !c->isunglobal && !c->isminimized &&
|
||||||
|
client_surface(c)->mapped) {
|
||||||
c->animation.overining = true;
|
c->animation.overining = true;
|
||||||
overview_backup(c);
|
overview_backup(c);
|
||||||
}
|
}
|
||||||
|
|
@ -1753,7 +1757,7 @@ int32_t toggleoverview(const Arg *arg) {
|
||||||
selmon->tagset[selmon->seltags] = target;
|
selmon->tagset[selmon->seltags] = target;
|
||||||
wl_list_for_each(c, &clients, link) {
|
wl_list_for_each(c, &clients, link) {
|
||||||
if (c && c->mon == selmon && !c->iskilling &&
|
if (c && c->mon == selmon && !c->iskilling &&
|
||||||
!client_is_unmanaged(c) && !c->isunglobal &&
|
!client_is_unmanaged(c) && !c->isunglobal && !c->isminimized &&
|
||||||
!client_is_x11_popup(c) && client_surface(c)->mapped) {
|
!client_is_x11_popup(c) && client_surface(c)->mapped) {
|
||||||
overview_restore(c, &(Arg){.ui = target});
|
overview_restore(c, &(Arg){.ui = target});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1255,7 +1255,7 @@ void swallow(Client *c, Client *w) {
|
||||||
w->overview_scene_surface = NULL;
|
w->overview_scene_surface = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (c->mon && c->mon->isoverview) {
|
if (c->mon && c->mon->isoverview && config.ov_no_resize) {
|
||||||
overview_backup_surface(c);
|
overview_backup_surface(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue