tauri-controls icon indicating copy to clipboard operation
tauri-controls copied to clipboard

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

Open allenli178 opened this issue 2 years ago • 6 comments

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.

allenli178 avatar Aug 10 '23 04:08 allenli178

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

agmmnn avatar Aug 10 '23 19:08 agmmnn

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

allenli178 avatar Aug 11 '23 01:08 allenli178

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 avatar Aug 12 '23 12:08 agmmnn

isWindowMaximized is disabled temporarily in macOS until find another solution.

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

agmmnn avatar Aug 12 '23 14:08 agmmnn

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

allenli178 avatar Aug 12 '23 16:08 allenli178

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).

agmmnn avatar Aug 12 '23 16:08 agmmnn