GNOME Bugzilla – Bug 569160
Anjuta doesn't remember main window layout
Last modified: 2012-07-17 20:46:09 UTC
Please describe the problem: Anjuta doesn't remember elements layout in main window. After restart it always return to default settings. Steps to reproduce: 1. Change elements layout in the main window 2. Select "Edit" -> "Lock items..." 3. Restart Anjuta After restart Anjuta will not remember my custom layout. Actual results: Expected results: Does this happen every time? Yes, always. Other information: Problem also occurred in line 2.24.x
Do you have a project open when you try this? Which parts of the layout are not remembered? Could you give more detailed instructions to reproduce (expected behaviour, actual result? Thanks!
Created attachment 137883 [details] Custom layout I change place of "Messages" box like in the picture.
Sorry, I forgot about this bug... So, when I start Anjuta "Messages" container is always placed like in the picture in attachment below. Each time I launch Anjuta I have to change layout (picture in attachment above). I cannot make Anjuta remember my layout. I tried to lock IDE layout checking "Edit"->"Lock items layout" menu option and by clicking "Lock" option in "Messages" container's context menu.
Created attachment 137885 [details] Ajuta layout at startup No matter what I do "messages" container starts in this position when I launch Anjuta.
Hmm, I know why this happens but I don't know how to fix it: * The message-manager plugin is not loaded until you first use it * The layout is loaded before the message-manager plugin becomes active. So the layout won't affect the message-manager at all and it comes back to it's default place. Maybe we need some way to query the last position from the layout...
I think the layout should save the position of each window and use the default position only when such position is not available. So, it know by example that AnjutaMessageView is on RIGHT bookmarks is on RIGHT ... Then when it needs to place a new windows it use the last position. I have thought that we can perhaps define the position of all windows, by having for each of them only a relative position (TOP, RIGHT, BOTTOM, LEFT) and a order number. You start placing the first window (relative position is useless for the first one) and continue with the remaining one in order. Window using the same space (using tab) have the same order number and position. Then, the "only" problem is to find this ordered list of windows with their relative position from a current layout when you need to save it. By example The layout of comment 4 is Document 0 Display 0 Inheritance 0 Message 1 BOTTOM File Manager 2 LEFT Symbol 2 LEFT Project 2 LEFT Help 2 LEFT The layout of comment 2 is Document 0 Display 0 Inheritance 0 Message 0 File Manager 1 LEFT Symbol 1 LEFT Project 1 LEFT Help 1 LEFT
That is something that probably needs to be added in gdl because I found nothing to query the position of a window in a layout. But it can probably be implemented on top of gdl-dock-layout.
Yes, I think it should be added in gdl. Perhaps we can look if inkscape or another fork has already implemented something like this.
Moving to gdl!
*** Bug 552662 has been marked as a duplicate of this bug. ***
I have just committed a patch that should fix this issue. It is completely different from my proposal above which is not really related to the real issue. It is a quite important change in the way GDL is working too. Now when a widget is closed, it is not removed from the widget hierarchy, it is only hidden, so it keeps its position. When the layout is saved the position of all these hidden widgets and their parents are saved. When the layout is loaded, all existing widget are moved to the saved position but in addition hidden empty widget are created for all unexisting named widget. If a widget with the same name is created later it will replace the existing hidden widget. So the layout will affect the position of the message view widget even if it is created later.