Add config reloading for tiling exceptions

This commit is contained in:
Richard Weber 2024-09-04 20:40:41 +03:00 committed by Victoria Brekenfeld
parent 5fe9ba29eb
commit 5482ff65e5
3 changed files with 45 additions and 11 deletions

View file

@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-3.0-only
use cosmic_settings_config::shortcuts::action::Orientation;
use cosmic_settings_config::{shortcuts::action::Orientation, window_rules::ApplicationException};
use regex::{Regex, RegexSet};
use smithay::{
desktop::WindowSurface,
@ -9,8 +9,6 @@ use smithay::{
};
use tracing::warn;
use crate::config::Config;
use super::CosmicSurface;
pub mod floating;
@ -63,11 +61,11 @@ pub struct TilingExceptions {
}
impl TilingExceptions {
pub fn new(config: &Config) -> Self {
pub fn new(exceptions_config: &Vec<ApplicationException>) -> Self {
let mut app_ids = Vec::new();
let mut titles = Vec::new();
for exception in &config.tiling_exceptions {
for exception in exceptions_config {
if let Err(e) = Regex::new(&exception.appid) {
warn!("Invalid regex for appid: {}, {}", exception.appid, e);
continue;