[i3] i3 save/restore bug

2014-09-16 Thread Sargrad, Dave
I've found a bug with the i3 save/restore mechanism

In general the save/load works fine (I've tried a number of layouts that work 
fine), however I have found a simple configuration that fails to save/load 
correctly. I'm not sure yet if this is a problem with i3, or with i3-save-tree.

I opened three windows in a workspace (and then saved using i3-save-tree 
--workspace test  /home/ubuntu/.i3/spec)
2 xterms side-by-side in top row
1 emacs in bottom row (I used the mod-shift-k to move emacs down)


Correct Layout (the layout I saved with i3-save-tree)
_
||   |
||   |
||   |
|  xterm | xterm |
||   |
||   |
||   |
||   |
-
||
||
||
|  emacs |
||
||
||
||
_

I then appended using i3-msg (i3-msg workspace new; append_layout 
/home/ubuntu/.i3/spec
After Append Layout (Incorrect Result)
_
|| | |
|| | |
|| | |
| xterm  | xterm   |   emacs |
|| | |
|| | |
|| | |
|| | |
|| | |
|| | |
|| | |
_



This is the spec generated by i3-save-tree:


// vim:ts=4:sw=4:et
{
// splith split container with 2 children
border: normal,
floating: auto_off,
layout: splith,
percent: 0.232604373757455,
type: con,
nodes: [
{
border: normal,
floating: auto_off,
geometry: {
   height: 316,
   width: 484,
   x: 0,
   y: 0
},
name: ubuntu@sensis-8930: ~,
percent: 0.5,
swallows: [
   {
   class: ^XTerm$
   }
],
type: con
},
{
border: normal,
floating: auto_off,
geometry: {
   height: 316,
   width: 484,
   x: 0,
   y: 0
},
name: ubuntu@sensis-8930: ~,
percent: 0.5,
swallows: [
   {
   class: ^XTerm$
   }
],
type: con
}
]
}

{
border: normal,
floating: auto_off,
geometry: {
   height: 550,
   width: 602,
   x: 0,
   y: 0
},
name: em...@example.com,
percent: 0.767395626242545,
swallows: [
   {
   class: ^Emacs23$
   }
],
type: con
}
-
This message is intended only for the addressee and may contain information 
that is company confidential or privileged.  Any technical data in this message 
may be exported only in accordance with the U.S. International Traffic in Arms 
Regulations (22 CFR Parts 120-130) or the Export Administration Regulations (15 
CFR Parts 730-774). Unauthorized use is strictly prohibited and may be 
unlawful. If you are not the intended recipient, or the person responsible for 
delivering to the intended recipient, you should not read, copy, disclose or 
otherwise use this message. If you have received this email in error, please 
delete it, and advise the sender immediately. 
-  

Re: [i3] i3 save/restore bug

2014-09-16 Thread Michael Stapelberg
This is a duplicate of http://bugs.i3wm.org/report/ticket/1297

On Tue, Sep 16, 2014 at 5:49 PM, Sargrad, Dave
dave.sarg...@saabsensis.com wrote:
 Ok. I've dug further, and am sure that this is a problem with i3-save-tree.

 The containing workspace (container type = workspace) has some critical 
 information that is stripped away by i3-save-tree. Specifically the workspace 
 container structure (including the splitv layout) is lost as part of the 
 pruning process.

 I can provide the entire tree associated with the workspace if that would 
 help. But I think perhaps I've given enough detail to understand the issue.

 Please let me know if I should provide additional diagnostics.


 -Original Message-
 From: Sargrad, Dave
 Sent: Tuesday, September 16, 2014 11:09 AM
 To: i3-discuss@i3.zekjur.net
 Subject: i3 save/restore bug

 I've found a bug with the i3 save/restore mechanism

 In general the save/load works fine (I've tried a number of layouts that work 
 fine), however I have found a simple configuration that fails to save/load 
 correctly. I'm not sure yet if this is a problem with i3, or with 
 i3-save-tree.

 I opened three windows in a workspace (and then saved using i3-save-tree 
 --workspace test  /home/ubuntu/.i3/spec)
 2 xterms side-by-side in top row
 1 emacs in bottom row (I used the mod-shift-k to move emacs down)


 Correct Layout (the layout I saved with i3-save-tree) 
 _
 ||   |
 ||   |
 ||   |
 |  xterm | xterm |
 ||   |
 ||   |
 ||   |
 ||   |
 -
 ||
 ||
 ||
 |  emacs |
 ||
 ||
 ||
 ||
 _

 I then appended using i3-msg (i3-msg workspace new; append_layout 
 /home/ubuntu/.i3/spec
 After Append Layout (Incorrect Result)
 _
 || | |
 || | |
 || | |
 | xterm  | xterm   |   emacs |
 || | |
 || | |
 || | |
 || | |
 || | |
 || | |
 || | |
 _



 This is the spec generated by i3-save-tree:


 // vim:ts=4:sw=4:et
 {
 // splith split container with 2 children
 border: normal,
 floating: auto_off,
 layout: splith,
 percent: 0.232604373757455,
 type: con,
 nodes: [
 {
 border: normal,
 floating: auto_off,
 geometry: {
height: 316,
width: 484,
x: 0,
y: 0
 },
 name: ubuntu@sensis-8930: ~,
 percent: 0.5,
 swallows: [
{
class: ^XTerm$
}
 ],
 type: con
 },
 {
 border: normal,
 floating: auto_off,
 geometry: {
height: 316,
width: 484,
x: 0,
y: 0
 },
 name: ubuntu@sensis-8930: ~,
 percent: 0.5,
 swallows: [
{
class: ^XTerm$
}
 ],
 type: con
 }
 ]
 }

 {
 border: normal,
 floating: auto_off,
 geometry: {
height: 550,
width: 602,
x: 0,
y: 0
 },
 name: em...@example.com,
 percent: 0.767395626242545,
 swallows: [
{
class: ^Emacs23$
}
 ],
 type: con
 }
 -
 This message is intended only for the addressee and may contain information 
 that is company confidential or privileged.  Any technical data in this 
 message may be exported only in accordance with the U.S. International 
 Traffic in Arms Regulations (22 CFR Parts 120-130) or the Export 
 Administration Regulations (15 CFR Parts 730-774). Unauthorized use is 
 strictly