Merge branch 'main' into feature/dual-row-scroller-clean
This commit is contained in:
92
src/mango.c
92
src/mango.c
@@ -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]))
|
||||
@@ -315,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;
|
||||
@@ -1011,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;
|
||||
@@ -1031,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);
|
||||
@@ -1378,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);
|
||||
@@ -1559,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)
|
||||
@@ -1572,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;
|
||||
}
|
||||
}
|
||||
@@ -1884,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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2217,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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3032,7 +3039,9 @@ void destroylock(SessionLock *lock, int unlock) {
|
||||
if ((locked = !unlock))
|
||||
goto destroy;
|
||||
|
||||
wlr_scene_node_set_enabled(&locked_bg->node, false);
|
||||
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);
|
||||
@@ -3570,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;
|
||||
wlr_scene_node_set_enabled(&locked_bg->node, true);
|
||||
if (!allow_lock_transparent) {
|
||||
wlr_scene_node_set_enabled(&locked_bg->node, true);
|
||||
}
|
||||
if (cur_lock) {
|
||||
wlr_session_lock_v1_destroy(session_lock);
|
||||
return;
|
||||
@@ -3625,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;
|
||||
@@ -3800,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;
|
||||
@@ -3808,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;
|
||||
@@ -3828,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);
|
||||
@@ -3843,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);
|
||||
}
|
||||
@@ -4556,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) {
|
||||
@@ -4565,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;
|
||||
@@ -4612,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) {
|
||||
@@ -4625,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); // 将视图提升到顶层
|
||||
@@ -4842,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);
|
||||
@@ -5331,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);
|
||||
|
||||
@@ -5742,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;
|
||||
|
||||
Reference in New Issue
Block a user