opt: optimize minimize state set
This commit is contained in:
@@ -93,6 +93,8 @@ static inline void client_activate_surface(struct wlr_surface *s,
|
|||||||
#ifdef XWAYLAND
|
#ifdef XWAYLAND
|
||||||
struct wlr_xwayland_surface *xsurface;
|
struct wlr_xwayland_surface *xsurface;
|
||||||
if ((xsurface = wlr_xwayland_surface_try_from_wlr_surface(s))) {
|
if ((xsurface = wlr_xwayland_surface_try_from_wlr_surface(s))) {
|
||||||
|
if (activated && xsurface->minimized)
|
||||||
|
wlr_xwayland_surface_set_minimized(xsurface, false);
|
||||||
wlr_xwayland_surface_activate(xsurface, activated);
|
wlr_xwayland_surface_activate(xsurface, activated);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3450,7 +3450,6 @@ void set_minized(Client *c) {
|
|||||||
wlr_foreign_toplevel_handle_v1_set_minimized(c->foreign_toplevel, true);
|
wlr_foreign_toplevel_handle_v1_set_minimized(c->foreign_toplevel, true);
|
||||||
wl_list_remove(&c->link); // 从原来位置移除
|
wl_list_remove(&c->link); // 从原来位置移除
|
||||||
wl_list_insert(clients.prev, &c->link); // 插入尾部
|
wl_list_insert(clients.prev, &c->link); // 插入尾部
|
||||||
client_set_minimized(c, true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void // 0.5 custom
|
void // 0.5 custom
|
||||||
@@ -3474,8 +3473,12 @@ minimizenotify(struct wl_listener *listener, void *data) {
|
|||||||
if (!c || !c->mon || c->iskilling || c->isminied)
|
if (!c || !c->mon || c->iskilling || c->isminied)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!c->ignore_minimize && client_request_minimize(c, data)) {
|
if (client_request_minimize(c, data)) {
|
||||||
|
if (!c->ignore_minimize)
|
||||||
set_minized(c);
|
set_minized(c);
|
||||||
|
client_set_minimized(c, true);
|
||||||
|
} else {
|
||||||
|
client_set_minimized(c, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4340,7 +4343,6 @@ void show_hide_client(Client *c) {
|
|||||||
tag_client(&(Arg){.ui = target}, c);
|
tag_client(&(Arg){.ui = target}, c);
|
||||||
// c->tags = c->oldtags;
|
// c->tags = c->oldtags;
|
||||||
c->isminied = 0;
|
c->isminied = 0;
|
||||||
client_set_minimized(c, false);
|
|
||||||
wlr_foreign_toplevel_handle_v1_set_minimized(c->foreign_toplevel, false);
|
wlr_foreign_toplevel_handle_v1_set_minimized(c->foreign_toplevel, false);
|
||||||
focusclient(c, 1);
|
focusclient(c, 1);
|
||||||
wlr_foreign_toplevel_handle_v1_set_activated(c->foreign_toplevel, true);
|
wlr_foreign_toplevel_handle_v1_set_activated(c->foreign_toplevel, true);
|
||||||
|
|||||||
Reference in New Issue
Block a user