since: 2.12

Declaration [src]

gdk_window_set_opacity (
  GdkWindow* window,
  gdouble opacity

Description [src]

Set window to render as partially transparent, with opacity 0 being fully transparent and 1 fully opaque. (Values of the opacity parameter are clamped to the [0,1] range.)

For toplevel windows this depends on support from the windowing system that may not always be there. For instance, On X11, this works only on X screens with a compositing manager running. On Wayland, there is no per-window opacity value that the compositor would apply. Instead, use gdk_window_set_opaque_region (window, NULL) to tell the compositor that the entire window is (potentially) non-opaque, and draw your content with alpha, or use gtk_widget_set_opacity() to set an overall opacity for your widgets.

For child windows this function only works for non-native windows.

For setting up per-pixel alpha topelevels, see gdk_screen_get_rgba_visual(), and for non-toplevels, see gdk_window_set_composited().

Support for non-toplevel windows was added in 3.8.

Available since: 2.12



Type: gdouble