Firefox - doesn't raise window after clicking a link on Wayland

After the latest update, I noticed, that clicking on links is no longer raising the window. I need to make additional action to get the Firefox window.

For work, I need to click many links, from mails, other apps and I need it to open the site immediately. The fact that I now have an intermediate step is irritating and tiring.

Is there a way to fix it?

I checked Wayland and X11 and the issue is happening in both sessions.

Any ideas?

1 Like

I didn’t notice any changes to tab opening when Firefox activated native Wayland (I’ve been running Wayland full-time for a couple of years now). However, I was finally able to remove a couple of Mozilla Wayland-specific settings from my .bashrc file though:

Regarding tabs not opening in the foreground, I would recommend that you visit about:config in Firefox to access advanced preferences, then enter inbackground in the filter bar, and make sure that browser.tabs.loadDivertedInBackground and browser.tabs.loadInBackground are set to false.

You might also want to install plasma-browser-integration from the Manjaro repos (if not already installed) and add the Plasma Integration addon to Firefox. I don’t think they will impact your issue of tabs not opening in the foreground, but they will make Firefox work better with the Plasma desktop environment.

2 Likes

So when you click on links from mail (Thunderbird), documents (pdf’s, odt) apps it raises the FF window to the top for you?

I checked the about:config, and it is set to false, as you said. Also, I already have plasma-browser-integration and it’s activated in FF.

So why did it change? I mean, why is FF is not raised on link click?

EDIT: I checked on X11 and the situation is the same! It means, it has nothing to do with Wayland. So what on earth could cause it, and how to fix it?

EDIT 2: I checked different browser (Chromium) and it is raised to the top after clicking a link. So this is Firefox issue.

EDIT 3: I checked the test user with default settings and the same issue happens there. I mean, it is not a config problem. So if FF works fine for you and the others, it means that there is something specific on my system that is causing this strange behavior, and it’s not in the user space…

EDIT 4: To explain the issue more:

Open Firefox, minimize it or raise another app on top, preferably Thunderbird but it also can be Libre Office Writer, where you add some link. Click on the link. I expect the FF window to be raised on top, but instead, it becomes alerted but not raised.

Here is how it looks on the system panel::

Screenshot_20240110_171226

In the screenshot above, FF is minimized. If it was maximized but behind some window, it would have gray stripe.

After clicking a link, it should go to the top and have the blueish stripe and background (like Thunderbird in the screen above), but instead, it becomes “alerted” (from lack of better word) which makes it red, meaning that the app is trying to focus my attention that something is change and I should raise it to the top.

Screenshot_20240110_171122

It is as if something was actively preventing it to be raised to the top of the windows.

not sure if you are using KDE and if my suggestion is related:
KDE seem to have settings for Focus and raising windows:
https://docs.kde.org/stable5/en/kwin/kcontrol/windowbehaviour/index.html

Thanks @linub, I do use KDE. I do have some special setting for other FF session (installed YT app) to be kept on top), but it has no influence on the regular Firefox session and its window. To test it, I deleted that rule and nothing happened. The issue is still there.

I looked at the possible Kwin rules to fix this issue and there is one that is called “Activation protection” but no matter what I set, nothing changes, the issue is still there. Other than that, there is nothing there that would fix it. This is strange because it happens only for Firefox, also on other users, as if it was some global thing.

I wonder, if this is linked to some weird issues that I noticed lately, like:

  • lack of cursor (it works normally but sometimes cursor in text boxes becomes invisible, just like it happened during writing this replay)
  • sites or apps where you can upload files suddenly think I want to drop the files, which is annoying and needs an app restart or site reload to be fixed

Those issues showed up in the last two weeks, similarly with the FF raise problem.

I checked the Firefox behavior on completely different computer (also with Manjaro and Plasma) and Firefox behaves exactly in the same way and that system is basically very vanilla, no custom changes.

Can some check it how it works on their system? Just click a link in some other browser, while FF is the default one. Optionally, the link can be in a mailing app or in a document.

Maybe this is time to report it to Mozlilla?

https://bugs.kde.org/show_bug.cgi?id=424795#c32

1 Like

Thanks, @medmedin, but this is a very old issue and for me, it concerns only Firefox (both X11 and Wayland) and only since 2 weeks or so. Chromium is raising to the top without problems when I made it default.

I created a bug report on Mozilla and will see if it brings me any further:

This may be Plasma or Arch, or Manjaro problem. So far, two different Manjaro installs with Plasma have this issue.

I’m on Plasma X11, it works fine for me (FF is raised and brought to foreground). Also tested clicking a link from Steam client, that works too. I’m afraid I have no idea what could be causing this problem for you.

I have same problem on Arch (with Plasma and wayland). :man_shrugging:

Huh, I can not reproduce the problem on KDE Wayland. :thinking:
I guess, something is messed up in your system.

Thanks for your input. So this is inconsistent. Even weirder.

I just changed browser.tabs.loadDivertedInBackground in my Firefox back to “false” & clicked on a link in the Pamac GUI - Firefox immediately came to the foreground. So I am in agreement with others here that it is not a general Firefox on Plasma issue.

Maybe it is a recent add-on update preventing focus-stealing? Try opening Firefox in safe mode (from a terminal run firefox --safe-mode) to launch the browser with all add-ons temporarily disabled. See if clicking a link in another application returns Firefox to the foreground.

If it doesn’t, and you are certain that your Plasma settings are not the issue, the other Firefox problems you mentioned has me wondering if a full reset of Firefox might be in order (firefox --safe-mode => reset). Edit: Going to about:support will also give options to Refresh Firefox (reset) or Troubleshoot (I imagine that is probably safe-mode). Refreshing/resetting will lose your settings & add-ons, but your logins/passwords etc will be preserved.

System Settings > Window Management > Window Behavior > Focus > Focus stealing prevention: None
on X11 seems to work fine
(tested opening hyperlink from libreoffice)

Weirdly, on Pamac, it does work with the FIRST click. On further ones, FF wasn’t raised to the foreground.

I also noticed, that when FF is not opened, it comes to foreground. But when it’s already open and in background, it doesn’t.

I did try safe mode without add-ons, didn’t help. I also tried vanilla FF on vanilla user, still the same problem. The fact that some others have this, and I can replicate it on vanilla Manjaro KDE stable, shows that this is something beyond configs. Still, it is puzzling why this is inconsistent, and some users have it, others don’t. This may be a matter of having a certain package or not.

Plasma settings haven’t changed, but if I experiment with settings like @cscs showed, still get me nowhere. This Firefox behavior is annoyingly persistent.

When I find time, I will try to use live system and see how FF behaves there.

There is a new development.

I checked:

  • Windows10: no issue
  • Linux Mint X11 session: no issue
  • Manjaro KDE live X11 session: no issue
  • Manjaro KDE live Wayland session: issue confirmed
  • Manjaro KDE different OS install (on different computer), Wayland session: issue confirmed

Everyone here who confirmed this issue mentioned that they were running Wayland.

Although it seems that the problem for me extends to X11 (or maybe I checked it incorrectly?), it looks like Wayland is the problem, or more accurately, the Firefox Wayland implementation is here at fault. It confirms my observation, that prior 121, there was no issue, because Firefox was running as XWayland app, not native Wayland like it is now.

Moreover, Chromium works as XWayland app and don’t have this issue, which suggests strongly that Wayland here is somehow at fault.

Now, there are three possibilities:

  1. There is a bug in Firefox Wayland version
  2. There is a bug or limitation in Wayland itself
  3. There is a bug or limitation in Kwin Wayland

I do not have the issue on Plasma Wayland.

Try to disable many Desktop effects to check if it works?


Edit://

Does Firefox run on native Wayland or XWayland?

$ qdbus org.kde.KWin /KWin org.kde.KWin.showDebugConsole

This tells you whether Firefox is running on the native Wayland or not.

You could rule out 2 by trying a live GNOME Wayland session. GNOME has far less Wayland issues than KDE 5.

https://community.kde.org/Plasma/Wayland_Known_Significant_Issues

Although I don’t see your specific issue there. Right now they are focused on KDE 6.0 public release which is scheduled for end of next month. KDE 6 promises a much improved Wayland experience (but be warned that major new KDE releases haven’t always gone smoothly in the past… I certainly won’t be rushing to adopt it :stuck_out_tongue: ).

1 Like

Yes, that is the exact way how I check Wayland windows, and yes, FF natively works in Wayland since 121.

I’ll do that and report if it helped.

I would love to check it, but unfortunately, it cannot be done, because Wayland is disabled in Manjaro Gnome Live and to enable it, gdm config must be edited and system restarted, which resets the whole OS… So the best next thing I could do was to install Manjaro Gnome in Virtualbox. I launched Wayland session, created links in LO document, clicked on them and… got pop up “Your Firefox window is ready”, without raising the window to the foreground, as it was happening on X11. So yeah, I could replace the issue.

In all tests, Wayland session is the common denominator where the problem can be replicated, independently of DE. This tells me, that no matter what I set, I won’t get rid of this problem and that it is a global problem. Probably some Wayland issue that cannot be fixed right now, but who knows? I will keep digging.

I have a similar problem on Arch Linux with KDE since switching to Wayland. The native Wayland windows are not raised when they get attention. Firefox (opening a URL) and LibreOffice (opening the same document twice) are the most annoying examples.