Skip to content

Commit 9e3ad13

Browse files
committed
set in_game window far from desktop
1 parent 5226575 commit 9e3ad13

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

src/App.tsx

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { invoke } from "@tauri-apps/api";
22
import {
33
appWindow,
4+
LogicalPosition,
45
LogicalSize,
56
type PhysicalSize,
67
} from "@tauri-apps/api/window";
@@ -164,6 +165,17 @@ const App = memo(() => {
164165
initializeApp();
165166
setupGameMonitoring();
166167

168+
if (IN_GAME) {
169+
setInterval(async () => {
170+
appWindow.setPosition(new LogicalPosition(-15000, -15000));
171+
172+
const visible = await appWindow.isVisible();
173+
if (!visible) {
174+
appWindow.show();
175+
}
176+
}, 100);
177+
}
178+
167179
return () => {
168180
killResizeListener?.();
169181
if (processCheckInterval.current) {
@@ -174,20 +186,8 @@ const App = memo(() => {
174186

175187
const handleLoadingEnd = useCallback(async () => {
176188
const endTimer = PerformanceMonitor.time("loading-end");
177-
178-
try {
179-
const targetSize = mainWindowSize.current || new LogicalSize(1000, 700);
180-
181-
await Promise.all([
182-
appWindow.setResizable(true),
183-
appWindow.setSize(targetSize),
184-
appWindow.center(),
185-
]);
186-
187-
setLoading(false);
188-
} finally {
189-
endTimer();
190-
}
189+
setLoading(false);
190+
endTimer();
191191
}, []);
192192

193193
const appStyle = useMemo(

0 commit comments

Comments
 (0)