Re: Fixing Firefox focus stealing
Hi all, I created an helper function to make this kind of use case easier to handle https://github.com/awesomeWM/awesome/pull/1123 Please test. On 28 September 2016 at 10:39, Abraham Baker wrote: > That setting also helps if you're using an external RSS feed reader (e.g. > newsbeuter) to help avoid switching focus back to FF when opening links. > > > Abe > > > From: Jan Larres > Sent: Tuesday, September 27, 2016 11:55:44 PM > To: [email protected] > Subject: Re: Fixing Firefox focus stealing > > > A better option for Firefox specifically is to set the > "browser.tabs.loadDivertedInBackground" option to "true" in about:config, > which stops Firefox from trying to grab the focus when loading a URL > remotely. > > -Jan > > > -- > To unsubscribe, send mail to [email protected]. -- To unsubscribe, send mail to [email protected].
Re: Fixing Firefox focus stealing
That setting also helps if you're using an external RSS feed reader (e.g. newsbeuter) to help avoid switching focus back to FF when opening links. Abe From: Jan Larres Sent: Tuesday, September 27, 2016 11:55:44 PM To: [email protected] Subject: Re: Fixing Firefox focus stealing A better option for Firefox specifically is to set the "browser.tabs.loadDivertedInBackground" option to "true" in about:config, which stops Firefox from trying to grab the focus when loading a URL remotely. -Jan -- To unsubscribe, send mail to [email protected].
Re: Fixing Firefox focus stealing
A better option for Firefox specifically is to set the "browser.tabs.loadDivertedInBackground" option to "true" in about:config, which stops Firefox from trying to grab the focus when loading a URL remotely. -Jan -- To unsubscribe, send mail to [email protected].
Re: Fixing Firefox focus stealing
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Hi, Am 12.09.2016 um 20:45 schrieb martin f. krafft: > also sprach Uli Schlachter [2016-09-12 17:25 +0200]: Heh, ich mag die Art von Zitat. :-) >>> If I have Firefox (v45) and a terminal on the same tag, and I run >>> "firefox http://debian.org"; in the terminal, Debian's website opens in >>> a new tab in Firefox (good!), *and* focus is shifted to that window >>> (bad!). >> [...] >>> How can I find out what causes the focus shift? >> >> Sounds like awesome sends a _NET_ACTIVE_WINDOW request. > > I don't really know enough about X or whatever to make sense of that, but > ok. Whoops, I meant "firefox sends...". Basically, firefox says "dear window manager, please give me the input focus". >>> What can be done to prevent this behaviour? >> >> Write your own handler for such requests. The following (untested) code >> *might* help: > > It worked out of the box for the main window! \o/ THANK YOU SO MUCH! > > Now the next task will be to make its dialogs not disturb me. These also > go through ewmh.activate with context == "autofocus.check_focus" and that > makes me think there's a better way to disable the autofocus… so much to > learn… Autofocus is awful.autofocus aka /usr/share/awesome/lib/awful/autofocus.lua. It's quite a short file. The idea of that code is "if nothing has the input focus (or the currently focused window is not visible), then give the focus to the window that last had the focus". So the dialogs already had the focus previously, but then 'something' happened. At least I'm pretty sure that awful.autofocus is not where this issue actually occurs. Quick test would be to "mkdir ~/.config/awesome/awful && touch ~/.config/awesome/awful/autofocus.lua" to force-disable autofocus. Sorry that I don't have a better idea for this right now. Cheers, Uli - -- “Some people are worth melting for.” - Olaf -BEGIN PGP SIGNATURE- Version: GnuPG v2 iQEcBAEBCAAGBQJX1wbgAAoJECLkKOvLj8sG5CYH/3TxqMtyO4GWuHOnbY+EW0LK 3sGRWZa+C+kLz0tfZv4ksbV+YoLTQ1TWY1BhJx1cirJzboXbyLoqz5z2rslQGCPE xtYGnkJ1i9+cIXFPw/6dWzm3Crb5NXb+hHgf47rTrJlfkbz+ERvrPsMp7GJ/LjTk qUEPx4ViWu1fn4v9clIYU3/ynIrsMH/re0A34mgLmKXXmuK7MqEJ5DBF+jBwLEVT +uN/kDsS3wogOQuaxROGX5J2H3nQhuWw72X8XgeUdcQtPEEaSqh07XrA747SDxRn txJzhshFUSiQFQavxED2RnTSh2/Xc98bN58MDMtlLnwXp7/aIn5cXgJ6s89D8Hc= =wkdO -END PGP SIGNATURE- -- To unsubscribe, send mail to [email protected].
Re: Fixing Firefox focus stealing
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256
Hi,
Am 12.09.2016 um 16:39 schrieb martin f krafft:
[...]
> If I have Firefox (v45) and a terminal on the same tag, and I run "firefox
> http://debian.org"; in the terminal, Debian's website opens in a new tab in
> Firefox (good!), *and* focus is shifted to that window (bad!).
[...]
> How can I find out what causes the focus shift?
Sounds like awesome sends a _NET_ACTIVE_WINDOW request.
> What can be done to prevent this behaviour?
Write your own handler for such requests. The following (untested) code
*might* help:
client.disconnect_signal("request::activate", awful.ewmh.activate)
client.connect_signal("request::activate", function(c, context, hints)
if c.class == "Firefox" -- This is wrong for sure, but you get the idea
and context == "ewmh" -- The request came from _NET_ACTIVE_WINDOW
then
-- Just ignore the request
return
end
awful.ewmh.activate(c, context, hints)
end)
I don't know right know what class Firefox uses. If you just want to kill
_NET_ACTIVE_WINDOW completely, then leave out the check for firefox and ignore
context = "ewmh" all together.
Cheers,
Uli
- --
Bitte nicht mit dem verbleibenden Auge in den Laser gucken.
- Vincent Ebert
-BEGIN PGP SIGNATURE-
Version: GnuPG v2
iQEcBAEBCAAGBQJX1sjZAAoJECLkKOvLj8sGIPAIAJIL+NGF6/s2iV36CVEPsApn
yzQQeVGWM8kFZ8FU3SZfhvw2sAe9TTNO4bhydGinbb8AHvfBLNyqdFKV3RevXow9
9q2VctspAtlfCF2k4uXV3IUjMLz3/az2K397KvRecy1WidE8rxCO38zQz0aIzGG8
0gSc0OSfCnmN7SDM+whZejfhtLCCcLKIg0tD6W+D5C3CqFLfrlbnHtt67pN/JsOF
WiLHjCUic23eCT0nT6/gmcpXKqwsRSGkDPXEBjMheaQyVZ+8uEKj8Of/+Y6B9l76
nyMN1F1D6FRcV++20vLzkWPN1of5B5kHCw0xWIZKadvnWorMCYQ6WIHaX98GIcs=
=9EMz
-END PGP SIGNATURE-
--
To unsubscribe, send mail to [email protected].
Fixing Firefox focus stealing
Hello, I've recently switched to running Git master (@g39aace5) after years of sticking with 3.4.15, as I didn't want to redo most of my config. The main motivation for the switch was that I was told that the most annoying behaviour of Firefox to steal my focus whenever a URL is loaded was fixed 6 years ago. So now my config is migrated and I feel much better about it, but the Firefox bug persists! :( If I have Firefox (v45) and a terminal on the same tag, and I run "firefox http://debian.org"; in the terminal, Debian's website opens in a new tab in Firefox (good!), *and* focus is shifted to that window (bad!). If Firefox is not visible at the time, it does not get focused, but instead marked urgent (the property::urgent signal fires). HOWEVER, the signal does *NOT* fire when Firefox is on the same tag and already visible. Instead, focus is shifted directly. I can't seem to tell this piece-of-junk Firefox to simply stop pretending to be so important, so now I am wondering whether and how Awesome can help!? How can I find out what causes the focus shift? What can be done to prevent this behaviour? Please do note that I'd like to stay clear of hacks such as https://awesomewm.org/wiki/Workaround_plugins_that_steal_the_keyboard_focus (i.e. restoring the focus), but instead just prevent the wrong behaviour altogether. Thanks, -- @martinkrafft | http://madduck.net/ | http://two.sentenc.es/ "the surest way to corrupt a youth is to instruct him to hold in higher esteem those who think alike than those who think differently." -- friedrich nietzsche spamtraps: [email protected] digital_signature_gpg.asc Description: Digital GPG signature (see http://martin-krafft.net/gpg/sig-policy/999bbcc4/current)
