(In reply to comment #24)
> what about making sure that Enter just calls restoreSession() if nothing in the
> tree is focused?
As soon as the tree has focus, the selected row will have focus as well, and there's always a selected row. The interesting question is whether it's an expandable container (where Enter will be consumed) or a tab (where Enter won't be consumed).
> any other possible propose how to fix this bug?
see comment 3