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:
parent
bf366cb99d
commit
cbba00d360
5 changed files with 42 additions and 36 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue