mirror of
https://github.com/yshui/picom.git
synced 2025-02-10 15:45:57 -05:00
picom-trans: fixes when setting transparency with window id
Two problems: 1) the regex used to match the wid in the window tree can match the wid appearing in window titles as well. 2) instead of picking the parent window of the target window to set transparency, a random window which is listed just below the target window will be chosen. not sure why was there a + 1. Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
parent
933f2cfe80
commit
5207996232
1 changed files with 2 additions and 2 deletions
|
@ -160,7 +160,7 @@ else
|
|||
fi
|
||||
|
||||
# Find the line number of the target window in the window tree
|
||||
lineno=$(echo -n "$treeout" | grep -nw "$wid" | head -n1 | cut -d ':' -f 1)
|
||||
lineno=$(echo -n "$treeout" | grep -nw "^\s*$wid" | head -n1 | cut -d ':' -f 1)
|
||||
|
||||
if test -z "$lineno"; then
|
||||
echo 'Failed to find window in window tree.'
|
||||
|
@ -169,7 +169,7 @@ else
|
|||
|
||||
# Find the highest ancestor of the target window below
|
||||
topmost=$(echo -n "$treeout" \
|
||||
| head -n $((lineno + 1)) \
|
||||
| head -n $lineno \
|
||||
| sed -n 's/^ \(0x[[:xdigit:]]*\).*/\1/p' \
|
||||
| tail -n 1)
|
||||
fi
|
||||
|
|
Loading…
Add table
Reference in a new issue