Hacker News new | past | comments | ask | show | jobs | submit login
The Broadway Windowing System (gtk.org)
118 points by thunderbong 12 months ago | hide | past | favorite | 28 comments



I've used this to develop GTK applications in the browser using VS Code + GitHub Codespaces. It works quite well:

https://alnvdl.github.io/2023/11/18/a-cloud-based-vs-code-wo...


This is very cool! Gonna give this a shot.


Qt supports this too:

https://doc.qt.io/qt-5/webgl.html

I've used this to let friends on IRC paint on my LED shelf (https://github.com/eikehein/hyelicht), which has a Qt-based embedded and phone app GUI, over the internet. Cheap fun!


I think Qt's is "better", in that GTK's just streams pixel data to a HTML canvas. Looks like Qt actually streams the WebGL drawing commands to the browser, which does the rendering itself. Certainly that's still not super fast, as the drawing commands are sent over a socket, vs. directly to the GPU's GL driver... but presumably more performant than rendering in the app (even if using the GPU to do so), and then copying the pixel data into network buffers.

Either way, it's a cool feature in both toolkits. (Not trying to belittle GTK here.)


AFAIU for 'heavy' 3D applications like AAA games the BW over the PCIe bus to the GPU can be a lot higher than what comes out of the cable to the screen. So just sending (compressed) pixels is not necessarily a bad remoting strategy.

Though for something simple like just rendering GUI widgets the opposite may very well be true.


Apparently was around back in 1997 (but via a browser plug-in): https://web.archive.org/web/19970707154444/http://www.opengr...


> X11R6.3 just may be the most powerful innovation ever introduced to the World Wide Web.

Now there's a quote for the ages.


That's immediately what I thought of too


I remember when Alex Larsson announced this as a POC. I tried it out, it was pretty neat and worked well. I was always sad it kind of languished or didn't get any attention after that.

So I'm curious, is it back with a vengeance? Are people working on this?

See here from 2010: https://blogs.gnome.org/alexl/2010/11/23/gtk3-vs-html5/ More here in GTK4: https://blogs.gnome.org/alexl/2019/03/29/broadway-adventures...


I'd be interested to know this too but I'm not hopeful. I imagine it's up here because it was mentioned in the discussion on the New renderers for GTK[0] post a couple of days ago.

[0]: https://news.ycombinator.com/item?id=39172377


Around and around we go.


It says "using HTML5 and web sockets." Does this mean the application freezes if the connection to server is disrupted?

Could developers use this to make web-based apps along-side desktop clients? If so , Desktop frameworks like GTK and Qt should focus on this idea more to reclaim the desktop from the monstrosity that is Electron.


I'm not sure how this could reclaim the desktop from Electron. If anything, this gives Electron developers another option by running a local server in the app and rendering it in Electron.


Wait, does this mean I can use any spare tablet, laptop or smart TV as second monitor for, say M1 running Asahi? Wonder what's the performance for non-game usage?



can a VNC client acts as an additional display?


The VNC client can display whatever the server sends it. Doesn't even have to actually be images of a desktop at all.


The question should've been "can a vnc SERVER serves as a virtual display?".

On that, I found https://github.com/kbumsik/VirtScreen


Many environments also include native virtual display support so you don't even always need a special VNC server. On Linux projects like that tend to just automate it but sometimes it's pretty easily to do manually. E.g. on Sway you just define the virtual display the exact same manner as you do a physical display and then VNC in to only that display. On other operating systems like if it was running native macOS projects tend to do more of the heavy lifting around making the virtual displays actually happen.



Is this sending rendered images as binary over websocket and then into a HTML5 canvas? Or is there something especially clever going on?


We've come full circle. Web apps wrapped in Electron as native apps and native apps run in the browser.


Can you recursively run gnome web / epiphany on itself using broadway until you run out of port numbers or memory?


replying to myself. Nope, because broadway doesn't support OpenGL apparently:

* (epiphany:13774): WARNING *: 12:18:59.172: Disabled hardware acceleration because GTK failed to initialize GL: The current backend does not support OpenGL.


When I tried it, I couldn't figure out how to make it non-blurry.


Make sure the resolutions match, maybe. Either by fullscreening the browser window, or resizing it down to match the resolution that's getting sent.

It might be bugged and change the sent resolution when you do this though. (based on my limited experience with x11 forwarding)


Love Broadway, use it on WSL1 with QEMU.


[flagged]


It's like trying to photograph a mirror. It looks like the application you build with it.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: