mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
visualizer-group: Fix insert()
sysprof_visualizer_group_insert() would insert widgets intended for position 0 at position 1 instead. This caused a bug in the marks section where the "Timings" row, which is supposed to be at the top, would instead be at position 1. Because the menu buttons are in the top row, disabling a row through the menu could cause the menu buttons to disappear.
This commit is contained in:
@ -392,11 +392,14 @@ sysprof_visualizer_group_insert (SysprofVisualizerGroup *self,
|
||||
g_return_if_fail (SYSPROF_IS_VISUALIZER_GROUP (self));
|
||||
g_return_if_fail (SYSPROF_IS_VISUALIZER (visualizer));
|
||||
|
||||
sibling = gtk_widget_get_first_child (GTK_WIDGET (priv->visualizers));
|
||||
while (position > 1 && sibling)
|
||||
if (position > 0)
|
||||
{
|
||||
sibling = gtk_widget_get_next_sibling (sibling);
|
||||
position--;
|
||||
sibling = gtk_widget_get_first_child (GTK_WIDGET (priv->visualizers));
|
||||
while (position > 1 && sibling)
|
||||
{
|
||||
sibling = gtk_widget_get_next_sibling (sibling);
|
||||
position--;
|
||||
}
|
||||
}
|
||||
gtk_box_insert_child_after (priv->visualizers, GTK_WIDGET (visualizer), sibling);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user