diff --git a/bin/picom-trans b/bin/picom-trans index 6b1d1df..331487c 100755 --- a/bin/picom-trans +++ b/bin/picom-trans @@ -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