diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-05-09 13:58:13 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-05-09 13:58:13 +0300 |
commit | aad89b2118a859333afadaf5f8894c5ef410fa7f (patch) | |
tree | cdbcab44a93998349b9fdca605b3f97006830924 /src/ui/window.c | |
parent | 3e984cb4665feb0dd64c4f2850431f2437c11a42 (diff) |
Window: Keep the current tab when unsplitting
Diffstat (limited to 'src/ui/window.c')
-rw-r--r-- | src/ui/window.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/ui/window.c b/src/ui/window.c index f1e89344..f4ebd522 100644 --- a/src/ui/window.c +++ b/src/ui/window.c | |||
@@ -1196,6 +1196,7 @@ void setSplitMode_Window(iWindow *d, int splitFlags) { | |||
1196 | setFreezeDraw_Window(d, iTrue); | 1196 | setFreezeDraw_Window(d, iTrue); |
1197 | if (oldCount == 2 && splitMode == 0) { | 1197 | if (oldCount == 2 && splitMode == 0) { |
1198 | /* Keep references to the tabs of the second root. */ | 1198 | /* Keep references to the tabs of the second root. */ |
1199 | const iDocumentWidget *curPage = document_Root(d->keyRoot); | ||
1199 | iObjectList *tabs = listDocuments_App(d->roots[1]); | 1200 | iObjectList *tabs = listDocuments_App(d->roots[1]); |
1200 | iForEach(ObjectList, i, tabs) { | 1201 | iForEach(ObjectList, i, tabs) { |
1201 | setRoot_Widget(i.object, d->roots[0]); | 1202 | setRoot_Widget(i.object, d->roots[0]); |
@@ -1213,6 +1214,7 @@ void setSplitMode_Window(iWindow *d, int splitFlags) { | |||
1213 | /* The last child is the [+] button for adding a tab. */ | 1214 | /* The last child is the [+] button for adding a tab. */ |
1214 | moveTabButtonToEnd_Widget(findChild_Widget(docTabs, "newtab")); | 1215 | moveTabButtonToEnd_Widget(findChild_Widget(docTabs, "newtab")); |
1215 | iRelease(tabs); | 1216 | iRelease(tabs); |
1217 | postCommandf_App("tabs.switch id:%s", cstr_String(id_Widget(constAs_Widget(curPage)))); | ||
1216 | } | 1218 | } |
1217 | else if (splitMode && oldCount == 1) { | 1219 | else if (splitMode && oldCount == 1) { |
1218 | /* Add a second root. */ | 1220 | /* Add a second root. */ |