gdl r519 - in trunk: . gdl
- From: sgranjoux svn gnome org
- To: svn-commits-list gnome org
- Subject: gdl r519 - in trunk: . gdl
- Date: Sun, 22 Feb 2009 21:09:02 +0000 (UTC)
Author: sgranjoux
Date: Sun Feb 22 21:09:02 2009
New Revision: 519
URL: http://svn.gnome.org/viewvc/gdl?rev=519&view=rev
Log:
* gdl/gdl-dock-item.c:
Fix #566801 â Docking+undocking all makes the buttons disappear and
crashes if you use "Reset dock layout"
Modified:
trunk/ChangeLog
trunk/gdl/gdl-dock-item.c
Modified: trunk/gdl/gdl-dock-item.c
==============================================================================
--- trunk/gdl/gdl-dock-item.c (original)
+++ trunk/gdl/gdl-dock-item.c Sun Feb 22 21:09:02 2009
@@ -1326,60 +1326,64 @@
if (parent)
gdl_dock_object_freeze (parent);
- /* ref ourselves since we could be destroyed when detached */
+
if (new_parent)
{
+ /* ref ourselves since we could be destroyed when detached */
g_object_ref (object);
GDL_DOCK_OBJECT_SET_FLAGS (object, GDL_DOCK_IN_REFLOW);
gdl_dock_object_detach (object, FALSE);
- }
- /* freeze the new parent, so reduce won't get called before it's
- actually added to our parent */
- gdl_dock_object_freeze (new_parent);
-
- /* bind the new parent to our master, so the following adds work */
- gdl_dock_object_bind (new_parent, G_OBJECT (GDL_DOCK_OBJECT_GET_MASTER (object)));
-
- /* add the objects */
- if (add_ourselves_first) {
- gtk_container_add (GTK_CONTAINER (new_parent), GTK_WIDGET (object));
- gtk_container_add (GTK_CONTAINER (new_parent), GTK_WIDGET (requestor));
- splitpos = available_space - pref_size;
- } else {
- gtk_container_add (GTK_CONTAINER (new_parent), GTK_WIDGET (requestor));
- gtk_container_add (GTK_CONTAINER (new_parent), GTK_WIDGET (object));
- splitpos = pref_size;
- }
+ /* freeze the new parent, so reduce won't get called before it's
+ actually added to our parent */
+ gdl_dock_object_freeze (new_parent);
+
+ /* bind the new parent to our master, so the following adds work */
+ gdl_dock_object_bind (new_parent, G_OBJECT (GDL_DOCK_OBJECT_GET_MASTER (object)));
+
+ /* add the objects */
+ if (add_ourselves_first) {
+ gtk_container_add (GTK_CONTAINER (new_parent), GTK_WIDGET (object));
+ gtk_container_add (GTK_CONTAINER (new_parent), GTK_WIDGET (requestor));
+ splitpos = available_space - pref_size;
+ } else {
+ gtk_container_add (GTK_CONTAINER (new_parent), GTK_WIDGET (requestor));
+ gtk_container_add (GTK_CONTAINER (new_parent), GTK_WIDGET (object));
+ splitpos = pref_size;
+ }
- /* add the new parent to the parent */
- if (parent)
- gtk_container_add (GTK_CONTAINER (parent), GTK_WIDGET (new_parent));
+ /* add the new parent to the parent */
+ if (parent)
+ gtk_container_add (GTK_CONTAINER (parent), GTK_WIDGET (new_parent));
- /* show automatic object */
- if (GTK_WIDGET_VISIBLE (object))
- {
- gtk_widget_show (GTK_WIDGET (new_parent));
- GDL_DOCK_OBJECT_UNSET_FLAGS (object, GDL_DOCK_IN_REFLOW);
+ /* show automatic object */
+ if (GTK_WIDGET_VISIBLE (object))
+ {
+ gtk_widget_show (GTK_WIDGET (new_parent));
+ GDL_DOCK_OBJECT_UNSET_FLAGS (object, GDL_DOCK_IN_REFLOW);
+ }
gdl_dock_object_thaw (new_parent);
+
+ /* use extra docking parameter */
+ if (position != GDL_DOCK_CENTER && other_data &&
+ G_VALUE_HOLDS (other_data, G_TYPE_UINT)) {
+
+ g_object_set (G_OBJECT (new_parent),
+ "position", g_value_get_uint (other_data),
+ NULL);
+ } else if (splitpos > 0 && splitpos < available_space) {
+ g_object_set (G_OBJECT (new_parent), "position", splitpos, NULL);
+ }
+
+ g_object_unref (object);
}
- else // If the parent is already a DockNotebook, we don't need
- // to create a new one.
+ else
+ {
+ /* If the parent is already a DockNotebook, we don't need
+ to create a new one. */
gtk_container_add (GTK_CONTAINER (parent), GTK_WIDGET (requestor));
-
- /* use extra docking parameter */
- if (position != GDL_DOCK_CENTER && other_data &&
- G_VALUE_HOLDS (other_data, G_TYPE_UINT)) {
-
- g_object_set (G_OBJECT (new_parent),
- "position", g_value_get_uint (other_data),
- NULL);
- } else if (splitpos > 0 && splitpos < available_space) {
- g_object_set (G_OBJECT (new_parent), "position", splitpos, NULL);
}
- g_object_unref (object);
-
requestor_parent = gdl_dock_object_get_parent_object (requestor);
if (GDL_IS_DOCK_NOTEBOOK (requestor_parent))
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]