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

Support apps without root window #561

Open
kdwk opened this issue Oct 18, 2023 · 3 comments · May be fixed by #562
Open

Support apps without root window #561

kdwk opened this issue Oct 18, 2023 · 3 comments · May be fixed by #562

Comments

@kdwk
Copy link

kdwk commented Oct 18, 2023

Many apps need the ability to open multiple windows and closing any window without closing the app. For example, a user would open multiple windows of a web browser and then close any opened window they choose while expecting others to stay open. Currently, Relm4 only allows closing windows that is not the main app window, and if the user closes the that the whole app closes. Supporting otherwise would allow Relm4 to be much more versatile and suitable for a much larger range of apps.

@AaronErhardt
Copy link
Member

Currently, Relm4 only allows closing windows that is not the main app window, and if the user closes the that the whole app closes.

This is the default behavior but you can change that if you want. For example, you can use connect_close_request() to just hide the window when the user tries to close it. Or you can launch components manually instead of using RelmApp, like in this example.

That said, the question is whether Relm4 should offer a nice abstraction for this. If you have a specific use-case, we could have a look.

@kdwk
Copy link
Author

kdwk commented Oct 18, 2023

One use case would be web browsers. Users would want to open multiple web browser windows and be able to close any one of them without closing the app. But I'll take a look at that example, thanks

@AaronErhardt
Copy link
Member

AaronErhardt commented Oct 18, 2023

Ok, that's a good use-case. I would suggest we write a small example for this use-case and then look how we can simplify the code with new abstractions in Relm4.

@AaronErhardt AaronErhardt linked a pull request Oct 18, 2023 that will close this issue
4 tasks
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