fix: GTK window saydamlık (RGBA visual + #00000000)
Some checks failed
Build Windows / build-windows (push) Has been cancelled

This commit is contained in:
Alhan
2026-07-22 04:56:41 +03:00
parent 181b063329
commit 747e02827c
3 changed files with 15 additions and 1 deletions

Binary file not shown.

Binary file not shown.

View File

@@ -62,9 +62,23 @@ static void my_application_activate(GApplication* application) {
GdkRGBA background_color;
// Background defaults to black, override it here if necessary, e.g. #00000000
// for transparent.
gdk_rgba_parse(&background_color, "#000000");
gdk_rgba_parse(&background_color, "#00000000");
fl_view_set_background_color(view, &background_color);
gtk_widget_show(GTK_WIDGET(view));
// Enable alpha channel for transparency on X11
#ifdef GDK_WINDOWING_X11
{
GdkScreen* scr = gtk_window_get_screen(window);
if (GDK_IS_X11_SCREEN(scr)) {
GdkVisual* visual = gdk_screen_get_rgba_visual(scr);
if (visual != nullptr) {
gtk_widget_set_visual(GTK_WIDGET(window), visual);
}
}
}
#endif
gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view));
// Show the window when Flutter renders.