summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--eel/eel-canvas.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/eel/eel-canvas.c b/eel/eel-canvas.c
index d88aeecb..97a6a2f0 100644
--- a/eel/eel-canvas.c
+++ b/eel/eel-canvas.c
@@ -557,6 +557,13 @@ eel_canvas_item_move (EelCanvasItem *item, double dx, double dy)
}
+static void
+eel_canvas_queue_resize (EelCanvas *canvas)
+{
+ if (gtk_widget_is_drawable (GTK_WIDGET (canvas)))
+ gtk_widget_queue_resize (GTK_WIDGET (canvas));
+}
+
/* Convenience function to reorder items in a group's child list. This puts the
* specified link after the "before" link. Returns TRUE if the list was changed.
*/
@@ -830,6 +837,7 @@ eel_canvas_item_show (EelCanvasItem *item)
}
redraw_and_repick_if_mapped (item);
+ eel_canvas_queue_resize (item->canvas);
}
}
@@ -855,6 +863,8 @@ eel_canvas_item_hide (EelCanvasItem *item)
if (item->flags & EEL_CANVAS_ITEM_MAPPED)
(* EEL_CANVAS_ITEM_GET_CLASS (item)->unmap) (item);
+ eel_canvas_queue_resize (item->canvas);
+
/* No need to unrealize when we just want to hide */
}
}
@@ -1832,6 +1842,9 @@ group_add (EelCanvasGroup *group, EelCanvasItem *item)
if (!(item->flags & EEL_CANVAS_ITEM_MAPPED))
(* EEL_CANVAS_ITEM_GET_CLASS (item)->map) (item);
}
+
+ if (item->flags & EEL_CANVAS_ITEM_VISIBLE)
+ eel_canvas_queue_resize (EEL_CANVAS_ITEM (group)->canvas);
}
/* Removes an item from a group */
@@ -1846,12 +1859,16 @@ group_remove (EelCanvasGroup *group, EelCanvasItem *item)
for (children = group->item_list; children; children = children->next)
if (children->data == item)
{
- if (item->flags & EEL_CANVAS_ITEM_MAPPED)
+ if (item->flags & EEL_CANVAS_ITEM_MAPPED) {
(* EEL_CANVAS_ITEM_GET_CLASS (item)->unmap) (item);
+ }
if (item->flags & EEL_CANVAS_ITEM_REALIZED)
(* EEL_CANVAS_ITEM_GET_CLASS (item)->unrealize) (item);
+ if (item->flags & EEL_CANVAS_ITEM_VISIBLE)
+ eel_canvas_queue_resize (item->canvas);
+
/* Unparent the child */
item->parent = NULL;