Skip to content

Commit

Permalink
for inheritance
Browse files Browse the repository at this point in the history
  • Loading branch information
fdev31 committed Sep 27, 2024
1 parent 442f9cc commit 41b8529
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
20 changes: 12 additions & 8 deletions pyprland/plugins/scratchpads/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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."""
Expand Down
2 changes: 1 addition & 1 deletion pyprland/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""Package version."""

VERSION = "2.4.0-55"
VERSION = "2.4.0-56"

0 comments on commit 41b8529

Please sign in to comment.