[bugfix] Fix window geometry bug that was not save and restore. changes the way how to get appWindow instance from Tauri.

This commit is contained in:
Sakamoto Shiina
2025-05-11 15:26:05 +09:00
parent 61e333401f
commit b2bc1e62cb
10 changed files with 53 additions and 68 deletions

View File

@@ -1,5 +1,3 @@
import { getCurrentWindow } from "@tauri-apps/api/window";
import { store, useStore_Hotkeys } from "@store";
import { useStdoutToPython } from "@logics/useStdoutToPython";
import { useNotificationStatus } from "@logics_common";
@@ -7,6 +5,8 @@ import { useMainFunction } from "@logics_main";
import { register, unregisterAll, isRegistered } from "@tauri-apps/plugin-global-shortcut";
export const useHotkeys = () => {
const appWindow = store.appWindow;
const { asyncStdoutToPython } = useStdoutToPython();
const { currentHotkeys, updateHotkeys, pendingHotkeys } = useStore_Hotkeys();
const {
@@ -68,8 +68,6 @@ export const useHotkeys = () => {
if (!isAlreadyRegistered) {
await register(shortcut, async (event) => {
if (event.state !== "Pressed") return;
const appWindow = await getCurrentWindow();
switch (actionKey) {
case "toggle_vrct_visibility": {
const minimized = await appWindow.isMinimized();