Skip to content

Commit

Permalink
[release]
Browse files Browse the repository at this point in the history
  • Loading branch information
crschnick committed Nov 26, 2024
1 parent 22f14ba commit 4e88ed2
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,9 @@ private boolean shouldLaunchSplitTerminal() {

// Check if the right side is already occupied
var existingSplit = f.getEffectiveRightTab().getValue();
if (existingSplit == this) {
return false;
}
if (existingSplit != null && !(existingSplit instanceof BrowserTerminalDockTabModel)) {
return false;
}
Expand Down
26 changes: 12 additions & 14 deletions app/src/main/java/io/xpipe/app/terminal/TerminalDockComp.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,6 @@ public void changed(ObservableValue<? extends Number> observable, Number oldValu
update(stack);
}
};
s.xProperty().addListener(update);
s.yProperty().addListener(update);
s.widthProperty().addListener(update);
s.heightProperty().addListener(update);

var iconified = new ChangeListener<Boolean>() {
@Override
public void changed(ObservableValue<? extends Boolean> observable, Boolean oldValue, Boolean newValue) {
Expand All @@ -67,8 +62,6 @@ public void changed(ObservableValue<? extends Boolean> observable, Boolean oldVa
}
}
};
s.iconifiedProperty().addListener(iconified);

var focus = new ChangeListener<Boolean>() {
@Override
public void changed(ObservableValue<? extends Boolean> observable, Boolean oldValue, Boolean newValue) {
Expand All @@ -79,26 +72,21 @@ public void changed(ObservableValue<? extends Boolean> observable, Boolean oldVa
}
}
};
s.focusedProperty().addListener(focus);

var show = new EventHandler<WindowEvent>() {
@Override
public void handle(WindowEvent event) {
update(stack);
}
};
s.addEventFilter(WindowEvent.WINDOW_SHOWN, show);

var hide = new EventHandler<WindowEvent>() {
@Override
public void handle(WindowEvent event) {
update(stack);
}
};
s.addEventFilter(WindowEvent.WINDOW_HIDING, hide);

stack.sceneProperty().addListener((observable, oldValue, newValue) -> {
if (oldValue != null && newValue == null) {
stack.sceneProperty().subscribe(scene -> {
if (scene == null) {
s.xProperty().removeListener(update);
s.yProperty().removeListener(update);
s.widthProperty().removeListener(update);
Expand All @@ -107,6 +95,16 @@ public void handle(WindowEvent event) {
s.focusedProperty().removeListener(focus);
s.removeEventFilter(WindowEvent.WINDOW_SHOWN, show);
s.removeEventFilter(WindowEvent.WINDOW_HIDING, hide);
} else {
s.xProperty().addListener(update);
s.yProperty().addListener(update);
s.widthProperty().addListener(update);
s.heightProperty().addListener(update);
s.iconifiedProperty().addListener(iconified);
s.focusedProperty().addListener(focus);
s.addEventFilter(WindowEvent.WINDOW_SHOWN, show);
s.addEventFilter(WindowEvent.WINDOW_HIDING, hide);
update(stack);
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@ public interface WindowsTerminalType extends ExternalTerminalType, TrackableTerm
static AtomicInteger windowCounter = new AtomicInteger(2);

private static CommandBuilder toCommand(TerminalLaunchConfiguration configuration) throws Exception {
var cmd = CommandBuilder.of().addIf(configuration.isPreferTabs(), "-w", "1")
.addIf(!configuration.isPreferTabs(),"-w", "" + windowCounter.getAndIncrement())
.add("nt");
var cmd = CommandBuilder.of().addIf(configuration.isPreferTabs(), "-w", "1", "nt")
.addIf(!configuration.isPreferTabs(),"-w", "" + windowCounter.getAndIncrement());

if (configuration.getColor() != null) {
cmd.add("--tabColor").addQuoted(configuration.getColor().toHexString());
Expand Down
2 changes: 2 additions & 0 deletions dist/changelogs/13.3.2_incremental.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
- Fix Windows Terminal docking not working probably if new instance behavior had been set to attach in the Windows Terminal settings
- Fix terminal dock not moving terminals anymore after tab switch
- Fix terminal still trying to dock when launched from a pinned tab

0 comments on commit 4e88ed2

Please sign in to comment.