From 41b85296382b01ba3730e69b773b3efbe596c4f6 Mon Sep 17 00:00:00 2001 From: fdev31 Date: Sat, 28 Sep 2024 00:51:36 +0200 Subject: [PATCH] for inheritance --- pyprland/plugins/scratchpads/objects.py | 20 ++++++++++++-------- pyprland/version.py | 2 +- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/pyprland/plugins/scratchpads/objects.py b/pyprland/plugins/scratchpads/objects.py index d62116c..3bc6f5c 100644 --- a/pyprland/plugins/scratchpads/objects.py +++ b/pyprland/plugins/scratchpads/objects.py @@ -67,8 +67,10 @@ def forced_monitor(self) -> str | None: def set_config(self, full_config: dict[str, Any]) -> None: """Apply constraints to the configuration.""" opts = {} - if "inherit" in opts: - inheritance = opts["inherit"] + orig_config = full_config[self.uid] + # apply inheritance + if "inherit" in orig_config: + inheritance = orig_config["inherit"] if isinstance(inheritance, str): inheritance = [inheritance] for source in inheritance: @@ -78,21 +80,23 @@ def set_config(self, full_config: dict[str, Any]) -> None: text = f"Scratchpad {self.uid} tried to inherit from {source}, but it doesn't exist" self.log.exception(text) - opts.update(full_config[self.uid]) + # apply specific config + opts.update(orig_config) + # apply the config + self.conf = opts + + # apply constraints if self.cast_bool(opts.get("preserve_aspect")): opts["lazy"] = True - if not opts.get("process_tracking", True): + elif not opts.get("process_tracking", True): opts["lazy"] = True if "match_by" not in opts: opts["match_by"] = "class" if state.hyprland_version < VersionInfo(0, 39, 0): opts["allow_special_workspace"] = False - - self.conf = opts - if not self.have_command: - self.conf["match_by"] = "class" + opts["match_by"] = "class" def have_address(self, addr: str) -> bool: """Check if the address is the same as the client.""" diff --git a/pyprland/version.py b/pyprland/version.py index f37a375..6128166 100644 --- a/pyprland/version.py +++ b/pyprland/version.py @@ -1,3 +1,3 @@ """Package version.""" -VERSION = "2.4.0-55" +VERSION = "2.4.0-56"