Open Hacksore opened 1 month ago
Since the NSWindow
has been converted to NSPanel
, you can no longer call the window.is_maximised
or maximise the window anymore.
You can't maximise a panel.
this line calls maximise on the window(panel), hence why it crashed.
this line needs to be refactored.
such that self.is_maximized
is only called if and only if the state flag includes MAXIMIZED
one more thing,
@Hacksore when calling saveWindowState
, you will have to exclude MAXIMIZED
Here is the patch PR: https://github.com/tauri-apps/plugins-workspace/pull/1547
@ahkohd I just pushed this which unblocks the app from crashing immediately on startup. https://github.com/Hacksore/tauri-window-save-state-bug/commit/79ca7f4e2d4fb01af2feb98f0215f296e4e9f634
However, hitting the in app close button will still cause a panic. I thought only selecting flags POSITION
and SIZE
would work?
https://github.com/Hacksore/tauri-window-save-state-bug/blob/79ca7f4e2d4fb01af2feb98f0215f296e4e9f634/src/App.tsx#L12-L13
this line needs to be refactored.
such that
self.is_maximized
is only called if and only if the state flag includesMAXIMIZED
@Hacksore please read this comment.
In the window state plugin, as it is currently, if you set size
or maximized
flag, window.is_maximised()
is called, and this will crash the panel
.
This PR (https://github.com/tauri-apps/plugins-workspace/pull/1547) updates the implementation to call window.is_maximised
only if maximized is set in the state flags.
Yep, we are blocked here until they can review/merge your open PR.
In the meantime I just forked the repo and made the same you did. https://github.com/overlayeddev/overlayed/commit/f3359fdcf24d5d73b1f4f66f988b4c9b7d0c09e9
this line needs to be refactored. such that
self.is_maximized
is only called if and only if the state flag includesMAXIMIZED
@Hacksore please read this comment.
In the window state plugin, as it is currently, if you set
size
ormaximized
flag,window.is_maximised()
is called, and this will crash thepanel
.This PR (#1547) updates the implementation to call
window.is_maximised
only if maximized is set in the state flags.
I need to open same PR for the v2 plugin as well.
So I setup this repro but tl;dr if you leave the window save state plugin enabled this repro will crash when you go to access the
NSPanel
.https://github.com/Hacksore/tauri-window-save-state-bug
I've removed everything to be super straight to the issue so follow the readme and you can reproduce.
Unsure of what the issue is but here is the short stacktrace and you can find the full one in the repro.
This happens in dev and release modes so not sure what's going on. cc @ahkohd (creator of the tauri-nspanel).
related issues: https://github.com/overlayeddev/overlayed/issues/152 https://github.com/Hacksore/tauri-window-save-state-bug/issues/1