mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-26 14:45:58 +01:00
Merge pull request #1282 from RyanDwyer/fix-idle-frame
Prevent excessive frame events when compositor doesn't swap buffers
This commit is contained in:
commit
1280b4920d
1 changed files with 6 additions and 5 deletions
|
@ -472,10 +472,6 @@ bool wlr_output_swap_buffers(struct wlr_output *output, struct timespec *when,
|
||||||
wlr_log(WLR_ERROR, "Tried to swap buffers when a frame is pending");
|
wlr_log(WLR_ERROR, "Tried to swap buffers when a frame is pending");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (output->idle_frame != NULL) {
|
|
||||||
wl_event_source_remove(output->idle_frame);
|
|
||||||
output->idle_frame = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
int width, height;
|
int width, height;
|
||||||
wlr_output_transformed_resolution(output, &width, &height);
|
wlr_output_transformed_resolution(output, &width, &height);
|
||||||
|
@ -529,7 +525,6 @@ bool wlr_output_swap_buffers(struct wlr_output *output, struct timespec *when,
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
output->frame_pending = true;
|
|
||||||
output->needs_swap = false;
|
output->needs_swap = false;
|
||||||
pixman_region32_clear(&output->damage);
|
pixman_region32_clear(&output->damage);
|
||||||
|
|
||||||
|
@ -540,6 +535,12 @@ bool wlr_output_swap_buffers(struct wlr_output *output, struct timespec *when,
|
||||||
void wlr_output_send_frame(struct wlr_output *output) {
|
void wlr_output_send_frame(struct wlr_output *output) {
|
||||||
output->frame_pending = false;
|
output->frame_pending = false;
|
||||||
wlr_signal_emit_safe(&output->events.frame, output);
|
wlr_signal_emit_safe(&output->events.frame, output);
|
||||||
|
output->frame_pending = true;
|
||||||
|
|
||||||
|
if (output->idle_frame != NULL) {
|
||||||
|
wl_event_source_remove(output->idle_frame);
|
||||||
|
output->idle_frame = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void schedule_frame_handle_idle_timer(void *data) {
|
static void schedule_frame_handle_idle_timer(void *data) {
|
||||||
|
|
Loading…
Reference in a new issue