355 points · by Decabytes · 2y ago · 245 comments
For the time, it was just jaw dropping. For context, I think it was before Atom, VS Code or Electron (or possibly even NodeJS?) was a thing.
Don't know if that HTML renderer is still around or not.
https://docs.gtk.org/gtk4/broadway.html https://www.phoronix.com/news/GTK4-Broadway-Being-Used
I did not considered it as main/official backend but it is still there and was ported to Gtk4.
Back then, I did run Open Office in Firefox and it amazed me.
[1] https://gitlab.gnome.org/jpu/cambalache
[2] https://blogs.gnome.org/xjuan/2021/05/18/merengue-cambalache...
(a) using browser scrolling (the web doesn’t expose the right primitives to make a scroll-event-based reimplementation anything but bad, barely noticeable in some configurations but painfully broken in some of the most common configurations);
(b) using browser text rendering (strongly preferably by DOM nodes, but even canvas plus fillText can be acceptable); and
(c) handling links with real <a> elements (no alternative can provide the same functionality).
Broadway fails all three of these (reimplementing scrolling, rendering text on the server and sending images, and I think actually locking up when you try to click on a link). It also fails my fourth and fifth tests, which are (d) handling text input properly (it looks like it just uses key events, not even a backing <input> or <textarea> or contenteditable, so IME composition fails completely and keyboard navigation will presumably be GTK rather than native); and (d) having a meaningful accessibility tree (preferably backed by normal DOM stuff, but not necessarily; I place this one last despite its importance because it’s likely to be more retrofittable than the others, though it’ll still generally be hard).
I’d count Broadway as suitable for tech demos and for personal use where you know you don’t mind its limitations, but not for any sort of public deployment. It’s basically just an RDP/VNC sort of thing, with a smattering of DOM use. (Also remember that’s how it works—the code is all running on the server.)
I agree that real links should always be used to represent links, but if you were to emulate links surely it wouldn't be that hard? Just allow middle-clicking and ctrl-clicking and you should have the basic functionality. Is stuff like the ability to drag a problem?
And then beyond that, well. Right click or long press, browser context menu with things like copy, bookmark, open in new tab, open in private window, share… you can’t emulate most of this at all. And hover to see href in the browser’s status bar. And so it goes on.
No, the only acceptable technique is to have the user interact with a real HTML <a>, HTML <area> or SVG <a> element.
Edit: I have replied from an older state of HN, and haven’t yet seen your other comments. Fair enough, didn’t think hard enough of other edge cases, thanks!
Maybe later they moved to canvas. Or like I said, I might be mistaken.
Recently however, Flutter had two backends for web. One HTML based and other canvas based.
Some WebGL etc might be in the works.
It might not sound impressive in 2024 but back then, it was a huge deal. Very daring to even attempt something like that IMHO.
It was a time of YUI, jQuery, ExtJS, script.aculo.us and such.
I mean cool, yes....but it wasn't generating DOM elements/complex HTML or anything like you're trying to sell it as.
https://github.com/moondev/gtk3-docker
My use case was running a browser inside a browser to easily interact with Kubernetes clusterip services without needing to port forward or proxy.
Another awesome example: running virt-manager to run a vm via the gtk virt-viewer (and interacting with it through the browser)
There's some fancy bridging modes to run apps in a browser, but the author has also been working on a way to make wasm Wayland apps run directly in the browser tol.
https://github.com/qbittorrent/qBittorrent/tree/master/src/w...
Now we just need proper support in Wayland and we'll finally have support for HiDPI in all major Linux DEs.
Keep in mind, developers strive good solutions. Users need good solutions. Companies are often happy with less reliable solutions because they are forced to be fast. And this less reliable stuff tends to stay long.
It's just sad that Gtk used to have this functionality and dropped it when Gtk3 was envisioned, as it meant the ecosystem was stuck waiting for over a decade.
So it's just as impossible as thumbnails in the file picker? The insanity of the GTK and the resilience of people willing to put up with it is baffling to me.
A honest „thank you“ to the people which made the thumbnails possible would be helpful. And involving itself. Or spending money. Gtk and GNOME are not companies. People need a motivation - from their work or from outside.
I had multiple discussions here in HN with users who wouldn't believe that, given fractional scale ratios, _anything_ else than direct fractional rendering produces significant blurriness. (And note fractional rendering can also produce blurriness, e.g. through misalignment).
If your 1200 × 800 window is set to be scaled to 125 %, with the unified renderers, we will use a framebuffer of size 1500 × 1000 for it, instead of letting the compositor downscale a 2400 × 1600 image.
The explanation is a bit confusing to me. I think they are saying that a window that should be drawn as 1500 x 1000 pixels on the screen because of 125% scaling would have 1200 x 800 pixels in application pixels. Since OpenGL and Vulcan use floats to render, they might as well render directly into a buffer that can be rendered 1:1 on the screen by transforming the coordinates in the instructions.If that's what they are doing, that sounds like sanity finally.
Instead of cutting its losses early and dumping X11, both the Unix vendors and open source spent far too long trying to make lemonade out of a truckload of rotten lemons. And that’s why Linux GUIs are so far behind.
It’s notable how rapidly Apple was able to evolve their Unix GUI because they were not tied to X11 and instead embraced the integrated model, even designing their own GPUs nowadays.
Apple rapidly evolved their GUI because they are trying to support just the one. And, frankly, they are starting to buckle on the idea that they are fully coherent.
I disagree. Other platforms did similar things where clients would command the OS what it should draw and the OS would handle all app's rendering which allowed for good performance on primitive hardware. Like other display severs X did evolve to also be for passing around framebuffers of what the app drew once hardware became capable. X's problems come from being hard to maintain, being a monolith of unrelated concepts, having poor security, etc.
Direct3D on Windows: app renders something and calls IDXGISwapChain.Present. The implementation communicates with the desktop compositor running in the dwm.exe process, dwm.exe renders the entire desktop composed of multiple windows, then communicates with physical GPU to wait for next vertical blank event.
Bare metal Linux with DRM: app renders something, calls drmModePageFlip(), then waits for next vertical blank event with poll() and drmHandleEvent() functions. Embedded Linux developers did an amazing job about DRM/KMS, in my experience the API is both reliable and efficient.
X Window systems have multiple different methods, glXSwapIntervalEXT, glXSwapIntervalMESA, glXSwapIntervalSGI, but in practice none of them is reliable, and on some systems none of them is even supported. Unfortunately, this makes rendering tear-free 3D content on X11-based desktops hard-to-impossible.
Trying to separate X from the client/server model would be like saying: "I like Unix just fine, except files and processes and the shell and the software tool philosophy, really." — You just don't have much left.
I’m curious to see how much of an impact the wayland architecture will be, and if ‘gnome only’ apps become a thing.
Sidenote: I hacked the wayland protocol implementation for gnome into working at least for SteamVR, but at least with AMD gpus there is some serious bug preventing the card from performing properly. It basically throttles itself for no reason and never hits the refresh rates needed for smooth VR, especially since there is no asynchronous reprojection at the moment. So while ideally the drm-leasing problem would be solved already there are other even more important problems to solve with linux VR for now.
I wonder if a UX toolkit could be completely declarative and semantic - "I need a master/detail view, a list view with the following fields, some actions, ...". At the high level you don't give any positioning, or styling. It would automatically use the appropirate system widgets. Then on top you would add some polish by using a bit of CSS, or maybe an escape hatch to get the native widgets.
Almost everything that is not a browser, a WYSIWYG editor, or a media viewer would fit that mould. The kicker is that from such a description you could easily generate a TUI.
A symptom is that you have tags like "Rectangle" and attributes like "Margin". The high-level description shouldn't say anything about presentation, just what you want to accomplish. The building blocks should be like "CRUD Editor" or "List-Detail view".
> No, the new renderers are not faster (yet).
I think yet is here the important word.If you see a noticeable performance decrease:
> GSK_RENDERER=gl
Please keep in mind that it is unlikely that Microsoft, Apple or Google would discuss these. It would be probably „forget the old API, here another API“ (Microsoft), „enforced from ${WEIRD_NAME}“ (Apple) or „you won’t get that update“ (Google).It would probably have been a good idea to track performance throughout the implementation and iterate on that instead of "architectural purity".
> Proper color handling (including HDR) > Path rendering on the GPU > Possibly including glyph rendering > Off-the-main-thread rendering > Performance (on old and less powerful devices)
(Which is not to say that tracking performance isn't a good idea. It's just that "architectural purity" sounds needlessly dismissive to me.)
I'm ok with performance leaning on advances in the hardware. I'm also ok with performance dropping if you are pushing more pixels. But, we had high resolution displays years ago. Such that that is a tough hill to defend.
I don’t think I get your point here. Gtk 4 is retained-mode whatever renderer you use; Vulkan and OpenGL are immediate-mode (well, kinda) whatever renderer you use. Whatever problems that forces in the new renderers would be just as present in the old ones, wouldn’t they?
Vulkan and OpenGL, though, are in no practical sense immediate mode: You need to draw the whole frame every frame (barring a few exotic extensions for compositors and such), so you need to retain the state of everything in the frame so you can draw it.
2D graphics have very little in common with game engines. The problem is very different in many regards. In 2D, you generally have Bezier and other splines on input, large amount of overdraw, textures coming from users complicate VRAM memory management. OTOH, game engines are solving hard problem which are irrelevant to 2D renderers, like dynamic lighting, volumetric effects, and dynamic environment.
https://www.factorio.com/blog/post/fff-251
GTK/Qt are usually good/very good with their integration with the OS, accessibility feature, keyboard navigation, handling of features like copy/paste, ... These are the kinds of things that game ui toolkit tend to completely forgo since they don't need it, and focus instead on performance, theming, integration with a game engine, ...
Theoretically, you could say that the renderer is agnostic with this, but in practice, it is not completely true. And also with the simple fact that you have a limited budget to work on feature, and they both rather work on different feature. Having a very fast and accurate renderer is just not as important for desktop GUI framework than for game UI toolkits.
Text is also the bane of renderers--there is a reason why we have exactly 3 text shaping engines--Windows, Apple, Harfbuzz. Text is a beast to deal with and is often ill-specified.
Text is also the bane of GPUs--we don't have good GPU-only algorithms for taking a string of text, handing that to the GPU, and having the GPU render that directly to a buffer.
Text is also something that games suck at rendering. SDF (signed distance fields) are considered a good rendering of text in the 3D world and they are blurry as hell.
I do think that the modern GUI world is going in a lot of wrong directions, but you must deal with text accurately to call yourself a real GUI.
I'm very skeptical that a bunch of game developers are going to whip together something that crushes Skia in performance without sacrificing a ton of capabilities.
I am not sure, if I understand you right, but do you mean rendering to pdf or svg instead of the GPU?
If so, are there real world use cases?
"crushes Skia in performance without sacrificing a ton of capabilities"
Same question, what of those capabilities are really in use and needed? Linux GUIs in general are really not a beacon of light, in terms of performance or usability. I strongly suspect things could be better, if some bloat would be removed.
I am amazed with what is possible with PixiJS, a renderer for the Web, using WebGL and soon WebGPU. Having something simple, but powerful as the base, would be my way to go.
While yes it would be great if a community could raise funds, that coordination job itself would have to become someone's not-paying-the-bills work.
As much as I love Open source/Free/Libre software and am grateful it exists (and contributing to it, when possible), I've a long held belief that it is the pursuit of the privileged. You need to have the privilege of free time and then the privilege of being able to choose to spend that free time on something that doesn't improve your standard of living and then the privilege of being able to do it consistently.
I benefited a lot of Open Source in my career, life so I am very thankful for all contributors (and try to give back in money/time, when I can afford one or the other).
What really annoys me, that my government does not mandate that software build with tax money must be Open Source.
That would go a long way to fund Open Source and improve the quality.
In principle, yes. In practice, most of the "community" is paid developers for companies like RedHat. So while they do have to pay the bills, they do so by those FOSS contributions.
That said, in the context of what the OP was saying, unfortunately, this is a chicken-and-egg situation. For someone, like the OP, who would like to get paid to do OSS, they'd need to have a reasonably active OSS presence prior to being hired at places like Red Hat. Which is another aspect of my original point of contributing to FLOSS being the pursuit of the privileged.
Step one: get the knowledge out there. Have those developers at least, I don’t know, talked about what makes those toolkits better at GDC?
None of these apply to a generalist renderer, therefore it can only "lag behind" the game ones. (Unless maybe if we're talking about the "human side of the question" : what are the best designs, layouts for a generalist human/machine interface ? Here it's the generalist GUIs that I would expect to be a couple of generations ahead (Xerox' labs, Apple's Macintosh, IBM's Common User Access standard, CERN's World Wide Web...)
If you think you could contribute you can apply for them.
I guess you will probably find there are already brilliant and competent people working on this stuff and the problem is not so easy as you believe.
Edit: In particular, Matthias Clasen, the guy blogging here, has been with Red Hat for many years.
I'm not saying that's the correct approach for GTK, just noting is not an absurd idea.
And FOSS devs always create non-hideous maintanable code that everybody understands /s
Also, you say they are a couple of generations ahead, but do these kinds of software need to be bleeding edge? Even many games don't, the kinds of software in research labs that do pay even better than gamedev (and of course require PhD's and whatnot).
>I sincerely hope this attitude does not creep into FLOSS and Open Source more then it already did
If you took away people working on FOSS because they're paid to, that wouldn't contribute or drop to 1/10th the rate otherwise, you removed the most prolific and important maintainers and contributors of lots of huge FOSS projects.
The primary difference between professional firefighters and their volunteer counterparts is hours on the job. When I graduated from the state academy, I knew as much as about firefighting as any of my fellow graduates and had been through precisely the same training requirements. However, the gap is going to open up very rapidly since the career guys will be doing regular shifts every week, whereas I will be answering 1-3 calls a month on average, most of which will not be fire-related. A year from now, the career guys will be even more familiar with everything we learned during our certification training and more, while I will be working hard to remember any of it.
So the question is: how well does this analogy hold for s/w development?
It doesn't.
First of all, the gap between most proprietary development outcomes and their FLOSS equivalents has more to do with UI/UX design questions than actual coding skills. At the source code level, it's generally proprietary projects that are "burning down left and right" (shoddily and quickly built, with inadequate attention to engineering and insufficient caring about one's work due to marketing deadlines).
Secondly, the difference between proprietary developers and their FLOSS equivalents in terms of hours of experience is not deterministic. It's going to be a function of employers, personalities, life situation. Plenty of (typically younger) FLOSS developers squeeze in more quality hours on their FLOSS work than their proprietary cousins do.
Thirdly, a firefighter only gets to put out the fires that actually happen. A software developer can pick their own problems and goals and work on them at any time. There's no relationship between the outside world and your ability to advance your skills and knowledge.
https://news.ycombinator.com/item?id=39151000
comes to mind...
Thanks for at least replying, everyone else was just downvoting.