From 10d7ccc8e0ecfc267b8e3f803abb6bd04eb628a9 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 23 Oct 2020 11:51:02 -0400 Subject: [PATCH 1/3] window: Fix state updates When the compositor unmaximized the window, we get a state-changed signal, and we update the maximized field. But then we go and recompute our layout based on the maximize_initially field, and that is still TRUE, when we were maximized initially. So we need to update both fields. This fixes a problem where using the window menu to unmaximize an initially maximized window would not work. Fixes: #3226 --- gtk/gtkwindow.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index 3f59e4e02c..feec52aa22 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -4702,11 +4702,16 @@ surface_state_changed (GtkWidget *widget) } if (changed_mask & GDK_TOPLEVEL_STATE_FULLSCREEN) - priv->fullscreen = (new_surface_state & GDK_TOPLEVEL_STATE_FULLSCREEN) ? TRUE : FALSE; + { + priv->fullscreen = (new_surface_state & GDK_TOPLEVEL_STATE_FULLSCREEN) ? TRUE : FALSE; + priv->fullscreen_initially = priv->fullscreen; + } if (changed_mask & GDK_TOPLEVEL_STATE_MAXIMIZED) { priv->maximized = (new_surface_state & GDK_TOPLEVEL_STATE_MAXIMIZED) ? TRUE : FALSE; + priv->maximize_initially = priv->maximized; + g_object_notify_by_pspec (G_OBJECT (widget), window_props[PROP_IS_MAXIMIZED]); } From fdb1fa4d089359951c34212008e876bd91e6c0bc Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 23 Oct 2020 12:19:31 -0400 Subject: [PATCH 2/3] Give all search entries an icon This was first requested for the search entry in GtkDropDown, but it is better to be consistent and give every search entry an icon. Related: #3291 --- docs/reference/gtk/images/search-entry.png | Bin 2418 -> 2990 bytes gtk/gtkdropdown.c | 10 ---------- gtk/gtksearchentry.c | 9 +++++++++ 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/docs/reference/gtk/images/search-entry.png b/docs/reference/gtk/images/search-ent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zb{f^7L$XDe2)v^W;h>wY6kCMtAi0u4a^Kz!rkHH{#=;ikm}x12|B(OY?qBp38z7+1f_OS!pbQhVXbob%y7SfQ40y{mFdOP zP0%*Z{2CaM;yU${+gyU`&4_^$MsfnsS~}7hgBomlwFqs z%gkS10RkD~$8(~r*u>jTxVca`M&6B_;()&* zq7iyPXy?~ibQsMO6K@C%vY@_-&1<$n$=-&e8c)>|uy-I&%|6;z^Yz+ai#WGP`C5~c z*#@y_sy+~SU=PsXR}ze1O+aI5ig^iAU&hVq9ml)t3ImgK xDRa@0)mo9x9+Mbr`cIclkm4ht`S##3&*5412nxg;! diff --git a/gtk/gtkdropdown.c b/gtk/gtkdropdown.c index d33f1e9524..80dc7a1ae6 100644 --- a/gtk/gtkdropdown.c +++ b/gtk/gtkdropdown.c @@ -251,8 +251,6 @@ gtk_drop_down_dispose (GObject *object) { GtkDropDown *self = GTK_DROP_DOWN (object); - gtk_widget_unparent (gtk_widget_get_first_child (self->search_entry)); - g_clear_pointer (&self->popup, gtk_widget_unparent); g_clear_pointer (&self->button, gtk_widget_unparent); @@ -596,19 +594,11 @@ set_default_factory (GtkDropDown *self) static void gtk_drop_down_init (GtkDropDown *self) { - GtkWidget *icon; - g_type_ensure (GTK_TYPE_BUILTIN_ICON); g_type_ensure (GTK_TYPE_LIST_ITEM_WIDGET); gtk_widget_init_template (GTK_WIDGET (self)); - icon = g_object_new (GTK_TYPE_IMAGE, - "accessible-role", GTK_ACCESSIBLE_ROLE_NONE, - "icon-name", "system-search-symbolic", - NULL); - gtk_widget_insert_after (icon, self->search_entry, NULL); - set_default_factory (self); } diff --git a/gtk/gtksearchentry.c b/gtk/gtksearchentry.c index 78268113c8..5c227f6853 100644 --- a/gtk/gtksearchentry.c +++ b/gtk/gtksearchentry.c @@ -160,6 +160,8 @@ gtk_search_entry_finalize (GObject *object) gtk_editable_finish_delegate (GTK_EDITABLE (entry)); + gtk_widget_unparent (gtk_widget_get_first_child (GTK_WIDGET (entry))); + g_clear_pointer (&entry->entry, gtk_widget_unparent); g_clear_pointer (&entry->icon, gtk_widget_unparent); @@ -549,8 +551,15 @@ activate_cb (GtkText *text, static void gtk_search_entry_init (GtkSearchEntry *entry) { + GtkWidget *icon; GtkGesture *press; + icon = g_object_new (GTK_TYPE_IMAGE, + "accessible-role", GTK_ACCESSIBLE_ROLE_NONE, + "icon-name", "system-search-symbolic", + NULL); + gtk_widget_set_parent (icon, GTK_WIDGET (entry)); + entry->entry = gtk_text_new (); gtk_widget_set_parent (entry->entry, GTK_WIDGET (entry)); gtk_widget_set_hexpand (entry->entry, TRUE); From cb8bf6540ce5541aa236b7ab2f4158cf55d7fae9 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 23 Oct 2020 12:27:55 -0400 Subject: [PATCH 3/3] editablelabel: Properly clean up in dispose Unparenting the stack finalizes the entry and label, but at least the label is available via the gtk_editable_get_delegate API, and the a11y implementation uses that at dispose time. So, clear the pointers to prevent them from being dangling. This was showing up as a segfault of the doc-shooter. --- gtk/gtkeditablelabel.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gtk/gtkeditablelabel.c b/gtk/gtkeditablelabel.c index 959d0428d8..103b125649 100644 --- a/gtk/gtkeditablelabel.c +++ b/gtk/gtkeditablelabel.c @@ -341,6 +341,9 @@ gtk_editable_label_dispose (GObject *object) g_clear_pointer (&self->stack, gtk_widget_unparent); + self->entry = NULL; + self->label = NULL; + G_OBJECT_CLASS (gtk_editable_label_parent_class)->dispose (object); }