GNOME Bugzilla – Bug 756385
No more content in Anjuta project wizard
Last modified: 2015-11-23 18:55:48 UTC
The following change (6cc65260f4ba54ea0ca9f93068050435bd6b9f1a: GtkAssistant: Redo page margins) breaks Anjuta project wizard.
All content of the project wizard page is now missing.
See bug #756182
try with 3.18.2, please
(In reply to Matthias Clasen from comment #2)
> try with 3.18.2, please
It doesn't fix the issue but it's probably something similar. It looks like I'm not able to add some pages.
Where is the code that sets up the wizard ?
(In reply to Matthias Clasen from comment #4)
> Where is the code that sets up the wizard ?
It is in plugins/project-wizard/druid.c.
The "property" page are missing, it's a bit complex because the page are added dynamically. The next page is a dummy page. When we reach it, we check if there is a new page to display, if yes we add it afterward, switch to it an move the dummy page afterward. If it's the last page, we just add a summary page.
I think what anjuta does there falls into the unsupported category.
As far as I can make out, it pokes into the innards of one assistant to pick out pages and add them to another assistant ?!
(In reply to Matthias Clasen from comment #6)
> I think what anjuta does there falls into the unsupported category.
Then, is there a supported way to do that?
> As far as I can make out, it pokes into the innards of one assistant to pick
> out pages and add them to another assistant ?!
The assistant should have one project selection page at the beginning, one summary page at the end and in between a unknown number of property pages. So I have created a assistant with all needed pages and a single property page. When I need an additional page, as I cannot create just a page, I create a whole new assitant and get only the property page.
In my mind, it was a way to create a new page that is defined in a GtkBuilder file. Do you have another way to do that?
There's no need at all to pull the content for the new pages out of an existing wizard - just put the scrolledwindow or whatever is the topmost content widget into the .ui file as a freestanding object.
Please move the bug back if that is not working.
(In reply to Matthias Clasen from comment #9)
> Please move the bug back if that is not working.
I will try but I have not much time at the moment.
I have tried to move those pages as freestanding object and indeed it fixes the bug.
The drawback is that I cannot get the assistant page type anymore from the .ui file but it's not a big issue.
Another problem is that I move pages in the GtkAssistant, removing them and adding them later which trigger the same issue.
To summarize, I have fixed a part of the bug by moving the corresponding page content as freestanding object in the .ui file. So, I don't create anymore a dummy GtkAssistant object to steal some of its pages and add them to another GtkAssistant.
But, I have two pages (progress and error) that I can use at different steps of the GtkAssistant. In the code, I keep an additional reference to these pages. And to move such page, I remove it from the GtkAssistant and insert it at the new position.
This is not working anymore because when the new GtkBox object is removed from the GtkAssistant, all its children are destroyed. Previously, as I keep a reference on the page, the widget was removed without being destroyed. Now the new GtkBox has only a single reference so it is destroyed with all its children.
I think this is partially an issue in Gtk because now gtk_container_remove and gtk_assistant_remove_page not only remove but destroy the widget too. This could be avoided by adding a reference on the new GtkBox object but I don't see an easy way to do that.
I've added a test in testassistant which removes and re-adds pages - it seems to work fine. Maybe you can modify it to show the breakage you are seeing ?
Created attachment 314162 [details] [review]
Modify test failing
In Anjuta, I see that the problem comes from the fact that the assistant page is a container widget having its own children.
I have modified your test to add a GtkBox around the label on page 2. If I run the assistant without flipping the page everything is fine. If I flip the pages, the label of the page 2 doesn't appear any more.
Could you commit you patch https://git.gnome.org/browse/gtk+/commit/?id=32de7edf1dec5528b8d02cb765b2c76471f321c6 in the 3.18 branch too?
It solves all issues with the project wizard in Anjuta.
*** Bug 756182 has been marked as a duplicate of this bug. ***
Still an issue in Anjuta 3.18.2
(In reply to Muflone from comment #18)
> Still an issue in Anjuta 3.18.2
This is a bug in Gtk not in Anjuta so you need to Gtk for gtk-3-18 or master branch. It should be present in the next release of Gtk in the coming days.
*** Bug 757798 has been marked as a duplicate of this bug. ***
For now, I recommend using Gnome-Builder until the bug in Gnome is fixed.
Why hasn't the project website been updated since version 3.13? The url is: http://anjuta.org/
This is fixed in Gtk 3.18.3.
Great! I'll update my Fedora VM. I don't understand how this type of bug can go unnoticed during QA.