Closed martinlindhe closed 8 months ago
This is interesting, do you think it makes sense to create this id automatically from the app's title? Like from "Notan App" it could be "notan_app". Though I am not sure if it makes sense because the title can change while my guess is that the app_id should remain the same all time.
This is interesting, do you think it makes sense to create this id automatically from the app's title? Like from "Notan App" it could be "notan_app". Though I am not sure if it makes sense because the title can change while my guess is that the app_id should remain the same all time.
The app_id should be a unique non-changing identifier, so I think it should be a separate function. (And don't fill it with a default value, its better left unset rather than multiple applications sharing the same app_id).
For reference, here is a bug report in bevy about this same type of feature with some more information: https://github.com/bevyengine/bevy/issues/4188
I made this PR: https://github.com/Nazariglez/notan/pull/306.
I think it's useful having this because I can use it also as canvas_id for the web target, so the functionality was just there only that the native backend did not use it. Winit has enabled by default the features X11
and Wayland
for UNIX so I am not checking which one is the app running on, I am just assuming that the feature is enabled. I tried in X11 without issues. It would be great to see if it works on wayland.
Verified PR #306 works on wayland.
Without changes to the test app (oculante) , app_id is "notan_app":
#75: con "Oculante | 0.8.6" (xdg_shell, pid: 77191, app_id: "notan_app")
With
WindowConfig::new().set_app_id("oculante")
we get:
#77: con "Oculante | 0.8.6" (xdg_shell, pid: 77746, app_id: "oculante")
So nice, thank you for the help!
app_id is a wayland property which is a string identifier. x11 apps have a similar property called
class
.It would be helpful to be able to set this value using the notan api.
winit has a method that wraps the above behavior, called with_name
Currently on a sway setup (
swaymsg -t get_tree
), runningcargo run --release --example draw_image