-
Notifications
You must be signed in to change notification settings - Fork 560
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
Add app_id property to Window #1333
Conversation
On Wayland this will be passed to set_app_id in xdg-shell On X11 this will be passed to wmclass It is used by desktop environments to identify the application Fixes slint-ui#1332
|
I think it’s a good idea to add support for this. Implementation wise I think yon might need some platform cfg guards. Which platforms support this or how this maps to the platforms should be documented. I’m not entirely sure if this API belongs into the UI design or if it should be API on slint::Window that’s for programmers dealing with platform integration (color me torn :) |
I would not expect an UI designer to care for OS-specific details like this, so I would expect this to be set with code somehow. |
Thanks for the pull request. The code looks good (appart from the missing |
Right, we need to know the id before creating the |
Ah, you're right - this isn't per window anyway. In Qt it's also a global of the application object. So |
In Wayland (and X11 too) it's a per-window (as in toplevel-window) property though. But I have never personally encountered a case where it being global in Qt was a problem |
Could the ID String be passed to the generated constructor for the window? |
How do we proceed here? Do we make it a global or per-window property? It's a bit of a complex situation. The native window system APIs support it to be per-window, but Qt can only do it globally |
I still maintain that this is best handled as a global property. The common case is that one process has one or multiple windows that belong to the same application id (matching the .desktop file). One rare case I can imagine is that multiple .desktop files map to the same process, but there the app id could be a command line parameter that's then passed to the API we're talking about. So the only scenario that I can think of that wouldn't work is one where multiple .desktop files end up re-using the same process but show are supposed to represent distinct applications. I'm still in favor of |
Hello, any news about this ? |
One way of achieving this today is by using the winit backend private API: use i_slint_backend_winit::winit::platform::wayland::WindowAttributesExtWayland;
let mut backend = i_slint_backend_winit::Backend::new().unwrap();
backend.window_builder_hook = Some(Box::new(|builder| builder.with_name(your_app_id)));
slint::platform::set_platform(Box::new(backend)); |
This PR is a bit old and out of date so i'm going to close it. The issue #1332 remains open. |
On Wayland this will be passed to set_app_id in xdg-shell
On X11 this will be passed to wmclass
It is used by desktop environments to identify the application
Fixes #1332