diff --git a/docs/reference/gtk/gtk4-sections.txt b/docs/reference/gtk/gtk4-sections.txt index 2284fc00b1..f76eb567ab 100644 --- a/docs/reference/gtk/gtk4-sections.txt +++ b/docs/reference/gtk/gtk4-sections.txt @@ -4739,7 +4739,6 @@ gtk_widget_get_no_show_all gtk_widget_list_mnemonic_labels gtk_widget_add_mnemonic_label gtk_widget_remove_mnemonic_label -gtk_widget_is_composited gtk_widget_error_bell gtk_widget_keynav_failed gtk_widget_get_tooltip_markup diff --git a/docs/reference/gtk/question_index.sgml b/docs/reference/gtk/question_index.sgml index 97f0b79948..34e52d6479 100644 --- a/docs/reference/gtk/question_index.sgml +++ b/docs/reference/gtk/question_index.sgml @@ -570,7 +570,7 @@ RGBA drawing capabilities. Note that the presence of an RGBA visual is no guarantee that the window will actually appear transparent on screen. On X11, this requires a compositing manager to be running. See -gtk_widget_is_composited() for a way to find out if the alpha +gdk_display_is_composited() for a way to find out if the alpha channel will be respected. diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index c3fa0067a7..90df011290 100644 --- a/gtk/gtkwidget.c +++ b/gtk/gtkwidget.c @@ -8843,31 +8843,6 @@ gtk_widget_propagate_screen_changed_recurse (GtkWidget *widget, g_object_unref (widget); } -/** - * gtk_widget_is_composited: - * @widget: a #GtkWidget - * - * Whether @widget can rely on having its alpha channel - * drawn correctly. On X11 this function returns whether a - * compositing manager is running for @widget’s display. - * - * Returns: %TRUE if the widget can rely on its alpha - * channel being drawn correctly. - * - * Since: 2.10 - */ -gboolean -gtk_widget_is_composited (GtkWidget *widget) -{ - GdkDisplay *display; - - g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE); - - display = gtk_widget_get_display (widget); - - return gdk_display_is_composited (display); -} - /** * _gtk_widget_propagate_screen_changed: * @widget: a #GtkWidget @@ -14395,13 +14370,12 @@ gtk_widget_update_alpha (GtkWidget *widget) * are some limitations: * * For toplevel widgets this depends on the capabilities of the windowing - * system. On X11 this has any effect only on X screens with a compositing manager - * running. See gtk_widget_is_composited(). On Windows it should work + * system. On X11 this has any effect only on X displays with a compositing manager + * running. See gdk_display_is_composited(). On Windows it should work * always, although setting a window’s opacity after the window has been * shown causes it to flicker once on Windows. * - * For child widgets it doesn’t work if any affected widget has a native window, or - * disables double buffering. + * For child widgets it doesn’t work if any affected widget has a native window. * * Since: 3.8 **/ diff --git a/gtk/gtkwidget.h b/gtk/gtkwidget.h index 20464576eb..b1ab5409a0 100644 --- a/gtk/gtkwidget.h +++ b/gtk/gtkwidget.h @@ -1109,10 +1109,6 @@ void gtk_widget_set_default_direction (GtkTextDirection dir); GDK_AVAILABLE_IN_ALL GtkTextDirection gtk_widget_get_default_direction (void); -/* Compositing manager functionality */ -GDK_AVAILABLE_IN_ALL -gboolean gtk_widget_is_composited (GtkWidget *widget); - /* Counterpart to gdk_window_shape_combine_region. */ GDK_AVAILABLE_IN_ALL diff --git a/tests/testgtk.c b/tests/testgtk.c index 5fbf6c8650..beabc0c084 100644 --- a/tests/testgtk.c +++ b/tests/testgtk.c @@ -128,6 +128,7 @@ on_alpha_window_draw (GtkWidget *widget, { cairo_pattern_t *pattern; int radius, width, height; + GdkDisplay *display; /* Get the child allocation to avoid painting over the borders */ GtkWidget *child = gtk_bin_get_child (GTK_BIN (widget)); @@ -150,8 +151,9 @@ on_alpha_window_draw (GtkWidget *widget, height / 2, radius * 1.33); - if (gdk_screen_get_rgba_visual (gtk_widget_get_screen (widget)) && - gtk_widget_is_composited (widget)) + display = gtk_widget_get_display (widget); + if (gdk_display_is_rgba (display) && + gdk_display_is_composited (display)) cairo_set_source_rgba (cr, 1.0, 1.0, 1.0, 0.0); /* transparent */ else cairo_set_source_rgb (cr, 1.0, 1.0, 1.0); /* opaque white */