mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-07-10 23:22:43 +02:00
fix(wm): add permaignore_classes for electron jank
This commit is contained in:
@@ -103,6 +103,9 @@ lazy_static! {
|
|||||||
"OPContainerClass".to_string(),
|
"OPContainerClass".to_string(),
|
||||||
"IHWindowClass".to_string()
|
"IHWindowClass".to_string()
|
||||||
]));
|
]));
|
||||||
|
static ref PERMAIGNORE_CLASSES: Arc<Mutex<Vec<String>>> = Arc::new(Mutex::new(vec![
|
||||||
|
"Chrome_RenderWidgetHostHWND".to_string(),
|
||||||
|
]));
|
||||||
static ref BORDER_OVERFLOW_IDENTIFIERS: Arc<Mutex<Vec<String>>> = Arc::new(Mutex::new(vec![]));
|
static ref BORDER_OVERFLOW_IDENTIFIERS: Arc<Mutex<Vec<String>>> = Arc::new(Mutex::new(vec![]));
|
||||||
static ref WSL2_UI_PROCESSES: Arc<Mutex<Vec<String>>> = Arc::new(Mutex::new(vec![
|
static ref WSL2_UI_PROCESSES: Arc<Mutex<Vec<String>>> = Arc::new(Mutex::new(vec![
|
||||||
"X410.exe".to_string(),
|
"X410.exe".to_string(),
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ use winput::press;
|
|||||||
use winput::release;
|
use winput::release;
|
||||||
use winput::Vk;
|
use winput::Vk;
|
||||||
|
|
||||||
use komorebi_core::ApplicationIdentifier;
|
|
||||||
use komorebi_core::HidingBehaviour;
|
use komorebi_core::HidingBehaviour;
|
||||||
use komorebi_core::Rect;
|
use komorebi_core::Rect;
|
||||||
|
|
||||||
@@ -33,6 +32,7 @@ use crate::HIDING_BEHAVIOUR;
|
|||||||
use crate::LAYERED_WHITELIST;
|
use crate::LAYERED_WHITELIST;
|
||||||
use crate::MANAGE_IDENTIFIERS;
|
use crate::MANAGE_IDENTIFIERS;
|
||||||
use crate::NO_TITLEBAR;
|
use crate::NO_TITLEBAR;
|
||||||
|
use crate::PERMAIGNORE_CLASSES;
|
||||||
use crate::WSL2_UI_PROCESSES;
|
use crate::WSL2_UI_PROCESSES;
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, JsonSchema)]
|
#[derive(Debug, Clone, Copy, JsonSchema)]
|
||||||
@@ -460,25 +460,28 @@ fn window_is_eligible(
|
|||||||
ex_style: &ExtendedWindowStyle,
|
ex_style: &ExtendedWindowStyle,
|
||||||
event: Option<WindowManagerEvent>,
|
event: Option<WindowManagerEvent>,
|
||||||
) -> bool {
|
) -> bool {
|
||||||
|
{
|
||||||
|
let permaignore_classes = PERMAIGNORE_CLASSES.lock();
|
||||||
|
if permaignore_classes.contains(class) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let mut should_float = false;
|
let mut should_float = false;
|
||||||
let mut matched_identifier = None;
|
|
||||||
|
|
||||||
{
|
{
|
||||||
let float_identifiers = FLOAT_IDENTIFIERS.lock();
|
let float_identifiers = FLOAT_IDENTIFIERS.lock();
|
||||||
for identifier in float_identifiers.iter() {
|
for identifier in float_identifiers.iter() {
|
||||||
if title.starts_with(identifier) || title.ends_with(identifier) {
|
if title.starts_with(identifier) || title.ends_with(identifier) {
|
||||||
should_float = true;
|
should_float = true;
|
||||||
matched_identifier = Option::from(ApplicationIdentifier::Title);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if class.starts_with(identifier) || class.ends_with(identifier) {
|
if class.starts_with(identifier) || class.ends_with(identifier) {
|
||||||
should_float = true;
|
should_float = true;
|
||||||
matched_identifier = Option::from(ApplicationIdentifier::Class);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if identifier == exe_name {
|
if identifier == exe_name {
|
||||||
should_float = true;
|
should_float = true;
|
||||||
matched_identifier = Option::from(ApplicationIdentifier::Exe);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user