Skip to content

Modifying WindowFlags causes Window to close #254

@jabza

Description

@jabza

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions