Commit 94fd2956 authored by Johannes Schmid's avatar Johannes Schmid
Browse files

Set name for floating windows correctly.

This was broken due to a side-effect of setting "long-name" as construct property for
GdlDockObject.
parent 3ce71d38
...@@ -458,7 +458,6 @@ gdl_dock_set_title (GdlDock *dock) ...@@ -458,7 +458,6 @@ gdl_dock_set_title (GdlDock *dock)
{ {
GdlDockObject *object = GDL_DOCK_OBJECT (dock); GdlDockObject *object = GDL_DOCK_OBJECT (dock);
gchar *title = NULL; gchar *title = NULL;
gboolean free_title = FALSE;
if (!dock->_priv->window) if (!dock->_priv->window)
return; return;
...@@ -468,25 +467,22 @@ gdl_dock_set_title (GdlDock *dock) ...@@ -468,25 +467,22 @@ gdl_dock_set_title (GdlDock *dock)
} }
else if (object->master) { else if (object->master) {
g_object_get (object->master, "default-title", &title, NULL); g_object_get (object->master, "default-title", &title, NULL);
free_title = TRUE;
} }
if (!title && dock->root) { if (!title && dock->root) {
g_object_get (dock->root, "long-name", &title, NULL); g_object_get (dock->root, "long-name", &title, NULL);
free_title = TRUE;
} }
if (!title) { if (!title) {
/* set a default title in the long_name */ /* set a default title in the long_name */
dock->_priv->auto_title = TRUE; dock->_priv->auto_title = TRUE;
free_title = FALSE; title = g_strdup_printf (
title = object->long_name = g_strdup_printf (
_("Dock #%d"), GDL_DOCK_MASTER (object->master)->dock_number++); _("Dock #%d"), GDL_DOCK_MASTER (object->master)->dock_number++);
} }
gtk_window_set_title (GTK_WINDOW (dock->_priv->window), title); gtk_window_set_title (GTK_WINDOW (dock->_priv->window), title);
if (free_title)
g_free (title); g_free (title);
} }
static void static void
...@@ -495,12 +491,21 @@ gdl_dock_notify_cb (GObject *object, ...@@ -495,12 +491,21 @@ gdl_dock_notify_cb (GObject *object,
gpointer user_data) gpointer user_data)
{ {
GdlDock *dock; GdlDock *dock;
gchar* long_name;
g_return_if_fail (object != NULL || GDL_IS_DOCK (object)); g_return_if_fail (object != NULL || GDL_IS_DOCK (object));
dock = GDL_DOCK (object); g_object_get (object, "long-name", &long_name, NULL);
dock->_priv->auto_title = FALSE;
gdl_dock_set_title (dock); g_message ("Notify long_name: %s", long_name);
if (long_name)
{
dock = GDL_DOCK (object);
dock->_priv->auto_title = FALSE;
gdl_dock_set_title (dock);
}
g_free (long_name);
} }
static void static void
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment