fix: GTK window saydamlık (RGBA visual + #00000000)
Build Windows / build-windows (push) Has been cancelled
Build Windows / build-windows (push) Has been cancelled
This commit is contained in:
1 parent
181b063329
commit
747e02827c
3 files changed
+15
-1
No files matched your search
Binary file not shown.
Binary file not shown.
@@ -62,9 +62,23 @@ static void my_application_activate(GApplication* application) {
|
|||||||
GdkRGBA background_color;
|
GdkRGBA background_color;
|
||||||
// Background defaults to black, override it here if necessary, e.g. #00000000
|
// Background defaults to black, override it here if necessary, e.g. #00000000
|
||||||
// for transparent.
|
// for transparent.
|
||||||
gdk_rgba_parse(&background_color, "#000000");
|
gdk_rgba_parse(&background_color, "#00000000");
|
||||||
fl_view_set_background_color(view, &background_color);
|
fl_view_set_background_color(view, &background_color);
|
||||||
gtk_widget_show(GTK_WIDGET(view));
|
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));
|
gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view));
|
||||||
|
|
||||||
// Show the window when Flutter renders.
|
// Show the window when Flutter renders.
|
||||||
|
|||||||
Reference in new issue
Block a user