mirror of
https://github.com/rust-windowing/winit.git
synced 2026-08-30 05:10:03 -04:00
Unify with_app_id and with_class methods
Both APIs are used to set application name. This commit unifies the API between Wayland and X11, so downstream applications can remove platform specific code when using `WindowBuilderExtUnix`. Fixes #1739.
This commit is contained in:
@@ -310,11 +310,11 @@ impl UnownedWindow {
|
||||
|
||||
// WM_CLASS must be set *before* mapping the window, as per ICCCM!
|
||||
{
|
||||
let (class, instance) = if let Some((instance, class)) = pl_attribs.class {
|
||||
let instance = CString::new(instance.as_str())
|
||||
let (class, instance) = if let Some(name) = pl_attribs.name {
|
||||
let instance = CString::new(name.instance.as_str())
|
||||
.expect("`WM_CLASS` instance contained null byte");
|
||||
let class =
|
||||
CString::new(class.as_str()).expect("`WM_CLASS` class contained null byte");
|
||||
let class = CString::new(name.general.as_str())
|
||||
.expect("`WM_CLASS` class contained null byte");
|
||||
(instance, class)
|
||||
} else {
|
||||
let class = env::args()
|
||||
|
||||
Reference in New Issue
Block a user