From f2195c1cd3989ddc042ce3d1c7ae6de4f95ca2af Mon Sep 17 00:00:00 2001 From: Sam Lakerveld Date: Tue, 23 Jul 2024 20:35:17 +0200 Subject: [PATCH] Set GLArea.has-alpha = true The additional change to glClearColor is to prevent a black flash when the application starts, before Flutter widgets become visible. --- shell/platform/linux/fl_renderer.cc | 2 +- shell/platform/linux/fl_view.cc | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/shell/platform/linux/fl_renderer.cc b/shell/platform/linux/fl_renderer.cc index 14ef47b591c8c..2962c2e8fd76b 100644 --- a/shell/platform/linux/fl_renderer.cc +++ b/shell/platform/linux/fl_renderer.cc @@ -431,7 +431,7 @@ void fl_renderer_render(FlRenderer* self, int width, int height) { g_return_if_fail(FL_IS_RENDERER(self)); - glClearColor(0.0, 0.0, 0.0, 1.0); + glClearColor(0.0, 0.0, 0.0, 0.0); glClear(GL_COLOR_BUFFER_BIT); if (priv->has_gl_framebuffer_blit) { diff --git a/shell/platform/linux/fl_view.cc b/shell/platform/linux/fl_view.cc index 003eb385b8909..477c204134245 100644 --- a/shell/platform/linux/fl_view.cc +++ b/shell/platform/linux/fl_view.cc @@ -802,6 +802,7 @@ static void fl_view_init(FlView* self) { self); self->gl_area = GTK_GL_AREA(gtk_gl_area_new()); + gtk_gl_area_set_has_alpha(self->gl_area, TRUE); gtk_widget_show(GTK_WIDGET(self->gl_area)); gtk_container_add(GTK_CONTAINER(self->event_box), GTK_WIDGET(self->gl_area));