mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-07-10 23:22:43 +02:00
feature(wm): manage linux gui apps by default
This commit introduces an allow_wsl2_gui override in Window.should_manage() which ensures that Linux GUI apps being run through WSLg, VcXsrv or X410 will be automatically tiled. For now the exes that trigger this override are kept in a static Vec in the codebase, but this could be made configurable in the future if there is a specific feature request. resolve #52, resolve #53
This commit is contained in:
@@ -74,6 +74,11 @@ lazy_static! {
|
|||||||
static ref MANAGE_IDENTIFIERS: Arc<Mutex<Vec<String>>> = Arc::new(Mutex::new(vec![]));
|
static ref MANAGE_IDENTIFIERS: Arc<Mutex<Vec<String>>> = Arc::new(Mutex::new(vec![]));
|
||||||
static ref FLOAT_IDENTIFIERS: Arc<Mutex<Vec<String>>> = Arc::new(Mutex::new(vec![]));
|
static ref FLOAT_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 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![
|
||||||
|
"X410.exe".to_string(),
|
||||||
|
"mstsc.exe".to_string(),
|
||||||
|
"vcxsrv.exe".to_string(),
|
||||||
|
]));
|
||||||
}
|
}
|
||||||
|
|
||||||
pub static CUSTOM_FFM: AtomicBool = AtomicBool::new(false);
|
pub static CUSTOM_FFM: AtomicBool = AtomicBool::new(false);
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ use crate::FLOAT_IDENTIFIERS;
|
|||||||
use crate::HIDDEN_HWNDS;
|
use crate::HIDDEN_HWNDS;
|
||||||
use crate::LAYERED_EXE_WHITELIST;
|
use crate::LAYERED_EXE_WHITELIST;
|
||||||
use crate::MANAGE_IDENTIFIERS;
|
use crate::MANAGE_IDENTIFIERS;
|
||||||
|
use crate::WSL2_UI_PROCESSES;
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy)]
|
#[derive(Debug, Clone, Copy)]
|
||||||
pub struct Window {
|
pub struct Window {
|
||||||
@@ -271,11 +272,15 @@ impl Window {
|
|||||||
layered_exe_whitelist.contains(&exe_name)
|
layered_exe_whitelist.contains(&exe_name)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let allow_wsl2_gui = {
|
||||||
|
let wsl2_ui_processes = WSL2_UI_PROCESSES.lock();
|
||||||
|
wsl2_ui_processes.contains(&exe_name)
|
||||||
|
};
|
||||||
|
|
||||||
let style = self.style()?;
|
let style = self.style()?;
|
||||||
let ex_style = self.ex_style()?;
|
let ex_style = self.ex_style()?;
|
||||||
|
|
||||||
if style.contains(GwlStyle::CAPTION)
|
if (allow_wsl2_gui || style.contains(GwlStyle::CAPTION) && ex_style.contains(GwlExStyle::WINDOWEDGE))
|
||||||
&& ex_style.contains(GwlExStyle::WINDOWEDGE)
|
|
||||||
&& !ex_style.contains(GwlExStyle::DLGMODALFRAME)
|
&& !ex_style.contains(GwlExStyle::DLGMODALFRAME)
|
||||||
// Get a lot of dupe events coming through that make the redrawing go crazy
|
// Get a lot of dupe events coming through that make the redrawing go crazy
|
||||||
// on FocusChange events if I don't filter out this one. But, if we are
|
// on FocusChange events if I don't filter out this one. But, if we are
|
||||||
|
|||||||
Reference in New Issue
Block a user