[gtk+] API: widget: Remove gtk_widget_is_composited()
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] API: widget: Remove gtk_widget_is_composited()
- Date: Sat, 29 Oct 2016 03:01:47 +0000 (UTC)
commit 73cd739e19b4033f97922dd8b393ac37c041fb87
Author: Benjamin Otte <otte redhat com>
Date: Sat Oct 29 04:48:29 2016 +0200
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.
docs/reference/gtk/gtk4-sections.txt | 1 -
docs/reference/gtk/question_index.sgml | 2 +-
gtk/gtkwidget.c | 32 +++-----------------------------
gtk/gtkwidget.h | 4 ----
tests/testgtk.c | 6 ++++--
5 files changed, 8 insertions(+), 37 deletions(-)
---
diff --git a/docs/reference/gtk/gtk4-sections.txt b/docs/reference/gtk/gtk4-sections.txt
index 2284fc0..f76eb56 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 97f0b79..34e52d6 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.
</para>
</answer>
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index c3fa006..90df011 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -8844,31 +8844,6 @@ gtk_widget_propagate_screen_changed_recurse (GtkWidget *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
* @previous_screen: Previous screen
@@ -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 2046457..b1ab540 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 5fbf6c8..beabc0c 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 */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]