From a5bd168ce471c43199693e4e302c26933dae0fa5 Mon Sep 17 00:00:00 2001 From: noctuid Date: Mon, 4 Jan 2016 17:29:31 -0500 Subject: [PATCH] For -m, only get monitor info when creating and remapping Previously, if the dropdown was unmapped from another monitor and then remapped on that monitor, the dropdown would not be resized since the unmapping would change the stored "last_monitor". --- tdrop | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tdrop b/tdrop index 0952981..0e50aff 100755 --- a/tdrop +++ b/tdrop @@ -513,6 +513,11 @@ wid_toggle() { else map_pre_command "$term" fi + # update here so this doesn't cause a delay + # between the window being remapped and resized + if $multiple_monitors; then + update_geometry_settings_for_monitor + fi if ! $combine_map_post; then xdotool windowmap "$wid" map_post_command "$wid" @@ -532,6 +537,10 @@ wid_toggle() { xdotool windowunmap "$wid" fi else + # necessary to deal with negative width or height + if $multiple_monitors; then + update_geometry_settings_for_monitor + fi # make it map_pre_command "$term" local wid @@ -698,9 +707,6 @@ if [[ -n $1 ]]; then elif [[ $term == auto_show ]]; then auto_show else - if $multiple_monitors; then - update_geometry_settings_for_monitor - fi wid_toggle fi else