XUL notification steals focus when triggered
Categories
(Core :: Widget: Gtk, defect, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox-esr115 | --- | unaffected |
firefox120 | --- | unaffected |
firefox121 | --- | unaffected |
firefox122 | --- | wontfix |
firefox123 | --- | fixed |
People
(Reporter: nazar, Assigned: emilio)
References
(Regressed 1 open bug, Regression)
Details
(Keywords: regression)
Attachments
(8 files, 1 obsolete file)
63.44 KB,
image/png
|
Details | |
43.37 KB,
image/png
|
Details | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review |
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:122.0) Gecko/20100101 Firefox/122.0
Steps to reproduce:
Use anything on the web that uses notifications. Slack, Google Calendar, literally anything. It worked properly until a few weeks ago, now it is basically broken.
Actual results:
Notification does show up, but it is not rendered, instead it takes the same background as an app below it, so it is essentially invisible. I can see that after switching virtual desktops, in which case it is re-painted with previous virtual desktop's screen contents. It is also not clickable anymore
Expected results:
Should render its contents properly and be clickable.
Comment 1•7 months ago
|
||
The Bugbug bot thinks this bug should belong to the 'Toolkit::Alerts Service' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Comment 2•7 months ago
|
||
(In reply to Nazar Mokrynskyi from comment #0)
Notification does show up, but it is not rendered, instead it takes the same background as an app below it, so it is essentially invisible.
Hi reporter, can you take a screenshot of this, assuming it's at least partly visible in certain situation? Also, does your system use libnotify? Thanks!
Reporter | ||
Comment 3•7 months ago
|
||
The screen I was on had black background in notification area. Then I switched to a different virtual screen and saw this.
Notifications from Firefox look nothing like notify-send notifications, so I don't think it uses libnotify.
I'm using a custom DE with Qtile window manager and Compton compositor on X11.
Comment 4•7 months ago
|
||
Hmm, sounds much like a widget/gtk thing. Hi GTK people, does anything come to your mind from comment #3?
Comment 5•7 months ago
|
||
(In reply to Nazar Mokrynskyi from comment #3)
Notifications from Firefox look nothing like notify-send notifications, so I don't think it uses libnotify.
How did it look when it worked? Can you try the stable channel?
Updated•7 months ago
|
Reporter | ||
Comment 6•7 months ago
|
||
When it worked it looked like a gray rectangle (I use dark theme) with icon, text and close button in top right corner. Somewhat similar to notifications Thunderbird is still showing to me (except in Thunderbird is always Thunderbird's icon and it shows up in bottom right rather than top right corner).
Comment 7•7 months ago
|
||
It's hard to see from the text descriptions that it's XUL based or libnotify. 🥲
When you try with the stable channel, does it have the same issue? (In other words, is there a chance that this is not a Firefox side regression?)
Reporter | ||
Comment 8•7 months ago
|
||
Firefox 120.0.1 stable works fine, notification looks like on attached image. Must be nightly regression.
Comment 9•7 months ago
|
||
Okay, that's definitely XUL, thanks! Can you try pip install mozregression && mozregression --good 2022-12-13 --bad 2023-12-13
to bisect the culprit?
Reporter | ||
Comment 10•7 months ago
|
||
mozregression is a pretty cool bisection tool!
4:17.75 INFO: Last good revision: 5f6fad561a65b0f9103350cccffd4fec374b214c
4:17.75 INFO: First bad revision: 2c0e51ad033428fa026ec754cccd91c9ae4f2a26
4:17.75 INFO: Pushlog:
https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=5f6fad561a65b0f9103350cccffd4fec374b214c&tochange=2c0e51ad033428fa026ec754cccd91c9ae4f2a26
Comment 11•7 months ago
|
||
Okay, that says this is a regression from bug 1864382. Thank you very much to provide all the details!
Updated•7 months ago
|
Comment 12•7 months ago
|
||
Thanks, will look at it. Looks like a child window misconfiguration related to mContainer.
Comment 13•6 months ago
|
||
Set release status flags based on info from the regressing bug 1864382
Comment 14•6 months ago
|
||
(In reply to Martin Stránský [:stransky] (ni? me) from comment #12)
Thanks, will look at it. Looks like a child window misconfiguration related to mContainer.
:stransky any updates on this? We are in beta for Fx122 but can take an uplift.
Could you add a severity when you have a moment?
Comment 15•6 months ago
|
||
Will looking at it. We use this notification as a fallback is libnotify is missing (which is not expected - I have no idea why someone removes it?).
As a workaround you can install libnotify package which is available for all distros and should be there by default.
Updated•6 months ago
|
Updated•6 months ago
|
Comment 16•6 months ago
•
|
||
Nazar, just out of curiosity, which distro/system do you use? Did you removed libnotify intentionally?
Updated•6 months ago
|
Reporter | ||
Comment 17•6 months ago
|
||
I am on Ubuntu 22.04 right now and I have both libnotify-bin and libnotify4 installed and always had them.
No idea why Firefox and Thunderbird do not use them, but it was like this at least for a few years as I'm using Firefox Nightly and Thunderbird Beta versions that are direct from Mozilla (not packaged in deb).
Reporter | ||
Comment 18•6 months ago
|
||
Notification started to work properly again in latest Nightly build I just installed
Reporter | ||
Comment 19•6 months ago
|
||
Okay, there is one big regression comparing to before.
Notifications now capture focus. So if I'm typing something and notification happens, focus is taken away and I need to click on the text field to continue typing.
This is a massive usability issue, extremely counter-productive.
Reporter | ||
Comment 20•6 months ago
|
||
And looks like Thunderbird updated to newer base and 122.0b1 is having the same notification issue there now.
Comment 21•6 months ago
|
||
Notification started to work properly again in latest Nightly build I just installed
👀 Can you use mozregression to see which build caused the (good) change?
Reporter | ||
Comment 22•6 months ago
|
||
But I think window doesn't have proper classes on it, which makes it capture focus and only show on one virtual desktop instead of all as normal notifications do.
So it is a step into the right direction, but not a proper fix.
Comment 23•6 months ago
|
||
Thanks! Emilio, care to take a look per comment #22?
We still need to know why Firefox is failing to detect libnotify and use XUL at all, though.
Comment 24•6 months ago
|
||
Nazar, can you check the value of alerts.useSystemBackend
in about:config
? If this is false then it always uses XUL.
Reporter | ||
Comment 25•6 months ago
|
||
alerts.useSystemBackend
is true
and always was that way, I already checked it during initial debugging
Assignee | ||
Comment 26•6 months ago
|
||
First of all, is there something in dmesg or the journal the first time a notification is received? It should probably highlight what's going on with libnotify. Alternatively if you have a build, looking at here should help figure out what's up.
I guess the focus stuff could be explained for this. It's unclear to me that was ever meant to apply to top-level windows, but it probably did.
We'd need to plumb stuff through a little differently to support that.
Reporter | ||
Comment 27•6 months ago
|
||
First of all, is there something in dmesg or the journal the first time a notification is received?
Nothing in kernel logs, nothing in logs firefox prints in terminal either.
Assignee | ||
Updated•6 months ago
|
Assignee | ||
Comment 28•6 months ago
|
||
nsBaseWidget already stores these / exposes IsPIPWindow().
Assignee | ||
Comment 29•6 months ago
|
||
This makes clearer which bits are free and so on.
Depends on D197866
Assignee | ||
Comment 30•6 months ago
|
||
Depends on D197867
Assignee | ||
Comment 31•6 months ago
|
||
And rename CHROME_WINDOW_MIN to CHROME_WINDOW_MINIMIZE, for parallel
with the resize flag.
Depends on D197868
Assignee | ||
Comment 32•6 months ago
|
||
CHROME_MODAL implies CHROME_DEPENDENT.
Depends on D197869
Assignee | ||
Comment 33•6 months ago
|
||
The only caller already is calculating a lot of other flags.
Depends on D197870
Assignee | ||
Comment 34•6 months ago
|
||
Before bug 1869796 they had an utility type hint, now they have a
toplevel type hint, after the patch they have a notification type hint,
which seems more appropriate.
Depends on D197871
Comment 35•6 months ago
|
||
Are the patches for comment #19? Should the bug title change?
Assignee | ||
Comment 36•6 months ago
|
||
Yes, and maybe? The title is rather general but comment 19 is still "not working properly" :)
Updated•6 months ago
|
Assignee | ||
Updated•6 months ago
|
Comment 37•6 months ago
|
||
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d209e8f5b754 Minor nsWindow clean-ups. r=stransky
Comment 38•6 months ago
|
||
bugherder |
Comment 39•6 months ago
|
||
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/9fe33a9242c6 Use shifts to define chrome flags. r=smaug https://hg.mozilla.org/integration/autoland/rev/3af518535720 Fix some clang-tidy warnings in nsAppShellService. r=stransky https://hg.mozilla.org/integration/autoland/rev/8fe5f47abacb Remove some unused chrome flags. r=smaug,sessionstore-reviewers,dao
Comment 40•6 months ago
|
||
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/9201220ea63a Inline CalculateChromeFlagsHelper. r=smaug
Updated•6 months ago
|
Assignee | ||
Updated•6 months ago
|
Comment 41•6 months ago
|
||
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/6a4793cef01a Make xul alert windows have the appropriate type hint. r=stransky
Comment 42•6 months ago
|
||
:emilio this hasn't landed in central yet, but we are in the final week of beta for Fx122 so reaching out about uplifts.
Any concerns with fixing this in Fx122? Will it be safe to uplift for beta?
Assignee | ||
Comment 43•6 months ago
|
||
So the real fix for rendering of the notification is in bug 1870512. This only fixes the focus issue afterwards.
Given that, I think we'd have to uplift bug 1870512. The focus issue seems probably bearable for the rare-ish case non-native notifications are used.
Comment 44•6 months ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/9fe33a9242c6
https://hg.mozilla.org/mozilla-central/rev/3af518535720
https://hg.mozilla.org/mozilla-central/rev/8fe5f47abacb
Comment 45•6 months ago
|
||
bugherder |
Comment 46•6 months ago
|
||
The patch landed in nightly and beta is affected.
:emilio, is this bug important enough to require an uplift?
- If yes, please nominate the patch for beta approval.
- If no, please set
status-firefox122
towontfix
.
For more information, please visit BugBot documentation.
Assignee | ||
Updated•6 months ago
|
Assignee | ||
Updated•6 months ago
|
Reporter | ||
Comment 47•6 months ago
|
||
I'm using the latest Nightly as of right now (123.0a1 (2024-01-11)) and the window still steals focus just like before, did the fix actually land or did anyone test that it works as expected?
Reporter | ||
Comment 48•5 months ago
|
||
Any updates? 123 was still broken despite tagged as fixed, 124 arrived yesterday, still broken the same way.
Assignee | ||
Comment 50•5 months ago
|
||
(In reply to Nazar Mokrynskyi from comment #48)
Any updates? 123 was still broken despite tagged as fixed, 124 arrived yesterday, still broken the same way.
Your WM is probably giving focus to the window even though it has a notification role (since the role changed from "utility" to notification).
Assignee | ||
Comment 51•5 months ago
|
||
Let's file a separate bug to track that, but the real thing to fix here is bug 1873384, IMO.
Comment 52•5 months ago
|
||
I'm using the latest Nightly as of right now (123.0a1 (2024-01-11)) and the window still steals focus just like before, did the fix actually land or did anyone test that it works as expected?
I can confirm similar behavior (if not same) on Windows and filed bug 1878037.
Reporter | ||
Comment 53•4 months ago
|
||
So the issue is definitely not fixed and should be reopened. The already landed fix is almost complete though, according to discussion at https://github.com/qtile/qtile/issues/4662 "override-redirect" attribute is missing that will fix the issue fully.
Assignee | ||
Updated•4 months ago
|
Description
•