Remove parking_lot dependency (#2423)
This commit is contained in:
parent
ec7e935248
commit
8729119536
16 changed files with 197 additions and 175 deletions
|
|
@ -1,5 +1,6 @@
|
|||
use std::sync::Mutex;
|
||||
|
||||
use once_cell::sync::Lazy;
|
||||
use parking_lot::Mutex;
|
||||
|
||||
use super::*;
|
||||
|
||||
|
|
@ -9,11 +10,11 @@ static SUPPORTED_HINTS: Lazy<Mutex<Vec<ffi::Atom>>> =
|
|||
static WM_NAME: Lazy<Mutex<Option<String>>> = Lazy::new(|| Mutex::new(None));
|
||||
|
||||
pub fn hint_is_supported(hint: ffi::Atom) -> bool {
|
||||
(*SUPPORTED_HINTS.lock()).contains(&hint)
|
||||
(*SUPPORTED_HINTS.lock().unwrap()).contains(&hint)
|
||||
}
|
||||
|
||||
pub fn wm_name_is_one_of(names: &[&str]) -> bool {
|
||||
if let Some(ref name) = *WM_NAME.lock() {
|
||||
if let Some(ref name) = *WM_NAME.lock().unwrap() {
|
||||
names.contains(&name.as_str())
|
||||
} else {
|
||||
false
|
||||
|
|
@ -22,8 +23,8 @@ pub fn wm_name_is_one_of(names: &[&str]) -> bool {
|
|||
|
||||
impl XConnection {
|
||||
pub fn update_cached_wm_info(&self, root: ffi::Window) {
|
||||
*SUPPORTED_HINTS.lock() = self.get_supported_hints(root);
|
||||
*WM_NAME.lock() = self.get_wm_name(root);
|
||||
*SUPPORTED_HINTS.lock().unwrap() = self.get_supported_hints(root);
|
||||
*WM_NAME.lock().unwrap() = self.get_wm_name(root);
|
||||
}
|
||||
|
||||
fn get_supported_hints(&self, root: ffi::Window) -> Vec<ffi::Atom> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue