Skip to content

Commit

Permalink
misc fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
fdev31 committed Jul 19, 2024
1 parent d455685 commit 5d100b5
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pyprland/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ async def _wrapper(self: Self, full_name: str, *args, **kwargs) -> bool:
if key == _dedup_last_call.get(full_name):
return True
_dedup_last_call[full_name] = key
return await fn(self, full_name, *args, **kwargs)
return cast(bool, await fn(self, full_name, *args, **kwargs))

return _wrapper

Expand Down
1 change: 1 addition & 0 deletions pyprland/plugins/scratchpads/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -793,6 +793,7 @@ async def _handle_focus_tracking(self, scratch: Scratch, active_window: str, act
if tracker and not tracker.prev_focused_window_wrkspc.startswith("special:"):
same_workspace = tracker.prev_focused_window_wrkspc == active_workspace
client = next(filter(lambda d: d.get("address") == tracker.prev_focused_window, clients), None)
assert client
if (
scratch.have_address(active_window)
and same_workspace
Expand Down
8 changes: 5 additions & 3 deletions pyprland/plugins/scratchpads/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class Scratch(CastBoolMixin): # {{{
uid = ""
monitor = ""
pid = -1
excluded_scratches = []
excluded_scratches: list[str] = []

def __init__(self, uid: str, opts: dict[str, Any]) -> None:
self.uid = uid
Expand All @@ -62,7 +62,7 @@ def forced_monitor(self) -> str | None:
"""Returns forced monitor if available, else None."""
forced_monitor = self.conf.get("force_monitor")
if forced_monitor in state.monitors:
return forced_monitor
return cast(str, forced_monitor)
return None

def set_config(self, opts: dict[str, Any]) -> None:
Expand Down Expand Up @@ -99,7 +99,9 @@ async def initialize(self, ex: "_scratchpads_extension_m.Extension") -> None:
if self.have_command:
await self.update_client_info()
else:
self.client_info = await self.fetch_matching_client()
m_client = await self.fetch_matching_client()
if m_client:
self.client_info = m_client
assert self.client_info, "couldn't find a matching client"
await ex.hyprctl(f"movetoworkspacesilent special:scratch_{self.uid},address:{self.full_address}")
if "class_match" in self.conf: # NOTE: legacy, to be removed
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-45"
VERSION = "2.4.0-46"

0 comments on commit 5d100b5

Please sign in to comment.