Small dock fixes [release]

This commit is contained in:
crschnick
2026-02-18 19:45:26 +00:00
parent 27f75d7476
commit 670dee6d91
2 changed files with 17 additions and 3 deletions

View File

@@ -3,6 +3,7 @@ package io.xpipe.app.terminal;
import io.xpipe.app.comp.base.ModalOverlay;
import io.xpipe.app.core.AppI18n;
import io.xpipe.app.core.AppLayoutModel;
import io.xpipe.app.core.mode.AppOperationMode;
import io.xpipe.app.core.window.AppDialog;
import io.xpipe.app.core.window.AppMainWindow;
import io.xpipe.app.platform.LabelGraphic;
@@ -67,6 +68,14 @@ public class TerminalDockHubManager {
return false;
}
if (AppOperationMode.get() != AppOperationMode.GUI) {
return false;
}
if (AppMainWindow.get() == null || !AppMainWindow.get().getStage().isShowing() || AppMainWindow.get().getStage().isIconified()) {
return false;
}
return true;
}

View File

@@ -6,6 +6,7 @@ import io.xpipe.app.prefs.AppPrefs;
import io.xpipe.app.util.GlobalTimer;
import io.xpipe.app.util.Rect;
import io.xpipe.app.util.ThreadHelper;
import lombok.Getter;
import java.time.Duration;
@@ -59,6 +60,7 @@ public class TerminalDockView {
Math.abs(targetBounds.getW() - currentBounds.getW()) +
Math.abs(targetBounds.getH() - currentBounds.getH());
if (sum < 30) {
ThreadHelper.sleep(300);
trackTerminal(terminal, true);
return;
}
@@ -71,16 +73,19 @@ public class TerminalDockView {
}
public synchronized void trackTerminal(ControllableTerminalSession terminal, boolean dock) {
if (viewActive && dock && viewBounds != null) {
terminal.own();
if (viewActive && dock && viewBounds != null && NativeWinWindowControl.MAIN_WINDOW.isVisible() && !NativeWinWindowControl.MAIN_WINDOW.isIconified()) {
// Bring main window to foreground since initial launch
NativeWinWindowControl.MAIN_WINDOW.activate();
terminal.own();
// The window might be minimized
// We always want to show the terminal though
terminal.show();
// Move input focus to terminal
terminal.focus();
terminal.updatePosition(windowBoundsFunction.apply(viewBounds));
updateCustomBounds();
}