Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
allenli178 opened this issue Aug 10, 2023 · 6 comments · Fixed by #11
Open

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

allenli178 opened this issue Aug 10, 2023 · 6 comments · Fixed by #11

Comments

@allenli178
Copy link
Contributor

allenli178 commented Aug 10, 2023

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
Copy link
Owner

agmmnn commented Aug 10, 2023

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 agmmnn reopened this Aug 10, 2023
@allenli178
Copy link
Contributor Author

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

@agmmnn
Copy link
Owner

agmmnn commented Aug 12, 2023

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

useEffect(() => {
updateIsWindowMaximized()
let unlisten: () => void = () => {}
const listen = async () => {
if (appWindow) {
unlisten = await appWindow.onResized(() => {
updateIsWindowMaximized()
})
}
}
listen()
// Cleanup the listener when the component unmounts
return () => unlisten && unlisten()
}, [appWindow, updateIsWindowMaximized])

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

@agmmnn
Copy link
Owner

agmmnn commented Aug 12, 2023

isWindowMaximized is disabled temporarily in macOS until find another solution.

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

@allenli178
Copy link
Contributor Author

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

@agmmnn
Copy link
Owner

agmmnn commented Aug 12, 2023

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 agmmnn changed the title [bug] application crash [bug] isMaximized with decorations: false causes window freeze on macOS Aug 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants