about summary refs log tree commit diff
path: root/Completion/X/_x_window
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/X/_x_window')
-rw-r--r--Completion/X/_x_window13
1 files changed, 6 insertions, 7 deletions
diff --git a/Completion/X/_x_window b/Completion/X/_x_window
index 118c7f131..1862db9a7 100644
--- a/Completion/X/_x_window
+++ b/Completion/X/_x_window
@@ -1,19 +1,18 @@
 #autoload
 
-setopt localoptions extendedglob
-
 local list expl
 
-list=( "${(@)${(M@)${(@f)$(xwininfo -root -tree)}:#[ 	]#0x[0-9a-f]# \"*}##[ 	]#}" )
+_wanted windows || return 1
+
+list=( "${(@)${(M@)${(@f)$(_call windows xwininfo -root -tree)}:#[ 	]#0x[0-9a-f]# \"*}##[ 	]#}" )
 
 if [[ "$1" = -n ]]; then
   shift
 
-  _description expl 'window name'
-  compadd "$@" "$expl[@]" -d list - "${(@)${(@)list#*\"}%%\"*}"
+  _all_labels windows expl 'window name' \
+      compadd "$@" -d list - "${(@)${(@)list#*\"}%%\"*}"
 else
   [[ "$1" = - ]] && shift
 
-  _description expl 'window ID'
-  compadd "$@" "$expl[@]" -d list - "${(@)list%% *}"
+  _all_labels windows expl 'window ID' compadd "$@" -d list - "${(@)list%% *}"
 fi