mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-11-25 00:50:31 +00:00
Small terminal control fixes
This commit is contained in:
parent
eb2f0d0730
commit
977ad2483f
3 changed files with 22 additions and 1 deletions
|
@ -78,6 +78,10 @@ public class NativeWinWindowControl {
|
|||
return (User32.INSTANCE.GetWindowLong(windowHandle, User32.GWL_STYLE) & User32.WS_MINIMIZE) != 0;
|
||||
}
|
||||
|
||||
public boolean isVisible() {
|
||||
return User32.INSTANCE.IsWindowVisible(windowHandle);
|
||||
}
|
||||
|
||||
public void alwaysInFront() {
|
||||
orderRelative(new WinDef.HWND(new Pointer(0xFFFFFFFFFFFFFFFFL)));
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ public abstract class ControllableTerminalSession extends TerminalView.TerminalS
|
|||
|
||||
public abstract Rect queryBounds();
|
||||
|
||||
public final void updateBoundsState() {
|
||||
public void updateBoundsState() {
|
||||
if (!isActive()) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -71,4 +71,21 @@ public final class WindowsTerminalSession extends ControllableTerminalSession {
|
|||
public Rect queryBounds() {
|
||||
return control.getBounds();
|
||||
}
|
||||
|
||||
|
||||
public void updateBoundsState() {
|
||||
if (!control.isIconified() || !control.isVisible()) {
|
||||
return;
|
||||
}
|
||||
|
||||
var bounds = queryBounds();
|
||||
if (bounds.getX() == -32000 || bounds.getY() == -32000) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (lastBounds != null && !lastBounds.equals(bounds)) {
|
||||
customBounds = true;
|
||||
}
|
||||
lastBounds = bounds;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue