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

@ -603,11 +603,18 @@ wid_toggle() {
fi fi
if $exists; then if $exists; then
if [[ $visibility == IsUnMapped ]]; then if [[ $visibility == IsUnMapped ]]; then
# 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 if [[ $program == current ]]; then
map_pre_command "$(< /tmp/tdrop/current"$num"_type)" map_pre_command "$(< /tmp/tdrop/current"$num"_type)"
else else
map_pre_command "$program" map_pre_command "$program"
fi fi
else
xdotool windowactivate "$wid"
fi
# update here if possible so this doesn't cause a delay # update here if possible so this doesn't cause a delay
# between the window being remapped and resized # between the window being remapped and resized
if $monitor_aware; then if $monitor_aware; then

Loading…
Cancel
Save