You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unify with_app_id and with_class on Linux/BSD #1739
C - needs discussionDirection must be ironed outDS - waylandAffects the Wayland backend, or generally free Unix platformsDS - x11Affects the X11 backend, or generally free Unix platformsS - apiDesign and usability
Winit currently has two calls that do very similar things, with_app_id and with_class. Generally I think these are rarely used with different parameters and more commonly the code is just duplicated between both of them. As an abstraction library that shouldn't make downstream care too much about Wayland/X11, I think this gives winit the opportunity to unify these two methods to make things a bit easier to use.
They are of course not exactly the same and depending on the platform the number of arguments is different, but since they should generally overlap this can be resolved by thorough documentation.
Of course even when unified, people could still do x11/Wayland checks on their own if they really want to treat these methods differently.
So the main reason why one wouldn't want to do this is that these aren't commonly set to the same thing. I can only speak for myself and Alacritty where we do indeed set these to the same value, so I'm curious about others here. Are there any downstream users treating these as different things?
I kind of agree, it should be fine to make one method out of them, however I'm not sure that with should call it with_class or with_app_id. Maybe something like with_application_name? What do you think?
Naming is a good point, I probably would have just used the name with_class since to me that's such a general concept. However I might be biased having been around X11 for so long, so windows having different "classes" might be a foreign concept to many.
So having a with_application_name would certainly be a more general and self-descriptive term, which I certainly wouldn't mind. The biggest argument I could give against it would be that it's significantly longer than both with_class and with_app_id, so maybe with_name would also make sense?
C - needs discussionDirection must be ironed outDS - waylandAffects the Wayland backend, or generally free Unix platformsDS - x11Affects the X11 backend, or generally free Unix platformsS - apiDesign and usability
Activity
kchibisov commentedon Oct 11, 2020
I kind of agree, it should be fine to make one method out of them, however I'm not sure that with should call it
with_classorwith_app_id. Maybe something likewith_application_name? What do you think?chrisduerr commentedon Oct 11, 2020
Naming is a good point, I probably would have just used the name
with_classsince to me that's such a general concept. However I might be biased having been around X11 for so long, so windows having different "classes" might be a foreign concept to many.So having a
with_application_namewould certainly be a more general and self-descriptive term, which I certainly wouldn't mind. The biggest argument I could give against it would be that it's significantly longer than bothwith_classandwith_app_id, so maybewith_namewould also make sense?kchibisov commentedon Apr 9, 2022
Yeah,
with_nameis something I'd go with to be honest. Since gtk uses-nameparameter for application name.Unify `with_app_id` and `with_class` methods
Unify `with_app_id` and `with_class` methods
Unify `with_app_id` and `with_class` methods
Unify `with_app_id` and `with_class` methods
Use sctk-adwaita 0.5.1 auto theme selection