diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-10-05 13:56:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-05 13:56:42 +0200 |
commit | 4e89a2139749c996d0c3ef6da5042d0a3cd9c9e6 (patch) | |
tree | 6fbd71fd0fe6f06183a7ee94b03727f69341328b | |
parent | 1280b4920d311e311e339a6f13b004bac6bc668f (diff) | |
parent | 1e70b4cea23a0335495daa14112b057b3a22d979 (diff) |
Merge pull request #1283 from swaywm/revert-1282-fix-idle-frame
Revert "Prevent excessive frame events when compositor doesn't swap buffers"
-rw-r--r-- | types/wlr_output.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/types/wlr_output.c b/types/wlr_output.c index c407ca0b..b3840415 100644 --- a/types/wlr_output.c +++ b/types/wlr_output.c @@ -472,6 +472,10 @@ 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"); return false; } + if (output->idle_frame != NULL) { + wl_event_source_remove(output->idle_frame); + output->idle_frame = NULL; + } int width, height; wlr_output_transformed_resolution(output, &width, &height); @@ -525,6 +529,7 @@ bool wlr_output_swap_buffers(struct wlr_output *output, struct timespec *when, return false; } + output->frame_pending = true; output->needs_swap = false; pixman_region32_clear(&output->damage); @@ -535,12 +540,6 @@ bool wlr_output_swap_buffers(struct wlr_output *output, struct timespec *when, void wlr_output_send_frame(struct wlr_output *output) { output->frame_pending = false; 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) { |