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

Modifying WindowFlags causes Window to close #254

Open
jabza opened this issue Jul 29, 2020 · 0 comments
Open

Modifying WindowFlags causes Window to close #254

jabza opened this issue Jul 29, 2020 · 0 comments

Comments

@jabza
Copy link

@jabza jabza commented Jul 29, 2020

Describe the bug
I am trying to toggle the WindowType.FramelessWindowHint windowFlag, but this causes the window to close.

This happens when changing the windowFlags props of Window or calling setWindowFlag via a ref.

export default function MainWindow() {
	const dispatch = useDispatch();
	const toggle = useSelector(s => s.settings.toggle);

	const flags = {
		[WindowType.FramelessWindowHint]: toggle
	}

	const minSize = {
		width: 256,
		height: 128
	}

	return (
		<Window windowIcon={winIcon} windowTitle={pkg.name} windowFlags={flags} minSize={minSize}>
			<Button on={{clicked: () => dispatch(settings.actions.toggle())}}>click me!</Button>
		</Window>
	);
}

This happens both in development and production builds.

Expected behavior
WindowFlags are updated when the props change.

Modifying the icon and title via props works as expected. windowsFlags changes causes in the window closing.

It appears any WindowFlag change results in the same behaviour...

Any ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.