Fix bug where wasn't getting wid for newly created dropdowns

for potential use with a map_post_command. Also, don't use a
map_post_command when making the current window a dropdown and
instead unmap it.
long-opts
angelic-sedition 10 years ago
parent 07b526efed
commit b584f00fd9

16
tdrop

@ -295,6 +295,7 @@ current_create() {
wid=$(xdotool getactivewindow)
echo "$wid" > /tmp/tdrop/current"$num"
get_class_name "$wid" > /tmp/tdrop/current"$num"_type
echo "$wid"
}
wid_toggle() {
@ -329,14 +330,25 @@ wid_toggle() {
# make it
map_pre_command "$term"
if [[ $term == current ]]; then
current_create
elif $normal_window; then
wid=$(current_create)
xdotool windowunmap "$wid"
else
if $normal_window; then
win_create
else
term_create
fi
# get saved wid of newly created dropdown
wid=""
count=0
while [[ -z $wid ]] && [[ $count -lt 100 ]]; do
wid=$(< /tmp/tdrop/"$term$num")
sleep 0.01
((count++))
done
map_post_command oneshot "$wid"
fi
fi
}
#

Loading…
Cancel
Save