Implement block-out-from window rule, fix alpha on window screenshots

This commit is contained in:
Ivan Molodetskikh
2024-03-24 09:03:59 +04:00
parent 8b4a9d68e0
commit 493c8dc890
17 changed files with 218 additions and 50 deletions
+16
View File
@@ -699,6 +699,8 @@ pub struct WindowRule {
pub draw_border_with_background: Option<bool>,
#[knuffel(child, unwrap(argument))]
pub opacity: Option<f32>,
#[knuffel(child, unwrap(argument))]
pub block_out_from: Option<BlockOutFrom>,
}
// Remember to update the PartialEq impl when adding fields!
@@ -723,6 +725,12 @@ impl PartialEq for Match {
}
}
#[derive(knuffel::DecodeScalar, Debug, Clone, Copy, PartialEq, Eq)]
pub enum BlockOutFrom {
Screencast,
ScreenCapture,
}
#[derive(Debug, Default, PartialEq)]
pub struct Binds(pub Vec<Bind>);
@@ -915,6 +923,8 @@ impl From<niri_ipc::Action> for Action {
#[derive(knuffel::Decode, Debug, Default, PartialEq)]
pub struct DebugConfig {
#[knuffel(child, unwrap(argument))]
pub preview_render: Option<PreviewRender>,
#[knuffel(child)]
pub dbus_interfaces_in_non_session_instances: bool,
#[knuffel(child)]
@@ -931,6 +941,12 @@ pub struct DebugConfig {
pub emulate_zero_presentation_time: bool,
}
#[derive(knuffel::DecodeScalar, Debug, Clone, Copy, PartialEq, Eq)]
pub enum PreviewRender {
Screencast,
ScreenCapture,
}
impl Config {
pub fn load(path: &Path) -> miette::Result<Self> {
let _span = tracy_client::span!("Config::load");