mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-05-06 06:46:54 -04:00
opt: avoid layer re-enter output when cleanuping monitor
This commit is contained in:
parent
c27d043195
commit
e20600b0d3
1 changed files with 7 additions and 0 deletions
|
|
@ -535,6 +535,7 @@ struct Monitor {
|
|||
uint32_t visible_scroll_tiling_clients;
|
||||
char last_surface_ws_name[256];
|
||||
struct wlr_ext_workspace_group_handle_v1 *ext_group;
|
||||
bool iscleanuping;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
|
|
@ -1843,6 +1844,9 @@ void arrangelayers(Monitor *m) {
|
|||
if (!m->wlr_output->enabled)
|
||||
return;
|
||||
|
||||
if (m->iscleanuping)
|
||||
return;
|
||||
|
||||
/* Arrange exclusive surfaces from top->bottom */
|
||||
for (i = 3; i >= 0; i--)
|
||||
arrangelayer(m, &m->layers[i], &usable_area, 1);
|
||||
|
|
@ -2351,6 +2355,8 @@ void cleanupmon(struct wl_listener *listener, void *data) {
|
|||
LayerSurface *l = NULL, *tmp = NULL;
|
||||
uint32_t i;
|
||||
|
||||
m->iscleanuping = true;
|
||||
|
||||
/* m->layers[i] are intentionally not unlinked */
|
||||
for (i = 0; i < LENGTH(m->layers); i++) {
|
||||
wl_list_for_each_safe(l, tmp, &m->layers[i], link)
|
||||
|
|
@ -2991,6 +2997,7 @@ void createmon(struct wl_listener *listener, void *data) {
|
|||
struct wl_event_loop *loop = wl_display_get_event_loop(dpy);
|
||||
m = wlr_output->data = ecalloc(1, sizeof(*m));
|
||||
|
||||
m->iscleanuping = false;
|
||||
m->skip_frame_timeout =
|
||||
wl_event_loop_add_timer(loop, monitor_skip_frame_timeout_callback, m);
|
||||
m->skiping_frame = false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue