11 ms·
Firefox Is Going to Try and Ship with Wayland Enabled by Default
- anonymouskimmer 3y agoI'm just a regular user who hardly ever touches a terminal window. I have a 10+ year old laptop and am running Ubuntu 20.04 LTS and am running X11. How will this affect me?
- slowbdotro 3y agoYou are running X11. So it won't affect you.
- anonymouskimmer 3y agoThanks.
- kiwijamo 3y agoIf you're using the Firefox from the Ubuntu repository I presume it'll be tested by Ubuntu to ensure it works correctly.
- SkyMarshal 3y agoI didn’t even realize desktop applications could/should implement the Wayland protocol. I thought it was just WM’s (and some DE’s?) that needed to do that, basically anything that directly replaces X, but not the apps running on it. Is this something every Linux desktop application will need to do?
- TacticalCoder 3y agoI'm confused too so I upvoted you. Any information most welcome.
- tapoxi 3y agotl:dr an app connects to the Wayland compositor (like an X server) and sends it draw commands using the Wayland protocol. The compositor accepts these connections on a Unix socket, /run/user/1000/wayland-0 by default The protocol is defined in the libwayland library. Most apps don't use libwayland directly, but their widget toolkit like GTK or Qt does it for them.
- blibble 3y agoat the risk of appearing pedantic: whereas a large chunk of X11 is dedicated to draw commands (circle here, line here, pixel here): wayland doesn't have any instead it's all shared memory buffers
- LoganDark 3y agoX was designed to be used over a network, where sending buffers would have been very slow. Sending primitive draw commands, on the other hand, was much faster.
- Quekid5 3y agoFor most applications it's usually enough that the toolkit (GTK, Qt, whatever) supports it. However, Firefox probably does some stuff 'outside' what GTK provides, so it needs to implement those bits itself. I'm guessing stuff like <video/> support. (Wayland is a set of protocols and the toolkit may not support all the protocols or have sub-par support -- in which case the application can choose to do those bits itself.)
- treyd 3y agoAccelerated video decoding is an example. It uses VA-API or VDPAU to decode video onto a surface that is then composited into the final frame entirely on the GPU.
- HansHamster 3y agoUsually, the UI toolkit (gtk, qt, ...) should take care of the X11/Wayland protocol details. But if the application is doing its own thing or at a lower level (and I guess Firefox qualifies) then that has to be adapted.
- thedaly 3y agoFirefox, pretty much all electron based apps, there are lots of applications that seem to interface directly with wayland.
- Quekid5 3y agoElectron apps interface with Electron-the-platform (and have no direct knowledge of Wayland) so it doesn't seem to make much sense to single that out?
- OJFord 3y agoSingle what out, all of them? ,'Electron-the-platform' does then, via which all 'Electron apps' (single thing or not) do, which is what GP's saying? It works this way for Electron-the-platform... And therefore every Electron app that uses it?
- comex 3y agoThe point is that Electron-the-platform is playing a similar role to GTK or Qt: it talks to Wayland, and the application talks to it. Therefore the application is not interfacing directly with Wayland, and claiming that it is would be singling out Electron from the category of UI toolkits. But it depends on your definition of “application”.
- OJFord 3y agoYeah, I'm not sure how now, but I think I misread/misunderstood the comment I defended. Can't now read it any other way but as a claim that they typically don't use Electron for it and instead talk to X/Wayland directly. (I have no idea, but would have assumed Electron handled it sufficiently for the vast majority.)
- fayalalebrun 3y agoYes, desktop applications need to implement the Wayland protocol in the same way they need to implement the X protocol. There is a compatibility layer called XWayland which allows you to run Xorg programs under Wayland. However, running programs under XWayland comes with issues such as lack of proper fractional scaling. This means that although not strictly necessary, from a user's point of view it is desirable to have applications move to Wayland.
- pengaru 3y agoXWayland is a compatibility interface for X apps to still work on Wayland compositors, so it's not mandatory to port everything over to Wayland. But there should be performance and rendering quality advantages to speaking Wayland natively. Core X for instance has zero concept of a frame or buffer swapping, X apps like games generally get that via GL. So your average X GUI application tends to be inherently flickery/tear-ful, since draws just get sent out to the X server and display whenever. XOrg drivers have implemented various hacks to try minimize those effects, but it's all very vendor-specific[0] and never perfect since it's a fundamental limitation of the X protocol. You can at best eliminate literal tearing[1], but nothing prevents displaying a partially refreshed window full of changing widgets, each implemented as X subwindows in the classic X fashion, because nothing in the core protocol says "Ok, this top-level window update is finished, present it (and its descendants)!". That's not even getting into the issues of high dpi and fractional scaling... [0] https://manpages.debian.org/bookworm/xserver-xorg-video-intel/intel.4.en.html#Option~11 https://manpages.debian.org/bookworm/xserver-xorg-video-inte... [1] https://en.wikipedia.org/wiki/Screen_tearing https://en.wikipedia.org/wiki/Screen_tearing
- vidarh 3y agoMost X servers implement the Xdbe extension for double buffering with clients that supports it, or you can just render into an off screen pixmap first. In other words, if there is tearing or flickering, it's really entirely the clients fault for just blindly choosing to render straight to the window.
- bitwize 3y agoBut with Wayland you don't actually have to do anything to get flicker-free, tear-free output because Wayland was designed with these goals in mind.
- vidarh 3y agoOf course you do: You need to allocate a buffer, and you need to commit it to the visible display, exactly the same amount of work to do so under X. If anything, I suggest you look at the sheer amount of code required to put anything on screen with Wayland vs. X - Wayland requires a lot of boilerplate, as the presumption is that everyone would use a widget library. As far as design goes, Wayland is absolutely awfully verbose for no good reason.
- MaxRegret 3y agoDesktop applications can continue to use the X11 protocol, but then they'll be talking to the Xwayland server, which in turn Wayland to actually draw its clients' windows on the screen. But it's preferable to have applications directly use the Wayland protocol, which is what Firefox is experimenting with. For most applications, this is easy because they use some standard toolkit like GTK or Qt, which will transparently use Wayland without the application caring about it. But Firefox uses its own toolkit, so it's a bit more work.
- deleted 3y ago[deleted]
- treyd 3y ago> Is this something every Linux desktop application will need to do? The idea is that GTK+ and Qt can (and do) add support for Wayland and it's trivial for applications to support Wayland, often without even recompiling.
- bitwize 3y agoYes, Wayland is a display protocol that applications need to speak in order to display on a Wayland server. Applications built for X can still run on Wayland via Xwayland. But Xwayland is a bodge to allow legacy applications to continue running, an interim solution while toolkits, libraries, and applications are converted to use Wayland directly. To paraphrase the hit song: Once we have enough Wayland software At our call, hackers, at our call, We'll throw out those dirty X code paths, Ever more, hackers, ever more.
- Bu9818 3y agoLots of games won't ever be converted to Wayland (maybe some unofficially by replacing libraries with updated ones that still work with the game), we'll need some nested X server like xwayland in rootful mode once wayland compositors remove their xwm.
- wmf 3y agoJust run games under a native Wayland version of WINE.
- Fornax96 3y agoOnce again WINE is the stable Linux ABI
- a_vanderbilt 3y agoAbsolutely hilarious that we have reached a point where the most stable API for Linux apps is win32.
- okanat 3y agoReached? Win32 has been the most stable userspace ABI for Linux for more than a decade (or even 2?). Wine is a really old project and Win32 API / ABI has always been stable. The implementation of the API / ABI was very patchy earlier but the functions that defines the ABI has always been there, their signature and calling conventions are stable.
- LoganDark 3y agoThe apps need to actually talk to the server, which means they need to also know the protocol for it.
- okanat 3y agoFor regular apps the toolkit (Qt / GTK / GDI / Cocoa) handles it. They hide the inner bits of the underlying OS / Graphics API from the apps. Web nowadays is a very free-form environment coming with cross-platform APIs. Using platform specific API and toolkits will create inconsistencies and performance issues. So browsers come with their own rendering engines that uses lower level APIs like Directx and OpenGL. To access GPU video decoders etc., they also need to use those lower level APIs anyway. Regardless of the OS, when the applications want to directly render things they have to communicate with the lower level graphics backend (Wayland, X, DWM, Metal etc) to agree on a memory area and pixel format and some other things. The OS, the direct rendering system and the window management system together manages what application gets the rendering signal, what area, at what display with what metadata (e.g. DPI, or pixel bits) it is drawn. Since browsers are writing their rendering system and the components from scratch (not everything, they still use some system GUI components or text input / font rendering stuff), they need to communicate with the lower layer directly to request screen areas to render, to get the correct display DPI/scale to draw things at the correct size with well-aligned pixels and to utilize various hardware stuff like hardware video decoders.
- trealira 3y agoThis is the reason there are cross-platform GUI libraries (like GTK and QT) in the first place. Without it them, an application must either sacrifice portability, or manage the same application for multiple different interfaces over multiple OSes, like X Windows, Win32, Cocoa, and Wayland. Many applications for Windows, OS X, and Linux interface directly with Win32, Cocoa, or X11/Wayland. For example, the Foot terminal emulator only works with Wayland, because the author has chosen not to implement the X11 protocol.
- bryanlarsen 3y agoHuh, I didn't realize it wasn't the default already. `MOZ_ENABLE_WAYLAND=1` in /etc/environment to enable. Seems to fix a flashing issue I'm seeing.
- globular-toast 3y agoI'm a bit confused as I seem to have removed the MOZ_ENABLE_WAYLAND=1 from my configs a while ago, but Firefox is still using Wayland on my system.
- kruuuder 3y agoI didn't know what Wayland is, but was curious what this article is about. I read the article, and it doesn't explain what Wayland is. So I googled Wayland and read the start of the Wikipedia page. Ok, so Wayland "is a communication protocol that specifies the communication between a display server and its clients, as well as a C library implementation of that protocol." and so on. Huh. I now know have a very, very vague idea what Wayland is. What does that have to do with a browser? How can Firefox "ship with Wayland"? I think I have learned nothing. I feel stupid. Tech news is weird sometimes. Edit: Thanks for all the responses. But I'm still not understanding what all this has to do with Firefox. I boot up my linux machine that runs KDE, I launch Firefox and then what? Does this help with something on my local machine? Or does Firefox now provide a UI for remote systems that I SSH into? Whatever Firefox can do now, why should this be a feature of a browser? Edit 2: Ah, I get it now, Firefox simply renders itself using the Wayland protocol, correct?
- bfdm 3y agoI only know it as the thing that broke all my screen capture tools because none of them had implemented the necessary changes the last time I tried, admittedly small N years ago.
- starttoaster 3y agoThis is how most of us casual linux users learned about Wayland.
- mgbmtl 3y agoTo be fair, for such a huge change to how we use Linux on the desktop, worst things could have happened.
- doublepg23 3y agoYeah while Wayland still has some warts it seems like people say "I don't have proper color management on Wayland" with the same enthusiasm "This GNOME Wayland session crashes on boot" from a nearly a decade ago.
- butz 3y agoI'd prefer Firefox to try keeping compact view supported.
- replete 3y agoYou might like my userchrome script which is mostly about making the browser UI more compact and enabling multi-row tabs: https://github.com/replete/firefox-userchrome https://github.com/replete/firefox-userchrome
- brucethemoose2 3y agoFirefox Wayland is still kind of iffy when I have the Nvidia driver enabled on either of my AMD CPU/Nvidia GPU machines. Sometimes it doesn't launch, among other unreproducable things. Of course it works perfectly if I disable the Nvidia driver. It also works fine in XWayland, but then rendering (to my eyes) looks choppier.
- whalesalad 3y agoFirefox is one of the few apps that works flawlessly for me in Wayland (w/o xwayland). Slack is almost there, but not perfect. My cursor becomes like 1/10th the size in Slack .. but the crisp rendering is worth it. Dragging a PNG file into it never works though, so I always need to upload via the little + button. Spotify is 100% flawless, to my surprise. Even works flawlessly with the whole device handoff thing between iPhone, my Macbook, etc. vscode renders much better with wayland, like the latency difference is pretty significant. but... I use Toshy to get macos keybindings on Linux and those fail to work when vscode is booted in wayland mode ... so I am still suffering with xwayland. If I do not think about it, I don't mind lol. If I go back to native and see how much better rendering is, I feel sad.
- brucethemoose2 3y agoChromium and Electron are the big kickers for me. All GPU acceleration is (silently) broken in true native Wayland when Nvidia is active. It mostly looks fine until I stress the UI, and I can see significantly more CPU being used. In fact, I only really know its busted in VSCode because it spits out the same errors in the console as Chromium (where I can check about:gpu and see that everything is off).
- bootsmann 3y agoSame here, but for me using launch options to force chromium apps to use wayland with ozone has fixed most of the issues. Pretty convinced its the combination of NVIDIA/XWayland/Electron that is particularly cursed.
- omnimus 3y ago
- bobse 3y ago[dead]
- pestatije 3y agoevery time i tried Firefox with Wayland, WebGL stops rendering
- cies 3y agoNvidia hardware?
- deleted 3y ago[deleted]
- sdfghswe 3y agoELI5 please?
- rstat1 3y agoThere's 2 ways to get a window to show up on a Linux desktop, the old way is called X11 and the new way called Wayland. These protocols handle putting stuff on the screen as well as input from your mouse and keyboard (and touch screen if you're one of the 2 people that have one). Mozilla has been working toward making Firefox work with wayland for a while, seems they've finally gotten in to a shipable state.
- kiwijamo 3y agoTo be fair it's probably been fine for years -- what they've proposed is how it's been done in many distros already. They're more or less upstreaming the changes many distros have already done when they switched to Wayland by default over the last couple of years.
- rstat1 3y agoYou're not wrong. I've been using the MOZ_ENABLE_WAYLAND envvar for a while and not noticed any difference. When I said "shipable state" I was thinking "shipped, enabled by default". Probably should've just said that instead.
- whalesalad 3y agoX is the tech we have used since the dawn of time. It was released in 1984 and so the architecture is not suited for the way modern desktops operate. Wayland is a modern replacement, but it is not a drop-in. That is because it has a completely different architecture and approach. I cannot ELI5 the differences between the two, because they are somewhat vast. If you are on a platform that supports Wayland, it is undoubtedly a smoother, prettier and overall better experience. This falls apart due to the lack of direct support from certain apps, desktop environments, etc. The migration has taken some time - but alas this is an open source effort in a massive/fragmented environment so it is obviously a very hard challenge. Like herding 100,000 cats. Unfortunately not everything will just work. A stopgap is something called xwayland which allows x apps to communicate with wayland - although it is not perfect. Firefox will work with Wayland. It will work with X. It will work with XWayland. The default though is X or XWayland. You normally need to explicitly tell Firefox to boot up using Wayland. Firefox is now considering making it enabled by default, which would be great for those of us who run on Wayland all the time. It would of course still work on X.
- dralley 3y agoFedora has had Wayland-enabled Firefox for several years at this point.
- christophilus 3y agoI was about to say, I thought this was already long since standard, but I’m on Fedora. I didn’t realize they were shipping a non-standard FF build.
- whalesalad 3y agoafaik the build is not relevant - it is the configuration / way that ffx is started that matters (ex, MOZ_ENABLE_WAYLAND=1 firefox)
- kiwijamo 3y agoSame as for Debian in my observation. Firefox uses Wayland by default out of the box for clean installs. But there may be still be legacy Debian installations which have carried over the use of X11 through upgrades etc.
- Narishma 3y agoI think that's only if you use Gnome. I'm using XFCE and the Firefox that's installed is the X11 variety.
- scns 3y agoOff topic, but does anyone know the status of IntelliJ on Wayland?
- shutty 3y agohttps://youtrack.jetbrains.com/issue/JBR-3206/Native-Wayland-support https://youtrack.jetbrains.com/issue/JBR-3206/Native-Wayland...
- scns 3y agoThanks
- slavapestov 3y agoWait, I’m old enough to remember when IntelliJ used Swing. They wrote their own GUI toolkit since then?
- hsbauauvhabzb 3y agoI’d be interested in switching to wayland but I have good knowledge of x11 cli tools - xrandr, xdotool, xwininfo, etc. is there an easy way to migrate this knowledge and accompanying scripts?
- pzmarzly 3y agoIf you are scripting-heavy user, I recommend trying out one of WMs based on wlroots (or implementing its custom protocols). Core Wayland protocols are designed with security in mind, which doesn't necessarily let you have all the automation fun. wlroots protocols bring back most of X11 capabilities at the cost of having similar security model. https://github.com/solarkraft/awesome-wlroots https://github.com/solarkraft/awesome-wlroots is a pretty nice list of various CLI utils you can use. Sadly I don't think anyone aimed to 1:1 replicate APIs of xdotool etc, so you will need to change the syntax in your scripts a bit.
- JetSpiegel 3y agoxrandr: wdisplays, kanshi fpr automatic setup xdotool: ydotool, but it might miss some features xwininfo: this is compositor specific. Sway has swaymsg, that's what I use.
- hamilyon2 3y agoVery glad to hear that. I am guessing in December screen sharing on secondary, non-popular DEs and distributions will break again or alternatively will finally work properly?
- Toorkit 3y agoI'm on an old GTX 1060 I got off eBay years ago. I've only tried Swaywm, as I'm on i3wm right now. Sway starts, but crashes within seconds. Longest I've got it to run was half an hour before everything froze. Do any other WM's/DE's work better for old Nvidia cards? I don't particularly want to start installing all the Wayland things out there until one works hah. I understand Nvidia isn't great for Wayland...
- joecool1029 3y agoI'm a sway user using a Maxwell Nvidia in an optimus config with an intel skylake (around your vintage, technically a generation older, we're both supported by current drivers). There's a single line patch needed for using nvidia with wlroots that upstream does not want to merge, if you don't have it screens will flicker: https://aur.archlinux.org/cgit/aur.git/tree/nvidia.patch?h=wlroots-nvidia https://aur.archlinux.org/cgit/aur.git/tree/nvidia.patch?h=w... Other than that for the first time in like a decade of dealing with Optimus bullshit laptops off and on everything finally works plug and play, even running different refresh rate screens at the same time. Nvidia finally shipped support for controlling gamma in wayland on Halloween so I can use gammastep to shift my screens red at night. In short: Have that patch for wlroots (which sway uses), use newest proprietary driver, block/uninstall nouveau, and make sure the system isn't loading CPU rendering due to a misconfiguration (firefox you can check about:support, chromium/electron-based shit check chrome://gpu) EDIT: oh and since chromium/electron will inevitably temporarily break graphics at some point due to an update... --disable-gpu is your friend to get those apps working (with CPU rendering). Obviously drop it out once those problems subside, it's happened maybe twice to me in the past few months running Gentoo unstable. Firefox seems more resilient and will find a way to run in less ideal circumstances on wayland.
- jakjak123 3y agowow, that is a tiny patch
- cycomanic 3y agoIf you're on arch you can use sway-nvidia from AUR. I've been using that on my desktop without significant issues. The only one are some graphic glitches on the steam interface (but not in games). I'm on a 3070ti though. I think it's mainly just environment variables, so if you're on another distro you can have a look at the the GitHub repo and implement it yourself. The biggest nvidia issue I encountered are problems with display managers, GDM would sometimes not start wayland compositors or not start x11 WMs. I tried several others as well and always had issues (never had issues on my previous AMD or Intel machines). I ended up just autostarting a locked sway desktop and everything just works.
- jchw 3y agoI have been using Firefox on Wayland for years now, and for the most part it works, well, perfectly well. It's very nice on computers with mixed DPI displays, I've had no issues with any of that. (I have run into a couple situations where dragging tabs has crashed, but it's too occasional to care. I just session restore'd and went back to work. Features like Picture-in-Picture work great and I even have a special setup for Picture-in-Picture mode so it will stick across workspaces in Sway.) I imagine there's a lot of concerns that have to be carefully considered, as it is a very non-trivial change. Like, does WebGL work? Video acceleration? Will there be a performance regression for anything? How about accessibility, do screen readers still work as intended? (They should since for now that's all out-of-band, but you never know.) Does it have trouble with any specific vendor of GPU? An interesting consequence of Wayland's design is that a lot of the information conveyed about X windows, like ICCCM properties, are basically non-existent in the Wayland world. This means that for a tiling window manager like SwayWM, it's actually a lot harder for say, pop-up windows to not accidentally get treated like other tiled windows. So if you use e.g. Dolphin file browser, the copy dialogs will try to "tile" since there's no way for Sway to know they're supposed to be popups. This was not an issue for i3wm. This is both fixable and possible to workaround, and in the grand scheme of things not my biggest priority (I'm much more concerned about issues like stability) but I think that issues like these are of prime concern for Wayland adoption.
- londons_explore 3y ago> I have run into a couple situations where dragging tabs has crashed, but it's too occasional to care. Am I the only one to have the expectation that software I use should never crash? My chair holds me up every day. My fridge keeps my food cold every day. My windows keep out the rain every day. My washing machine washes my clothes every time. Why should my firefox get a pass to sometimes randomly crash and that be okay?
- beezlebroxxxxxx 3y agoYour chair and your fridge, like a piece of software, can be repaired or fixed. They get worn down, especially if they're repaired many times over. Crashing, in the context of a chair or fridge, or in software, is generally not seen as a catastrophic failure which fundamentally makes the chances for repair or fixing impossible. One would hope your chair or fridge never "crash", like one hopes a piece of software never does, but they come in all levels of quality and face all kinds of edge-cases. One day, for instance, maybe a 3 tonne man sits on your chair, which has held you up just fine every day, and the chair fails to hold him up, crashing him to the ground. You wouldn't turn around and reasonably say your chair is now a failure, really.
- cbsmith 3y agoThis is a totally an irrelevant nit, but I couldn't help but be disturbed by the "try and ship" phrasing instead of "try to ship" phrasing: https://www.grammar-monster.com/lessons/try_and_try_to.htm https://www.grammar-monster.com/lessons/try_and_try_to.htm
- askvictor 3y agoPreach.
- jjtheblunt 3y agoThat phrasing disappoints me too such that i never bother reading further, as i then expect more sloppy thought.
- cbsmith 3y agoThere's an extra level of irony here that I wrote "a totally an irrelevant" and didn't realize it until after the edit window had closed...
- JohnFen 3y agoHow sure are they that doing this won't cause problems for those of us who don't use Wayland? Should I avoid updating FF for a while?
- gavinsyancey 3y agoThey're not disabling support for X. Just enabling support for Wayland. It will still work exactly as it did before if you aren't using Wayland.
- JohnFen 3y agoThe code looks like they're just checking for the presence of GTK 3.24.30 to make that determination, that's why I was asking. But perhaps that version of the GTK doesn't support X itself, so that's an acceptable proxy? Or perhaps that's not the real check, and it exists elsewhere?
- deleted 3y ago[deleted]
- johnny22 3y agoit can't be the only check that's for sure. They aren't gonna break x11 users yet.
- fluxem 3y agoMark my words, 2023 is the year of Wayland
- bravetraveler 3y agoI've enabled the environment variable (MOZ_ENABLE_WAYLAND) if memory serves just fine ... for years, on i3 (X11) and Sway (Wayland). I'm lazy and use basically the same config files between them! Point being, it's probably fine: for wlroots things at the very least, perhaps more :)
- modzu 3y agoslightly off topic, but does anyone have a solution for app windows not remembering position on wayland? for example on x i have firefox open in one place, sublime text in another.. but on wayland they always open in the same spot, and i have to move them. it seems such a basic thing to not work.. does every wayland user run a tiling window manager??
- binkHN 3y agoAs I understand it, this is a current limitation of Wayland. For KDE, which is what I use, they'll be writing something too handle this since it's not possible natively.
- mariusor 3y ago> since it's not possible natively. It is possible natively. The logic, however, needs to be implemented in the compositor not the applications, because it's the compositor that keeps track of the positions of the windows.
- lpcvoid 3y agoI have been using Firefox on Wayland for a long time now. It's even nicer than with X, since pinch-to-zoom on touchscreens and touchpads is fantastic, but a Wayland-only feature. Very neat!