Skip to content

Commit

Permalink
bench: Don't call set_redraw_always
Browse files Browse the repository at this point in the history
This was causing flickering problems after configuring an output.
  • Loading branch information
soreau committed Oct 2, 2023
1 parent 64a7dba commit b4e414f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/bench.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ class wayfire_bench_screen : public wf::per_output_plugin_instance_t
{
output->render->add_effect(&pre_hook, wf::OUTPUT_EFFECT_PRE);
output->render->add_effect(&overlay_hook, wf::OUTPUT_EFFECT_OVERLAY);
output->render->set_redraw_always();

output->connect(&workarea_changed);
position.set_callback(position_changed);
Expand Down Expand Up @@ -231,7 +230,7 @@ class wayfire_bench_screen : public wf::per_output_plugin_instance_t
last_frame_times.begin(), last_frame_times.end(), 0.0);
average /= last_frame_times.size();

current_fps = 1000.0 / average;
current_fps = 1000 / average;

if (current_fps > max_fps)
{
Expand All @@ -246,7 +245,7 @@ class wayfire_bench_screen : public wf::per_output_plugin_instance_t
if (output->handle->current_mode)
{
fps_angle = max_angle + (current_fps /
((double)std::max(1, output->handle->current_mode->refresh) / 1000)) *
(output->handle->current_mode->refresh / 1000.0f)) *
(target_angle - max_angle);
} else
{
Expand Down Expand Up @@ -314,7 +313,6 @@ class wayfire_bench_screen : public wf::per_output_plugin_instance_t
void fini() override
{
timer.disconnect();
output->render->set_redraw_always(false);
output->render->rem_effect(&pre_hook);
output->render->rem_effect(&overlay_hook);
cairo_surface_destroy(cairo_surface);
Expand Down

0 comments on commit b4e414f

Please sign in to comment.