agmmnn / tauri-controls

🚥 Native-looking window controls for Tauri 2. React, Solid, Vue, Svelte+Tailwind.
https://npmjs.com/package/tauri-controls
MIT License
581 stars 21 forks source link

[bug] `isMaximized` with `decorations: false` causes window freeze on macOS #10

Open allenli178 opened 10 months ago

allenli178 commented 10 months ago

In react and solid, when setting decorations to false in tauri.config.json, the program will crash. It only works well in svelte. but the toggle of fullscreen icon doesn't work in svelte, because only the variable is set, but never change.

agmmnn commented 10 months ago

In react and solid, when setting decorations to true in tauri.config.json, the program will crash. It only works well in svelte.

I tried "decorations": true, and it works well on Windows 11, what is your system specs?

but the toggle of fullscreen icon doesn't work in svelte, because only the variable is set, but never change.

Yes, I skipped it when implementing svelte, because I didn't have much time. I'll do that, it's already on the todos list. https://github.com/agmmnn/tauri-controls/blob/master/TODOs.md#tauri-controlssvelte

allenli178 commented 10 months ago

It should be setting decorations to false. I tried it on macos m2, but the app would broken.

agmmnn commented 10 months ago

I think this is the code part causing that problem on macos, it listens IsWindowMaximized (only in react and solid):

https://github.com/agmmnn/tauri-controls/blob/ffc3998abf72d7df9f80cc4f4dee88b1ed6915d8/apps/tauri-controls/src/tauri-controls/contexts/plugin-window.tsx#L49-L64

but I don't get why it works fine on windows and linux and freezes on macos.

agmmnn commented 10 months ago

isWindowMaximized is disabled temporarily in macOS until find another solution.

https://github.com/agmmnn/tauri-controls/releases/tag/v0.1.2

allenli178 commented 10 months ago

There is the same issue in tauri repo, but no one give a solution. ottosson/tauri/

agmmnn commented 10 months ago

Ah thanks for the mention, I was wondering if this was a problem with the code or with the tauri itself (or https://github.com/tauri-apps/tauri-plugin-window).