summaryrefslogtreecommitdiff
path: root/src/ui/window.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/window.c')
-rw-r--r--src/ui/window.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/src/ui/window.c b/src/ui/window.c
index 5a8a1e26..c4d06d75 100644
--- a/src/ui/window.c
+++ b/src/ui/window.c
@@ -1218,9 +1218,15 @@ void setSplitMode_Window(iWindow *d, int splitFlags) {
1218 setCurrent_Root(d->roots[1]); 1218 setCurrent_Root(d->roots[1]);
1219 d->keyRoot = d->roots[1]; 1219 d->keyRoot = d->roots[1];
1220 createUserInterface_Root(d->roots[1]); 1220 createUserInterface_Root(d->roots[1]);
1221 /* If the old root has multiple tabs, move the current one to the new split. */ { 1221 if (!isEmpty_String(d->pendingSplitUrl)) {
1222 postCommandf_Root(d->roots[1], "open url:%s",
1223 cstr_String(d->pendingSplitUrl));
1224 clear_String(d->pendingSplitUrl);
1225 }
1226 else if (~splitFlags & noEvents_WindowSplit) {
1222 iWidget *docTabs0 = findChild_Widget(d->roots[0]->widget, "doctabs"); 1227 iWidget *docTabs0 = findChild_Widget(d->roots[0]->widget, "doctabs");
1223 iWidget *docTabs1 = findChild_Widget(d->roots[1]->widget, "doctabs"); 1228 iWidget *docTabs1 = findChild_Widget(d->roots[1]->widget, "doctabs");
1229 /* If the old root has multiple tabs, move the current one to the new split. */
1224 if (tabCount_Widget(docTabs0) >= 2) { 1230 if (tabCount_Widget(docTabs0) >= 2) {
1225 int movedIndex = tabPageIndex_Widget(docTabs0, moved); 1231 int movedIndex = tabPageIndex_Widget(docTabs0, moved);
1226 removeTabPage_Widget(docTabs0, movedIndex); 1232 removeTabPage_Widget(docTabs0, movedIndex);
@@ -1228,19 +1234,10 @@ void setSplitMode_Window(iWindow *d, int splitFlags) {
1228 iRelease(removeTabPage_Widget(docTabs1, 0)); /* delete the default tab */ 1234 iRelease(removeTabPage_Widget(docTabs1, 0)); /* delete the default tab */
1229 setRoot_Widget(as_Widget(moved), d->roots[1]); 1235 setRoot_Widget(as_Widget(moved), d->roots[1]);
1230 prependTabPage_Widget(docTabs1, iClob(moved), "", 0, 0); 1236 prependTabPage_Widget(docTabs1, iClob(moved), "", 0, 0);
1231 if (~splitFlags & noEvents_WindowSplit) { 1237 postCommandf_App("tabs.switch page:%p", moved);
1232 postCommandf_App("tabs.switch page:%p", moved);
1233 }
1234 } 1238 }
1235 else if (~splitFlags & noEvents_WindowSplit) { 1239 else {
1236 if (isEmpty_String(d->pendingSplitUrl)) { 1240 postCommand_Root(d->roots[1], "navigate.home");
1237 postCommand_Root(d->roots[1], "navigate.home");
1238 }
1239 else {
1240 postCommandf_Root(d->roots[1], "open url:%s",
1241 cstr_String(d->pendingSplitUrl));
1242 clear_String(d->pendingSplitUrl);
1243 }
1244 } 1241 }
1245 } 1242 }
1246 setCurrent_Root(NULL); 1243 setCurrent_Root(NULL);