Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sometimes windows don't flash IF they gained focus because another window was closed. #8

Open
qwertea opened this issue Apr 14, 2018 · 9 comments

Comments

@qwertea
Copy link

qwertea commented Apr 14, 2018

It flashes like 50% of the time, but when it doesn't, it'll flash if you click anywhere in it, which is kinda annoying. Here's a screen recording showing it.

I'm using bspwm, didn't test on anything else.

@qwertea
Copy link
Author

qwertea commented Apr 14, 2018

Also trying to run it in debug mode with -d or --debug makes it crash with this output:

$ flashfocus -d
INFO:root:Initializing with parameters:
INFO:root:{'debug': True, 'simple': False, 'ntimepoints': 10, 'time': 0.5, 'default_opacity': 1.0, 'opacity': 0.8}
INFO:root:Computing flash series from 0.8 to 1.0
INFO:root:Computed flash series = [0.8, 0.8200000000000001, 0.8400000000000001, 0.86, 0.88, 0.9, 0.92, 0.94, 0.96, 0.98]
INFO:root:FlashServer attributes: {'locked_windows': set(), 'flasher': <flashfocus.server.Flasher object at 0x7f90fde392e8>, 'prev_focus': None, 'producers': [<Thread(Thread-1, initial)>, <Thread(Thread-2, initial)>], 'target_windows': <queue.Queue object at 0x7f90faab3ac8>, 'xconn': <flashfocus.xutil.XConnection object at 0x7f90faab3ba8>, 'sock': <socket.socket fd=7, family=AddressFamily.AF_UNIX, type=2050, proto=0, laddr=/run/user/1000/flashfocus_socket>, 'keep_going': True}

@fennerm
Copy link
Owner

fennerm commented Apr 14, 2018

Thanks for filing this issue. Just to confirm that I'm understanding you, this is only occurring when you close a window correct?

Could you possibly generate a logfile for me? To do so, make sure that no other flashfocus instance is running, then run flashfocus 2> debug.log. It would be ideal if you could get the bug to occur while you're logging.

@fennerm
Copy link
Owner

fennerm commented Apr 14, 2018

Oh also, does bspwm automatically switch your focus when you close windows?

@qwertea
Copy link
Author

qwertea commented Apr 14, 2018

this is only occurring when you close a window correct?

Oh also, does bspwm automatically switch your focus when you close windows?

Yes & Yes.

Here's a log and here's a recording of the output as the bug happens. Thanks for the quick response, btw.

@qwertea
Copy link
Author

qwertea commented Apr 14, 2018

Okay, I apologise for spamming recordings but I got a weird message in the output while messing around, Hopefully it's useful.

@fennerm
Copy link
Owner

fennerm commented Apr 14, 2018

Thanks for the detailed info! I think I know whats going on. Working on a fix now, I'll let you know when its up.

@fennerm
Copy link
Owner

fennerm commented Apr 14, 2018

So I fixed the uncaught exception but I think its probably a red herring.

I failed to reproduce with a stock bspwm setup on my machine. It seems like for whatever reason, the _NET_ACTIVE_WINDOW property isn't getting updated when you close windows sometimes, so flashfocus can't detect that you shifted focus.

Hard to debug from here but a couple of possibilities off the top of my head:

  • You have something weird in your config.
  • There's some latency/bug in Xorg or bspwm which is causing _NET_ACTIVE_WINDOW to not get updated occasionally.

If you want to pursue this further, I'd advise making sure you're fully updated, then trying again with default compton + bspwm config files.

Thanks :)

@qwertea
Copy link
Author

qwertea commented Apr 15, 2018

Okay, you're right, it's not happening with stock configs. I managed to trace it down to a single option in my bspwm config: bspc config focus_follows_pointer true It only happens when that option is on (even if you don't touch the mouse at all) If you enable that on a stock config, it starts happening. Unfortunately though, I don't think I can live without that option. Thanks for your help.

@fennerm
Copy link
Owner

fennerm commented Apr 15, 2018

Interesting, thanks for tracking that down. I'll look into this a bit, this seems like a weird and perhaps unintended behaviour on bspwm's part.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants