API: widget: Remove gtk_widget_is_composited()

We don't need to clutter our API with functions that are easily
available elsewhere and effectively unused.
This commit is contained in:
Benjamin Otte 2016-10-29 04:48:29 +02:00
parent d249e77bcb
commit 73cd739e19
5 changed files with 8 additions and 37 deletions

View File

@ -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

View File

@ -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.
</para>
</answer>

View File

@ -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 @widgets 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 windows opacity after the window has been
* shown causes it to flicker once on Windows.
*
* For child widgets it doesnt work if any affected widget has a native window, or
* disables double buffering.
* For child widgets it doesnt work if any affected widget has a native window.
*
* Since: 3.8
**/

View File

@ -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

View File

@ -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 */