clutter/stage: Emit after-paint after painting

ClutterStage:after-paint is supposed to be emitted after all
painting is done, but before the frame is finished. However,
as it is right now, it is being emitted after each view is
painted -- on multi-monitor setups, after-frame is being
emitted multiple times.

Send after-paint only once, after all views are painted and
before finishing the frame.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/623
This commit is contained in:
Georges Basile Stavracas Neto 2019-06-17 19:16:47 -03:00
parent cc2c670a5e
commit 0cd54c5735
No known key found for this signature in database
GPG Key ID: 886C17EE170D1385
3 changed files with 8 additions and 0 deletions

View File

@ -40,6 +40,7 @@ void _clutter_stage_paint_view (ClutterStage
ClutterStageView *view,
const cairo_rectangle_int_t *clip);
void _clutter_stage_emit_after_paint (ClutterStage *stage);
void _clutter_stage_set_window (ClutterStage *stage,
ClutterStageWindow *stage_window);
ClutterStageWindow *_clutter_stage_get_window (ClutterStage *stage);

View File

@ -683,6 +683,11 @@ _clutter_stage_paint_view (ClutterStage *stage,
COGL_TRACE_BEGIN_SCOPED (ClutterStagePaintView, "Paint (view)");
clutter_stage_do_paint_view (stage, view, clip);
}
void
_clutter_stage_emit_after_paint (ClutterStage *stage)
{
g_signal_emit (stage, stage_signals[AFTER_PAINT], 0);
}

View File

@ -983,6 +983,8 @@ clutter_stage_cogl_redraw (ClutterStageWindow *stage_window)
clutter_stage_cogl_redraw_view (stage_window, view) || swap_event;
}
_clutter_stage_emit_after_paint (stage_cogl->wrapper);
_clutter_stage_window_finish_frame (stage_window);
if (swap_event)