mirror of
https://github.com/vincentbernat/i3wm-configuration.git
synced 2025-07-20 10:57:19 +02:00
i3-companion: use window current workspace for exclusivity check
This commit is contained in:
parent
81cdc7b40d
commit
65caa00117
1 changed files with 7 additions and 2 deletions
|
@ -317,11 +317,16 @@ async def worksplace_exclusive(i3, event):
|
||||||
logger.debug(f"window {w.name} can intrude")
|
logger.debug(f"window {w.name} can intrude")
|
||||||
return
|
return
|
||||||
|
|
||||||
# Does the current workspace contains an exclusive app?
|
# Get the workspace. From an event, w.workspace() is None, so
|
||||||
|
# search it in the tree.
|
||||||
tree = await i3.get_tree()
|
tree = await i3.get_tree()
|
||||||
workspace = tree.find_focused().workspace()
|
workspace = next(
|
||||||
|
(ow.workspace() for ow in tree.leaves() if w.id == ow.id), None
|
||||||
|
)
|
||||||
if not workspace:
|
if not workspace:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
# Does the target workspace contains an exclusive app?
|
||||||
ids = {
|
ids = {
|
||||||
s is not None and s.lower() or None
|
s is not None and s.lower() or None
|
||||||
for ow in workspace.leaves()
|
for ow in workspace.leaves()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue