fix: GTK window saydamlık (RGBA visual + #00000000)
Some checks failed
Build Windows / build-windows (push) Has been cancelled
Some checks failed
Build Windows / build-windows (push) Has been cancelled
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user