Move dropdown when it is open on another desktop

For most WMs (awesome is an exception), windows that are open on another
desktop are reported as unmapped which causes nothing to happen if a
tdrop command is run (unmapping/mapping don't work in this case). Moving
a dropdown to the current desktop is possible with xdotool though
(basically the same as wmctrl's -R). This is a temporary solution that
may be need to be refined in the future. A potential issue is whether
pre/post map hooks should be run in this case (e.g. rules should not be
added again for bspwm). This could be fixed later by actually unmapping
the window or by adding more specific hooks. Addresses #21.
break
noctuid 8 years ago
parent 9609e25621
commit 2937b69f11

13
tdrop

@ -603,10 +603,17 @@ wid_toggle() {
fi
if $exists; then
if [[ $visibility == IsUnMapped ]]; then
if [[ $program == current ]]; then
map_pre_command "$(< /tmp/tdrop/current"$num"_type)"
# visibility will be IsUnMapped on most WMs if the dropdown is open
# on another desktop
xdotool set_desktop_for_window "$wid" "$(xdotool get_desktop)"
if [[ $(get_visibility "$wid") == IsUnMapped ]]; then
if [[ $program == current ]]; then
map_pre_command "$(< /tmp/tdrop/current"$num"_type)"
else
map_pre_command "$program"
fi
else
map_pre_command "$program"
xdotool windowactivate "$wid"
fi
# update here if possible so this doesn't cause a delay
# between the window being remapped and resized

Loading…
Cancel
Save