Firefox sometimes doesn't launch in kiosk mode under openbox when kiosk flag is specified
Categories
(Core :: Widget: Gtk, defect, P5)
Tracking
()
People
(Reporter: aritz, Assigned: jhorak)
References
(Blocks 1 open bug)
Details
Attachments
(2 files)
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0
Steps to reproduce:
Run Firefox in a barebones openbox session in Ubuntu 20.04 (Started with startx), opened up xterm, then typed in "while true; do firefox -kiosk; done", then kept pressing ALT+F4 to re-start Firefox. Also tried with different flags, such as --new-window and --private-window.
Actual results:
Firefox would sometimes not start in kiosk mode, but instead its normal mode as if -kiosk mode wasn't specified.
Expected results:
Firefox should launch in kiosk mode 100% of the time. Unsure if this is a bug in firefox or openbox. Chrome appears launch in its kiosk mode 100% of the time in my tests, but Firefox doesn't exhibit this behavior in KDE.
Comment 1•5 years ago
|
||
Bugbug thinks this bug should belong to this component, but please revert this change in case of error.
Updated•5 years ago
|
Comment 2•5 years ago
|
||
Is it possible Firefox was already running somewhere?
Reporter | ||
Comment 3•5 years ago
|
||
This issue occurs whether or not the firefox launched in xterm was the only firefox process or not.
Reporter | ||
Comment 4•5 years ago
|
||
If anyone would like to reproduce this issue, they can grab the latest version of lubuntu at https://lubuntu.me . That uses openbox, and I've been able to confirm that the issue happens there, too.
Updated•5 years ago
|
Comment 5•5 years ago
|
||
Because this bug's Severity is normal
and has not been changed, and this bug's priority is --
(none,) indicating it has has not been previously triaged, the bug's Severity is being updated to --
(default, untriaged.)
Comment 6•5 years ago
|
||
confirming, but I have no explanation as why. It seems pretty random.
Comment 7•4 years ago
|
||
Same issue with jwm on Debian Buster
Comment 8•4 years ago
|
||
Is it some kind of race-condition?
Looking at the code I did notice that FullScreen.init()
(line 2055) is called before window.fullScreen = true
(line 2113). If I move FullScreen.init()
to line 2116 it seems to work better (the navigation bar is only shown shortly but the title bar is still shown).
Tested with Firefox 78.0b7 and manual "patching" like so:
cd /opt/firefox
mkdir tmp
cd tmp
nano chrome/browser/content/browser/browser.js
unzip ../browser/omni.ja
zip -qr9XD ../browser/omni.ja *
Comment 9•4 years ago
|
||
Fullscreen init should just be initing the fullscreen service and then window.fullscreen is the thing that makes it fullscreen. still researching.
Comment 10•4 years ago
|
||
@mkalpy: Did your research reveal anything new?
Comment 11•4 years ago
|
||
Unfortunately not. I'm still looking. Sorry.
Comment 12•4 years ago
|
||
This bug also affect xfwm and icewm.
Can be easily reproduced by using a docker container (bug occurs every second time).
Comment 13•4 years ago
|
||
Honestly, I'm not a Linux user and so I just haven't had time/resources to look at this.
Assignee | ||
Comment 14•4 years ago
|
||
We're received a bugreport regarding issue lately. I'm able to reproduce it only with upstream binaries and sway and not with Fedora binaries - which make debugging quite difficult. I've noticed the command line parameters are processed from there:
https://searchfox.org/mozilla-central/source/toolkit/xre/nsAppRunner.cpp#5251
It looks like it's called after the final-ui-startup
observers are notified. Could not its observers run some code asynchronously and be faster before the gKiosk
is set? I wish I could reproduce it with the debugbuild or custom build, but so far no luck.
Assignee | ||
Comment 15•4 years ago
|
||
Hm, will try the "manual patching" Kristian suggested.
Comment 16•4 years ago
|
||
Thanks. I just haven't had a chance to look at it.
Assignee | ||
Comment 17•4 years ago
|
||
According to stacktraces which triggers on getting gKiosk value it looks like when the kiosk fails the "fullscreen" event is not triggered for the browser-fullScreenAndPointerLock. Not sure why ATM.
Assignee | ||
Comment 18•4 years ago
|
||
Looks like problem with nsWindow::MakeFullScreen (gtk implementation). I'll work on it next day.
Assignee | ||
Comment 19•4 years ago
|
||
Sometimes the window is not switched to fullscreen after call of MakeFullscreen because
other window mode change arrive too with later time. Gtk then ignores the fullscreen
request which breaks the kiosk mode and window stays maximized instead of fullscreen.
This patch resend the fullscreen request if it failed before.
Updated•4 years ago
|
Reporter | ||
Comment 20•4 years ago
|
||
I'm glad this has moved forward since I've reported it almost a year ago, though @stransky mentioned with in the phabricator comments, "I'd rather remove the toplevel window state restoration at session manager than hacking the fullscreen/restore race condition here."
Which finally gives the reason why as to Firefox sometimes doesn't start in kiosk mode... because it's attempting to position itself while restoring a previous session, even though kiosk mode is activated. With that in mind, I have come up with this workaround for starting kiosk mode in Linux, it's surprisingly simple: start in private mode while specifying the location and the dimensions of the window:
firefox --new-instance --kiosk --private-window https://duckduckgo.com --top 10 --left 10 --width 400 --height 400
I'm running this in the same infinite loop as before, and so far it has never failed to start in kiosk mode!
Comment 21•3 years ago
|
||
Dupe of Bug 1727815 ?
Reporter | ||
Comment 22•3 years ago
|
||
(In reply to Martin Stránský [:stransky] (ni? me) from comment #21)
Dupe of Bug 1727815 ?
No, that particular bug specifically has to do with Wayland, this issue appears to be caused by a race condition between window placement of a previous session and starting kiosk/full-screen mode.
Since I commented last, I found that if one does not want to use a private window, (i.e., keep cookies and such) this issue can be worked around by setting the following preferences to false
.
browser.sessionstore.restore_on_demand
browser.sessionstore.restore_tabs_lazily
Comment hidden (off-topic) |
Comment 24•2 years ago
|
||
Sorry, there was a problem with the detection of inactive users. I'm reverting the change.
Comment 25•2 months ago
|
||
ARitz, is it still an issue for you or can we close it?
Thanks.
Updated•2 months ago
|
Comment 26•1 month ago
|
||
Clear a needinfo that is pending on an inactive user.
Inactive users most likely will not respond; if the missing information is essential and cannot be collected another way, the bug maybe should be closed as INCOMPLETE
.
For more information, please visit BugBot documentation.
Reporter | ||
Comment 27•1 month ago
|
||
(In reply to Martin Stránský [:stransky] (ni? me) from comment #25)
ARitz, is it still an issue for you or can we close it?
Thanks.
Launching kiosk mode still requires the workarounds I mentioned
Description
•