Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
PSA: Firefox Nightly now with experimental Wayland support (glandium.org)
288 points by glandium on Nov 16, 2018 | hide | past | favorite | 97 comments


Great! I recently set up desktop Linux, and was disappointed to find poor support for fractional scaling on HiDPI screens, which I’m used to coming from retina MacBook Pro. Gnome under X11 only has 1x, 2x and 3x scaling. In Wayland, Gnome has experimental support for fractional scaling - including 1.75x, the size I’m used to. However, Xwayland apps like Firefox stable (and chrome) render blurry with fractional scaling. So, very cool to see this major program get Wayland support and thus high quality HiDPI support.


PSA: there's fractional scaling for text even with Xorg, and most applications scale their UI accordingly. I like to set Gnome's full scaling to 1 and text scaling to 1.5.

    gsettings set org.gnome.desktop.interface scaling-factor 1
    gsettings set org.gnome.desktop.interface text-scaling-factor 1.5
Some applications also depend on Xft and X root window DPI.

.Xresources:

    Xft.dpi:	        144
    Xft.hinting:	1
    Xft.hintstyle:	hintslight
    Xft.antialias:	1
    Xft.rgba:	        none
    Xcursor.size:	48
    Xcursor.theme:	Adwaita
xrandr dpi (in my i3 startup config):

    $ xrandr --dpi 144
I have a smaller secondary monitor. I just render it at 1.5x resolution and scale down:

    $ xrandr --output DP-2-2 --scale 1.5x1.5 --pos 0x0
At least for me, the result is perfect HiDPI support (Chrome, GTK, Qt and IntelliJ respect it).


Do you happen to know by chance what scaling algorithm is used?


The GPU does the downscaling, I think it's bicubic by default. Looks decent enough.

With the latest xrandr master, you can set nearest-neighbor using "--filter nearest", which should provide better results.


At least on macOS and X11/xrandr --scale, the output encoder does the scaling, not the GPU. It need less energy to do that, than spinning up the GPU, and the all GPU resources are available to the applications (scaling entire framebuffer at 60 Hz would take significant memory bandwidth from GPU at least).


Thanks, I stand corrected!


Does Gnome under X11 allow you to set the desktop's size higher than the screen resolution and scale that down? Because that's all Apple's "fractional" scaling does-- macOS only supports integer scaling (specifically, 1x and 2x; iOS does 3x but not macOS); the "more space" scaling settings just render the screen at a resolution higher than the physical size of the panel and scale it to fit (for example, current 15" MacBook Pro panels are physically 2880x1800; the default screen resolution on the current machines is 3360x2100 with 2x scaling).


Gnome does exactly that.

While Android, Windows, Qt/KDE and the web went with real fractional scaling,

GTK/Gnome, macOS and iOS went with just increasing the framebuffer size and scaling it down.

As result, when rendering a GTK app (be it a video player or a game like Minecraft) on a 4K screen at 1.5x scale, you're actually rendering it at 6K resolution, which utterly destroys performance.


Gnome seems to do that per window, not per framebuffer like macOS does. The framebuffer size seems to be exactly the display resolution, plus you need GPU to do window scaling, you cannot let the output encoder to do the job.

The Windows and Qt approach has it's own issues with fractional pixel positions, and the resulting problem with mapping integer input coordinates to these. And of course, it doesn't work nice with legacy apps (Gnome has to handle X11 apps, that won't tell anything about the scale they work with. See also: Gimp).


> Does Gnome under X11 allow you to set the desktop's size higher than the screen resolution and scale that down?

FWIW, this is possible under X11 directly. Try running:

    xrandr --scale 2x2


I tried that and it said you need to specify an output.


    xrandr --scale 2x2 --output OUTPUT
where OUTPUT will vary depending on what screens you actually have, but will usually be something like LVDS1 or VGA1. You can get the possible values with auto-completion in Bash (on Debian at least) or by running just xrandr.


While it's not as conveninent as desktop-wide fractional scaling, note that in particular Firefox has already had HiDPI support via the layout.css.devPixelsPerPx config variable, which you can set through about:config.


This tip saved me a lot of headache.

I'm currently running KDEv5 and while I got 'most' of the scaling adjusted properly, this setting fixed the size of the tabs, and other annoyances I was experiencing on FireFox.

Thank-you.


You're welcome! It also works in Thunderbird, if you're using that.


I recently ran in to these bumps with Gnome on a new Thinkpad Carbon X1 and the 2560x1440 screen. I love Gnome but Firefox in particular was unusable and it wasn’t the only app with issues. I begrudgingly installed Cinnamon and things are better. But I prefer gnome. Glad to see I can update my Firefox on gnome to this. I can switch back any time so maybe that will make gnome usable for me.


You can set the scaling to 1x, but the font size to 1.5x in tweak tools. That's what I'm using.


No quality HiDPI support just yet. Not with GL acceleration, anyway. There is a patch on the bugzilla (in the 'wayland' tracking issue) but it's very buggy.


My FHD screen is just a touch too small to be comfortable at native resolution, while 1.5x makes things too big. Also, I find Firefox's built-in scaling to be much better quality than scaling using Gnome. It could be better exposed; the `layout.css.devPixelsPerPx` property in about:config is what you need to tweak.

So I keep Gnome at 1.0x, and Firefox at 1.25x, which as an extra bonus means that "80%" scaling takes Firefox back to native scale again.


In these cases, what I've found to work quite well is to not bother with scaling at all for Gnome, but rather up the font sizes in the tweak tool and scale Firefox individually :) Seems to work out rather well.


Wayland has been a nightmare for me since upgrading to ubuntu 18.04

I had to disable it because videos would not play for long without freezing either on the browser or vlc. Only a hard restart of the machine would resolve this.


I'm using mpv to play videos. It has a very minimal OSD, not all distributions enable this OSD. Mpv works good enough under Wayland. It also makes use of hardware acceleration, this I need because my CPU is too slow to play most things without it (Intel nuc5ppyh).


I have exactly the opposite experience. Whereas with Xorg, transitions would be choppy, not so with Wayland.


To be honest, I just turn the resolution down at the graphics card level. Gives me slightly more blurry pixels at my Thinkpad X1 13" HiDPI display, but I am not able to tell apart pixels at that insane resolution anyway. Side effect: It is computationally cheap and of course no compatibility problems with GTK/Qt/X11 to expect.


Chromium also just declared experimental Wayland support: https://bugs.chromium.org/p/chromium/issues/detail?id=578890...


If I'm reading this correctly, you have to build your own Chromium to test it, which is what you had to do for Firefox... until today. Now you can just download it.


Fedora 29 has a “firefox-wayland” package that runs the latest stable release of Firefox (63 as of now) on Wayland (instead of XWayland). I’ve been using it for a long while and it’s been great!


The post does mention that it was possible already to build your own Firefox for Wayland, and that's what Fedora does. The point is that the “official” package from mozilla.org now supports Wayland out-of-the-box :)


The Fedora package is being built by exactly the same guy (Martin Stransky from Redhat), who works on implementing Wayland into Firefox.

It is not for the first time, that Fedora package had something enabled before the upstream package did: CSDs went the same way.


Thank you for the precision :)


Did you have any problems with copy-paste? For me copy-paste was completely broken.


Yes, copy/paste between Firefox (on Wayland) and other apps was broken but was fixed in firefox-63.0.1-5.fc29.[1][2]

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1585393

[2] https://bodhi.fedoraproject.org/updates/FEDORA-2018-2d42997a...


Copy-paste works, but primary selection does not, it was added to wayland-protocols just few days ago. Drag-and-drop also seems to be broken, I cannot drag urls to the terminal, for example.


Hmm, a few weeks ago Ctrl-C Ctrl-V didn't even work on Fedora 29. With the latest Nightly everything seems to work fine on Wayland, even dragging a URL to GNOME Terminal.

Also, without XWayland I have no artifacts when scrolling fast in long documents. Very nice :-)


Anyone knows, what is the progress of migrating to Servo/WebRender? What parts are still in C++, what parts are being rewritten, and what are not?


They post newsletters[1] about WebRender on a regular basis.

[1] https://mozillagfx.wordpress.com/2018/11/15/webrender-newsle...


It doesn't answer my question though, especially about Servo part and what parts are still C++.


They will never migrate to Servo. Servo is a full web browser used as a platform for testing components of a web browser that have been written in Rust like WebRender. GP's comment answers your question about the status of WebRender.


Obviously, I meant the parts of Servo like Stylo for example.


Stylo has been shipping as part of desktop Firefox since the launch of version 57 last year. And with Firefox for Android since version 60.


I know about Stylo. But like WebRender it is only a small part of browser engine. I am asking about the rest. No information whatsoever.


This page may also answer some of your questions: https://wiki.mozilla.org/Oxidation#Rust_Components


It's funny that this is happening right when I've decided that Wayland is old and busted and Arcan is the new hotness.

Let's face it, everyone is sick of Linux cruft and is waiting on Redox to clean things up. Everything will come soon.


How about experimental "customizeable keyboard shortcuts that don't require you to be on a loaded html page"? Or is that too "Firefox 2003"?


That's great! How is WebRender on Wayland + Vulkan progressing by the way?

I'm still postponing switch to Wayland, until major KWin bugs (like flickering one) are fixed.


I'm running the nightly on KWin and wayland right now, and typing this from there.

Alas, setting about:config gfx.webrender.all to true results in the window being blank, if using it in native wayland mode.

Apparently there's some upstream improvements coming to kwayland that will help.

WebRender itself is very stable. So much so that it is on by default for beta users on Windows with Nvidia. Recent weeks have also saw much better memory usage.


But it's not using Vulkan yet.

KWin itslef still has this bug which is very irritating: https://bugs.kde.org/show_bug.cgi?id=387313


The Vulkan/D3D12/Metal port is done on the side, and we don't want to disrupt the rollout of the WR-powered Firefox onto wider userbase at this time.


So it's planned to be focused on once WebRender is out and enabled everywhere?

I see some work here: https://github.com/szeged/webrender/issues/198


Yes, that's the idea, although it's not officially approved by the product management yet. And that link is correct.


What is this? Is this like a new XWindows client/server where the web browser can act as the client?


Wayland is a different display API and protocol altogether. It is an alternative to X, designed with modern graphics hardware in mind.

https://wayland.freedesktop.org


And explicitly designed against remote desktop and remote windowing with an actively antagonistic view toward the concept.


That also means screen recording is going to be just as or even more painful than it is on X11. Not really an encouraging thing for gaming, streaming and video-making on Linux and that's a huge pity.


They seem to be neglecting this showstopper (guys, the GPU is a lot more likely to be attached to the display than the app host!) but I don't believe they've announced any opposition.


Given that things seem to be moving back more towards client-server, this seems silly


Without Wayland support, Firefox running on a Wayland system would have to communicate through the XWayland shim server. Now its default configuration is to communicate directly with the Wayland server.


Very exciting, but this is very very slow on my x220 compared to xwayland -- running swaywm.


Just curious, are you running the development version of sway 1.0, or the older stable 0.15?


master branch of wlroots + sway (I update nearly ever hour). Sway is the most exciting thing going on right now.

Sway is really fast, I don't think the slowness is a problem with sway. I am wondering if my x220's Intel card is just too slow. I will try shortly on a much faster system.


I am also running the very latest Sway and have no issues with other Wayland applications. I am seeing the same slowness you describe, as I'd been seeing with the Flatpak nightly Wayland builds. It's also still not respecting my Caps Lock.

I'm waiting to hear from someone running it under GNOME/Wayland before filing bugs, though.


Nice, and I agree!

That's sad though, because it means my x230 probably won't fare any better. Are you using modesetting or the SNA (xf86-video-intel) driver?

edit: don't mind me, it uses modesetting.


I am not sure how drivers work with wayland, it probably is not the xf86-video-intel though, as this is wayland.

But I think it will be fine once they flush some things out. Everything in wayland is smooth and fast except this. And this was just enabled. Firefox in general even on Xwayland is super fast on this old system too. It probably just a matter of time until it is all smooth again.


Ah you're right, wayland uses modesetting, what was I thinking. I should have known as I was typing out the typical SNA driver name..


Are you on Arch? I’ve been struggling to build sway 1.0-beta.1 on Ubuntu 18.04 - need to build libwayland 1.16 but then all transitive deps on Wayland are sad.


I'm running Ubuntu 18.10 and basically only needed to install sway, wlroots and json-c from source. Additionally Ubuntu's system version of meson is too old, but you get the latest with pip.


sway beta works great on Arch, maybe you can look up build scripts for sway-git and wlroots-git on aur.archlinux.org, that should probably help with dependency list and building the whole thing.


If only wayland worked with NVIDIA drivers, but I've heard that there's some progress happening.


Isn't that laptop from like 6 years ago?

I'd imagine your GPU is very much considered legacy.


I am running webrender under xwayland, and it is super smooth. This system is damn near the best laptop I have ever had. I have replaced the bios with core boot and have a fully encrypted luks disk. I get near 15 hours battery life. All that for the price of $150 + plus a few premium upgrades (ssd, and ips panel).

My T450s cost me ~$2700 new, and it is faster in some cases, but the cost/performance ratio just does not pay off to have such a expensive system these days.

Should also note, that because the x220 has a higher TDP than newer ultrabooks I can get a few things done faster. The last time I tried emacs compiles near 20 seconds faster on the x220 than a T450s.

I also found a neat hack, not related to the x220, but any laptop really. When I am waiting on long compiles I take a compressed air can and turn it upside down and jet the cool liquid into the heat sink. The temp drops and you can shave a bit of time off a compile or what not if you have the wherewithal to continue to deliver small shots of cool fluid. I mostly feel okay doing it because it is only a $150 laptop...


Do you not feel limited by the CPU? I had a Macbook Air with a 4th gen Core i5 and at times it was really slow just for day to day browsing. Maybe that was just thermal throttling though.

Now I've switched to a T470s which seems a good trade off between size, connectivity and performance. It's roughly the same size as my Macbook Air (13", 2014) but a little lighter, and has ports for HDMI, Ethernet, USB 3.0 x3, audio, USB-C/TB3 and dock connector. I only get maybe 6 hours on the battery which is a bit disappointing though...


No not at all. I do everything on this system -- except gaming, which is a waste of time mostly -- I already clocked in what 3 or 4 years of real time on WoW? The needle is out, and I am going to stay clean this time :p But DK solo tanking was amazing while it lasted. World PvP prot pally was also fun.

The S series starting in the T460 I think is crap. Having the big honking external battery is a must. The non S series are as big as the T450s were and you get all your ports too. My T450s gets over 20hours battery life with the extended battery.

That being said I wonder if you could get more life out of your T460s. Check with powertop how many watts you use in idle. You should be able to get it to 3w (I can get mine t450s to 2.5w) idle. Use the turntables in powertop -- set them to "GOOD", you can write a systems service to enable them on boot.

For me the key to saving battery life is to optimize how much you use when you are not using your laptop.


I use an X220i, which has a Sandy Bridge i3-2310M CPU, with 8GB RAM and an SSD. I have no slowness issues in Firefox at all.


Man, I want an X220 with newer gen chip in it.

The new usb-c side dock solution, worse keyboards, and the ultrabook form factor's thermal properties...


Well, then you might look into this guy who modifies x200/x201's with 8th gen Intel chip sets.

I think this is a good starting point to find more information about it. Its called the x210.

http://www.cnmod.cn/x210


Wow, that looks really cool. Do you happen to know how much they cost?


If I recall -- I was reading the board + CPU was around $450, and you can pick up a x200 for ~$100 and do the mod your self.

The price goes up on the x200/x220s the nicer they look, and if they work, but you are looking at a max price of $250 if you don't wait for the good deals.


Ah, that's actually pretty reasonable. I've been looking for an x220 as a cheap laptop to throw a BSD on and tinker, but was always a bit hesitant due to the old architecture. This would definitely solve that! (I also like that the person in your link is offering a nice display upgrade.)


Shooting liquid propane/butane into your laptop is absolutely insane. How does it even help lower the compile times if the CPU probably doesn't even thermal throttle? An X230 that I have can handle a high load without thermal throttling and yours should not be much different, unless the CPU thermals exceed 100C, at which it does start throttling.

Please check your cooling setup and replace the thermal paste with something high quality if needed as what you are doing right now is dangerous.


I downvoted you because canned air is not propane or butane.


This isn't 2002 where single core performance had increased by 4x and average ram has quadrupled.

Computers can now easily have a 10 year usable lifespan.

Heck Nvidia provides drivers for your modern kernel for devices all the way back to 2007.


Single core perf has become more than 50% better on desktop since Sandy Bridge, and it should be even more than that in TDP constrained environments like laptops because of reduced power consumption, which is partly why we now have quad core / eight thread ultrabooks. The total performance of such a device would almost certainly be more than double an X220 in a slimmer package.

Maybe 4x is your cut-off point for where it's worth it to upgrade?


There is noticeable on a benchmark and noticeable in actual use.

In actual use newer machines don't seem to come with much improvement in performance for a lot of tasks.

For me my limited supply of money is the primary constraint. I'll probably upgrade when my machine stops working.


Even when not having monetary constraints, it's probably better for everybody to upgrade only when needed :)


My home laptop is almost 10 years old now. With more RAM and replacing the HDD with an SSD, I keep trying and failing to justify replacing it.


My T420 is from 7 years ago, as is my desk neighbour's X220. I don't believe we're legacy. Well made laptops last a long time.

Anything requiring server is in server.


In the ThinkPad world, that's just hitting the middle of the bathtub curve ...


I wonder when the first mainstream distribution will make Wayland their default. So far, much time has been spent on that project and yet there is so little normal users get to see it in action.


Fedora made Wayland the default already. [1]

[1]: https://docs.fedoraproject.org/en-US/fedora/f28/system-admin...


It was default in Ubuntu 17.10. They changed it back to X.org in 18.04, though


This is good news! I wonder how Ozone on Wayland is going nowadays, as it would be nice to have both Firefox and Chrome booting in Wayland by default.


Now only if NVIDIA would start working on GBM and support Wayland...

Many would say to just buy AMD, but the power consuption story isn’t that great


Nvidia is working on EGLStreams support in wayland compositors. They finally got the memo, that the upstream projects won't work on their APIs, but accept the patches.


that's all nice but what about basic features on Android as pull down to refresh or rearranging top sites first?


Wish I could care about this more. But since the "scrapbook" add-on broke I haven't updated. That may be my terminal release for the rest of my life (since that page-saving add-on is my entire justification for using Firefox)


Why not switch to a note taking application with web clipper? It seems any of them would have similar functionalities.


First, I was running Javascript on a server. Now, I'm running X in a browser.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: