mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-26 05:31:07 +00:00
Sync the window title initially
When setting a custom titlebar that happens to be a GtkHeaderBar, we connect to notify::title to pick up title changes on the headerbar, but we forgot to sync the title initially. Fix that.
This commit is contained in:
parent
f08df56211
commit
5918a4dae8
@ -3557,8 +3557,10 @@ on_titlebar_title_notify (GtkHeaderBar *titlebar,
|
||||
GParamSpec *pspec,
|
||||
GtkWindow *self)
|
||||
{
|
||||
gtk_window_set_title_internal (self, gtk_header_bar_get_title (titlebar),
|
||||
FALSE);
|
||||
const gchar *title;
|
||||
|
||||
title = gtk_header_bar_get_title (titlebar);
|
||||
gtk_window_set_title_internal (self, title, FALSE);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -3595,8 +3597,12 @@ gtk_window_set_titlebar (GtkWindow *window,
|
||||
|
||||
priv->title_box = titlebar;
|
||||
gtk_widget_set_parent (priv->title_box, widget);
|
||||
if (GTK_IS_HEADER_BAR (titlebar))
|
||||
{
|
||||
g_signal_connect (titlebar, "notify::title",
|
||||
G_CALLBACK (on_titlebar_title_notify), window);
|
||||
on_titlebar_title_notify (GTK_HEADER_BAR (titlebar), NULL, window);
|
||||
}
|
||||
|
||||
visual = gdk_screen_get_rgba_visual (gtk_widget_get_screen (widget));
|
||||
if (visual)
|
||||
|
Loading…
Reference in New Issue
Block a user