Merge branch 'matthiasc/for-master' into 'master'

Matthiasc/for master

Closes #3226

See merge request GNOME/gtk!2739
This commit is contained in:
Matthias Clasen 2020-10-23 17:25:33 +00:00
commit 83fbdcd5e6
5 changed files with 18 additions and 11 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@ -251,8 +251,6 @@ gtk_drop_down_dispose (GObject *object)
{ {
GtkDropDown *self = GTK_DROP_DOWN (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->popup, gtk_widget_unparent);
g_clear_pointer (&self->button, gtk_widget_unparent); g_clear_pointer (&self->button, gtk_widget_unparent);
@ -596,19 +594,11 @@ set_default_factory (GtkDropDown *self)
static void static void
gtk_drop_down_init (GtkDropDown *self) gtk_drop_down_init (GtkDropDown *self)
{ {
GtkWidget *icon;
g_type_ensure (GTK_TYPE_BUILTIN_ICON); g_type_ensure (GTK_TYPE_BUILTIN_ICON);
g_type_ensure (GTK_TYPE_LIST_ITEM_WIDGET); g_type_ensure (GTK_TYPE_LIST_ITEM_WIDGET);
gtk_widget_init_template (GTK_WIDGET (self)); 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); set_default_factory (self);
} }

View File

@ -341,6 +341,9 @@ gtk_editable_label_dispose (GObject *object)
g_clear_pointer (&self->stack, gtk_widget_unparent); g_clear_pointer (&self->stack, gtk_widget_unparent);
self->entry = NULL;
self->label = NULL;
G_OBJECT_CLASS (gtk_editable_label_parent_class)->dispose (object); G_OBJECT_CLASS (gtk_editable_label_parent_class)->dispose (object);
} }

View File

@ -160,6 +160,8 @@ gtk_search_entry_finalize (GObject *object)
gtk_editable_finish_delegate (GTK_EDITABLE (entry)); 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->entry, gtk_widget_unparent);
g_clear_pointer (&entry->icon, gtk_widget_unparent); g_clear_pointer (&entry->icon, gtk_widget_unparent);
@ -549,8 +551,15 @@ activate_cb (GtkText *text,
static void static void
gtk_search_entry_init (GtkSearchEntry *entry) gtk_search_entry_init (GtkSearchEntry *entry)
{ {
GtkWidget *icon;
GtkGesture *press; 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 (); entry->entry = gtk_text_new ();
gtk_widget_set_parent (entry->entry, GTK_WIDGET (entry)); gtk_widget_set_parent (entry->entry, GTK_WIDGET (entry));
gtk_widget_set_hexpand (entry->entry, TRUE); gtk_widget_set_hexpand (entry->entry, TRUE);

View File

@ -4702,11 +4702,16 @@ surface_state_changed (GtkWidget *widget)
} }
if (changed_mask & GDK_TOPLEVEL_STATE_FULLSCREEN) 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) if (changed_mask & GDK_TOPLEVEL_STATE_MAXIMIZED)
{ {
priv->maximized = (new_surface_state & GDK_TOPLEVEL_STATE_MAXIMIZED) ? TRUE : FALSE; 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]); g_object_notify_by_pspec (G_OBJECT (widget), window_props[PROP_IS_MAXIMIZED]);
} }