summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Berg <bberg@redhat.com>2018-08-02 11:26:34 +0200
committerBenjamin Berg <bberg@redhat.com>2018-08-03 14:43:47 +0200
commit57578e1331c505f6f9be0fcf83e7edf9515061da (patch)
tree313f615b32e3a07bc135ec1ea84a7cbb9a99918a
parentb51af0fc58bbd8ea6e04e4bc7fa0b897f3f3ca83 (diff)
downloadgnome-control-center-benzea/window-title-fix.tar.gz
display: Reset the window title after removing custom headerbarbenzea/window-title-fix
As the main headerbar used by the shell is split, the title is not propagated to the window. However, the "apply" header bar is not split and the title is propagated to the toplevel GtkWindow. Fix this issue by resetting the window title again. Fixes https://gitlab.gnome.org/GNOME/gnome-control-center/issues/81
-rw-r--r--panels/display/cc-display-panel.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/panels/display/cc-display-panel.c b/panels/display/cc-display-panel.c
index ecb881dde..c58472c0f 100644
--- a/panels/display/cc-display-panel.c
+++ b/panels/display/cc-display-panel.c
@@ -78,6 +78,7 @@ struct _CcDisplayPanel
GDBusProxy *iio_sensor_proxy;
gboolean has_accelerometer;
+ gchar *main_title;
GtkWidget *main_titlebar;
GtkWidget *apply_titlebar;
GtkWidget *apply_titlebar_apply;
@@ -210,6 +211,10 @@ reset_titlebar (CcDisplayPanel *self)
{
gtk_window_set_titlebar (GTK_WINDOW (toplevel), self->main_titlebar);
g_clear_object (&self->main_titlebar);
+
+ /* The split header bar will not reset the window title, so do that here. */
+ gtk_window_set_title (GTK_WINDOW (toplevel), self->main_title);
+ g_clear_pointer (&self->main_title, g_free);
}
g_clear_object (&self->apply_titlebar);
@@ -1916,6 +1921,7 @@ show_apply_titlebar (CcDisplayPanel *panel, gboolean is_applicable)
header = gtk_window_get_titlebar (GTK_WINDOW (toplevel));
if (header)
panel->main_titlebar = g_object_ref (header);
+ panel->main_title = g_strdup (gtk_window_get_title (GTK_WINDOW (toplevel)));
gtk_window_set_titlebar (GTK_WINDOW (toplevel), panel->apply_titlebar);
g_object_ref (panel->apply_titlebar);