From b3d4d70bc1554595018503dc7e516cac953ebd90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Tyrychtr?= Date: Tue, 21 Mar 2023 11:48:19 +0100 Subject: [PATCH 1/2] GtkEditable: Document the usage restrictions of gtk_editable_delegate_get_accessible_platform_state The API is not always useful, because it depends on the position of the delegated to widget in the widget tree, so document that. --- gtk/gtkeditable.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gtk/gtkeditable.c b/gtk/gtkeditable.c index 242a5c8d8a..ebf198674c 100644 --- a/gtk/gtkeditable.c +++ b/gtk/gtkeditable.c @@ -1212,6 +1212,11 @@ gtk_editable_delegate_get_property (GObject *object, * } * ``` * + * Note that the widget which is the delegate *must* be a direct child of + * this widget, otherwise your implementation of [vfunc@Gtk.Accessible.get_platform_state] + * might not even be called, as the platform change will originate from + * the parent of the delegate, and, as a result, will not work properly. + * * Since: 4.10 */ gboolean From 02cdb364216065f64dd780ded1adc010552748a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Tyrychtr?= Date: Wed, 22 Mar 2023 11:05:52 +0100 Subject: [PATCH 2/2] Document what to do if the preconditions can not be met --- gtk/gtkeditable.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gtk/gtkeditable.c b/gtk/gtkeditable.c index ebf198674c..38b88b99e9 100644 --- a/gtk/gtkeditable.c +++ b/gtk/gtkeditable.c @@ -1217,6 +1217,10 @@ gtk_editable_delegate_get_property (GObject *object, * might not even be called, as the platform change will originate from * the parent of the delegate, and, as a result, will not work properly. * + * So, if you can't ensure the direct child condition, you should give the + * delegate the %GTK_ACCESSIBLE_ROLE_TEXT_BOX role, or you can + * change your tree to allow this function to work. + * * Since: 4.10 */ gboolean