opt: ensure auto schedule next frame when animaiton not end

This commit is contained in:
DreamMaoMao 2026-01-04 07:18:04 +08:00
parent 2db71e02ba
commit 2957145b84
4 changed files with 35 additions and 10 deletions

View file

@ -765,6 +765,7 @@ static void refresh_monitors_workspaces_status(Monitor *m);
static void init_client_properties(Client *c);
static float *get_border_color(Client *c);
static void clear_fullscreen_and_maximized_state(Monitor *m);
static void request_fresh_all_monitors(void);
#include "data/static_keymap.h"
#include "dispatch/bind_declare.h"
@ -854,6 +855,7 @@ static double swipe_dy = 0;
bool render_border = true;
uint32_t chvt_backup_tag = 0;
bool allow_frame_scheduling = true;
char chvt_backup_selmon[32] = {0};
struct dvec2 *baked_points_move;
@ -4177,7 +4179,7 @@ void rendermon(struct wl_listener *listener, void *data) {
return;
}
if (!m->wlr_output->enabled)
if (!m->wlr_output->enabled || !allow_frame_scheduling)
return;
frame_allow_tearing = check_tearing_frame_allow(m);
@ -4198,11 +4200,6 @@ void rendermon(struct wl_listener *listener, void *data) {
need_more_frames = layer_draw_fadeout_frame(l) || need_more_frames;
}
// 如果需要更多帧,确保安排下一帧
if (need_more_frames) {
wlr_output_schedule_frame(m->wlr_output);
}
// 绘制客户端
wl_list_for_each(c, &clients, link) {
need_more_frames = client_draw_frame(c) || need_more_frames;
@ -4229,6 +4226,11 @@ skip:
wlr_scene_output_send_frame_done(m->scene_output, &now);
wlr_output_state_finish(&pending);
}
// 如果需要更多帧,确保安排下一帧
if (need_more_frames && allow_frame_scheduling) {
request_fresh_all_monitors();
}
}
void requestdecorationmode(struct wl_listener *listener, void *data) {