From 4a83ab6e02befbaf54e82febc1b8202cef24e09e Mon Sep 17 00:00:00 2001 From: Glenn Watson Date: Wed, 25 Mar 2015 11:45:06 +1000 Subject: Set WM_CLASS based on initial window title. --- src/x11/window/mod.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/x11') diff --git a/src/x11/window/mod.rs b/src/x11/window/mod.rs index 9f600a8..8f30373 100644 --- a/src/x11/window/mod.rs +++ b/src/x11/window/mod.rs @@ -510,6 +510,16 @@ impl Window { } } + // Set ICCCM WM_CLASS property based on initial window title + unsafe { + with_c_str(&*builder.title, |c_name| { + let hint = ffi::XAllocClassHint(); + (*hint).res_name = c_name as *mut i8; + (*hint).res_class = c_name as *mut i8; + ffi::XSetClassHint(display, window, hint); + ffi::XFree(hint as *mut libc::c_void); + }); + } // creating GL context let (context, extra_functions) = unsafe { -- cgit v1.2.3