noctuid / tdrop

A Glorified WM-Independent Dropdown Creator
BSD 2-Clause "Simplified" License
1.14k stars 45 forks source link

[Bspwm] [Dual monitor] cannot get terminal focus in another monitor #356

Open K1ngst0m opened 2 years ago

K1ngst0m commented 2 years ago

when wm get focused on A monitor's window, I want to toggle the popup terminal by tdrop in B monitor:

tdrop -a -w 1100 -h 550 -x 800 -y 520 kitty

but it will not automatically get focused on the popup terminal, but when focusing on the B monitor's window, its popup terminal will get focused successfully. and I already disabled mouse hover focus by

bspc config pointer_follows_focus false

output

noctuid commented 2 years ago

Do I understand correctly?

This sounds like an issue with bspwm or your configuration not with tdrop.

bspc config pointer_follows_focus false

That's the wrong option to set. I think you want to use bspc config focus_follows_pointer false instead (not sure what it is by default). Let me know if that fixes it.

Tdrop runs xdotool's windowactivate command. If it doesn't work with focus_follows_pointer disabled, there is nothing more tdrop can do. You can also try this but it probably won't help:

tdrop -a -w 1100 -h 550 -x 800 -y 520 --post-map-hook 'xdotool windowfocus $wid' kitty
K1ngst0m commented 2 years ago

thanks for your help.

This sounds like an issue with bspwm or your configuration not with tdrop.

bspc config pointer_follows_focus false

sorry I pasted the wrong command😅, I have bspc config focus_follows_pointer false in my bspwm config file.

If it doesn't work with focus_follows_pointer disabled, there is nothing more tdrop can do.

so I wonder why it won't work on the dual monitors? I used the tilda before, and it works well when doing the "focused" job, Are there any suggestions that I can fix this even by editing the tdrop source code? I really enjoy one terminal only in the system that I can focus on one configuration.

noctuid commented 2 years ago

so I wonder why it won't work on the dual monitors? I used the tilda before, and it works well when doing the "focused" job, Are there any suggestions that I can fix this even by editing the tdrop source code? I really enjoy one terminal only in the system that I can focus on one configuration.

I'm not sure how bspwm handles monitor focus. It sounds like it doesn't let you focus a window on another monitor. You can try these:

  1. Try the alternate command I posted before and let me know what happens
  2. Alternately, you can instead try changing tdrop line 457 to use windowfocus instead of windowactivate
  3. If you are okay with the dropdown always being shown on the focused monitor, adding the -m flag should work
K1ngst0m commented 2 years ago
tdrop -a -w 1100 -h 550 -x 800 -y 520 --post-map-hook 'xdotool windowfocus $wid' kitty

unfortunately, the result just worked the same as my first try.

when wm get focused on A monitor's window, I want to toggle the popup terminal by tdrop in B monitor:

I find out that the "focused" problem also happened when only my cursor moved to another monitor. and once tdrop receives the '-m' option, the problem is just gone. but "moving with focusing window's monitor" is not what I want, too. so currently it's a tradeoff.

thanks for the help really, and I will figure out how bspwm handles focus later and attempt to fix this problem.