Ce site disposera de fonctionnalités limitées pendant que nous effectuons des opérations de maintenance en vue de vous proposer un meilleur service. Si un article ne règle pas votre problème et que vous souhaitez poser une question, notre communauté d’assistance est prête à vous répondre via @FirefoxSupport sur Twitter, et /r/firefox sur Reddit.

Rechercher dans l’assistance

Évitez les escroqueries à l’assistance. Nous ne vous demanderons jamais d’appeler ou d’envoyer un SMS à un numéro de téléphone ou de partager des informations personnelles. Veuillez signaler toute activité suspecte en utilisant l’option « Signaler un abus ».

En savoir plus

Preventing Focus Stealing When Restoring Session

  • 3 réponses
  • 1 a ce problème
  • 17 vues
  • Dernière réponse par cor-el

more options

I am using Firefox 115.3 on Debian 12.1. I have numerous tasks which require the use of my web browser and have allocated a different virtual desktop for each. This means that my browser session typically has several dozen tabs open in numerous windows at one time. Under normal circumstances, this works just fine (and is a testament to the engineering that has gone into this browser).

My issue is that Firefox renders my machine virtually unusable for a few minutes each time I restart my desktop session due to focus stealing. When I open the browser, several dozen windows pop up (as expected) and relocate to their correct virtual desktops (as expected); however, as the windows begin to load, the most recently active Firefox window steals focus repeatedly. If I am, for instance, in the process of typing my password into my desktop e-mail client, a Firefox window may steal focus from the password dialog. In practice, this focus steal happens once every few seconds for several minutes.

I would prefer that Firefox would not steal focus while restoring a session. Does anyone have any suggestions for correcting this issue?

I am using Firefox 115.3 on Debian 12.1. I have numerous tasks which require the use of my web browser and have allocated a different virtual desktop for each. This means that my browser session typically has several dozen tabs open in numerous windows at one time. Under normal circumstances, this works just fine (and is a testament to the engineering that has gone into this browser). My issue is that Firefox renders my machine virtually unusable for a few minutes each time I restart my desktop session due to focus stealing. When I open the browser, several dozen windows pop up (as expected) and relocate to their correct virtual desktops (as expected); however, as the windows begin to load, the most recently active Firefox window steals focus repeatedly. If I am, for instance, in the process of typing my password into my desktop e-mail client, a Firefox window may steal focus from the password dialog. In practice, this focus steal happens once every few seconds for several minutes. I would prefer that Firefox would not steal focus while restoring a session. Does anyone have any suggestions for correcting this issue?

Toutes les réponses (3)

more options

Changing /org/gnome/desktop/wm/preferences/focus-new-windows to strict on Ubuntu 23.10 makes windows open in the background for me.

more options

I appreciate the suggestion!

First: I'm using XFCE as my desktop environment. I know there's an XFCE equivalent to the setting that you describe. But second: I *do* want focus to be taken under normal circumstances. It's just during Firefox's startup that I don't want continuous focus stealing.

It turns out that the windows that are stealing focus aren't *new*, either. When I first open Firefox, a few dozen windows pop up immediately (to recover my previous session). The fact that these windows steal focus in the second or two after I start Firefox makes sense to me given my desktop settings. But, for some reason, those windows keep *refocusing* as they start their page load cycles. It is this refocusing behavior that makes my environment unusable and that I would like to prevent.

Thanks again for the response, though. If one is entirely opposed to focus stealing in Gnome, it seems likely that the setting adjustment you describe would do the job.

more options

You can set all tabs to open on demand to avoid that Firefox changes focus to them as they are loading, this also speeds up the startup time.

  • browser.sessionstore.restore_on_demand = true
  • browser.sessionstore.restore_pinned_tabs_on_demand = true