Correctly restore focus after in-place restarts

Note: This change requires two in-place restarts when you are upgrading
in-place from an old version.

Fixes #611
This commit is contained in:
Michael Stapelberg
2012-01-21 18:35:15 +00:00
parent fabcd7d911
commit 3b7f4d428e
5 changed files with 112 additions and 11 deletions

View File

@ -357,6 +357,11 @@ struct Match {
*/
enum { M_HERE = 0, M_ASSIGN_WS, M_BELOW } insert_where;
/* Whether this match was generated when restarting i3 inplace.
* Leads to not setting focus when managing a new window, because the old
* focus stack should be restored. */
bool restart_mode;
TAILQ_ENTRY(Match) matches;
};
@ -514,6 +519,10 @@ struct Con {
SCRATCHPAD_FRESH = 1,
SCRATCHPAD_CHANGED = 2
} scratchpad_state;
/* The ID of this container before restarting. Necessary to correctly
* interpret back-references in the JSON (such as the focus stack). */
int old_id;
};
#endif