Remix.run Logo
dmitrygr 3 days ago

> Wayland support is very experimental and broken

You and everyone else, RGFW, you and everyone else.

colleagueRiley 3 days ago | parent | next [-]

X11 needs a real alternative :(

jll29 3 days ago | parent | next [-]

Are you kidding? I started reading the X11 handbook series in the 1980s and now it's 2024 and I'm nearly finished, and you want to replace it? ;-)

akira2501 3 days ago | parent | prev | next [-]

X11 is fine. It's mostly just Video Games that need an alternative. It'd be nice if there was a "pause X11 video card control and give exclusive access to a single application." Then there's no need to care.

ori_b 3 days ago | parent | next [-]

You just described X11's DRI (direct rendering infrastructure).

https://en.m.wikipedia.org/wiki/Direct_Rendering_Infrastruct...

freeone3000 3 days ago | parent | prev | next [-]

This actually doesn’t work with modern expectations.

Modern games are expected to work in multi-monitor setups and render in “borderless windowed” mode, so you can alt-tab out to multitask, or have a comms overlay. Single monitor single process gaming still happens, but a good 85% of setups (according to the Steam Hardware Survey) are not that. There are five games I know or that actually handle multimonitor natively of the hundreds I’ve played. So we need some form of cooperative multitasking for graphics with the window manager.

1oooqooq 3 days ago | parent [-]

Modern good games are not expected to "render in “borderless windowed” mode, so you can alt-tab out to multitask"

Really bad games with slow multiplayer match making lobby and tiresome repetitive gameplay and bad UX where you need to look most of the actual game information on a fan wiki, or triple A games where you have to login and enter credit card information on a "launcher"... those are the ones you expect to "render in “borderless windowed” mode, so you can alt-tab out to multitask". Good riddance.

Longhanks 3 days ago | parent | prev | next [-]

X11 is utterly broken for multi-monitor setups with different resolutions at different scales (e. g. builtin laptop screen @1.25x, external display at 1x or some variation of that). With high resolution screens (e g. 4k at only 27"), that setup is not uncommon anymore.

(Wayland is broken in very many other ways, though, so you trade one evil for... 5 others).

uecker 3 days ago | parent | next [-]

X was a very well designed system IMHO that could be evolved via extensions (e.g. how compositing was added etc.). It is sad that few people work on it anymore to fix such issues.

immibis 2 days ago | parent [-]

X isn't opinionated enough, and Wayland is even worse. While X has labels like "substructure redirect override" that in practice means "bypass the window manager" and tries to theoretically support multiple window managers, Wayland barely even knows what a window is!

immibis 2 days ago | parent | prev | next [-]

Correction: Xorg doesn't have good support for this. I don't think there's an extension for it in the protocol either, but one could be created - just as it has for Wayland. Apps that don't support the extension should be scaled by the compositor as usual.

X11 has a reasonably solid core, though, while Wayland does not.

alwayslikethis 3 days ago | parent | prev [-]

Wayland's scaling for 1.25x and even 1.5x is not so great either, though it is slowly going in the right direction with wp-fractional-scale-v1

3 days ago | parent | prev [-]
[deleted]
themerone 3 days ago | parent | prev [-]

What do you expect from an alternative?

colleagueRiley 3 days ago | parent [-]

- Better API design - Not being experimental after 11 years

I think that Wayland actually has some steps in the right direction, but overall I don't think it's actually a very good alternative. It's way more low-level than X11 and a lot of higher level features, like window decorations, are not even officially supported.

amjoshuamichael 3 days ago | parent | prev [-]

Yeah, I've been looking for a minimal SDL alternative for a long time and I was really excited reading through this as that solution, but the lack of Wayland support is a huge dealbreaker for me.

Are there any good minimal windowing utilities that support Wayland? SDL does a lot I don't need and I try to maintain minimal dependencies. I suppose I could just use glfw & libsoundio, haven't tried that yet.

colleagueRiley 3 days ago | parent | next [-]

As far as I know, RGFW is the only minimal windowing of its kind. I guess I would suggest either targeting XWayland or using GLFW.

The Wayland API itself also really sucks to work with, even more so than Xlib....

But, RGFW's Wayland support will probably be improved in the future. :)

3 days ago | parent [-]
[deleted]
nextaccountic 3 days ago | parent | prev | next [-]

Rust has a lot of those small libs, my favorite is miniquad

https://crates.io/crates/miniquad

Sharlin 3 days ago | parent [-]

Other alternatives: pixels, minifb, softbuffer.

colleagueRiley 3 days ago | parent [-]

Sure, but none of these are true alternatives because they are missing a lot of features that libraries like GLFW or RGFW have.

(They may be good alternatives for certain use-cases)

Sharlin 3 days ago | parent [-]

Oh, just based on the README I assumed RGFW was more minimal than it actually is.

colleagueRiley 3 days ago | parent [-]

Minimal refers to the code itself.

GLFW's codebase is ~10MB while RGFW's is about ~300kb. But RGFW tries to support nearly everything that GLFW supports.

Sharlin 3 days ago | parent [-]

Yeah, my bad :)

PittleyDunkin 3 days ago | parent | prev | next [-]

GLFW has worked well for me.

marcthe12 3 days ago | parent | prev | next [-]

Waylands problem is that to use it, you need code generation so the wayland backend kinda hard to design for a header only lib.

amjoshuamichael 3 days ago | parent | next [-]

I've seen some interesting work in doing Wayland by hand:

https://gaultier.github.io/blog/wayland_from_scratch.html

I'd also look at the work done on minimal wayland projects like [foot](https://codeberg.org/dnkl/foot), which supports wayland well and seems to be written by hand (see: https://codeberg.org/dnkl/foot/src/branch/master/wayland.c)

colleagueRiley 3 days ago | parent | prev [-]

I just have the Makefile do the code generation, it would be annoying for the user, but they can complain to Wayland if they don't like it.

vkazanov 3 days ago | parent | prev [-]

Isn't SDL itself is quite minimal already? I mean, it is definitely not high-level in any sense of the word.

slimsag 3 days ago | parent | next [-]

SDL provides..

..an image decoding library.

..an audio input/output library.

..a multi-channel audio mixer.

..ttf and rtf font rendering.

..networking.

..runtime shader cross-compilation

..its own entire graphics abstraction layer / API.

..its own shader language, shader compiler, and shader bytecode format.

I don't know at which point something becomes 'high level', but SDL is only 'minimal' if you use a subset of its functionality.

Sharlin 3 days ago | parent | prev [-]

Not minimal in the sense of "just give me a window, a minimal event loop, and a GPU context/swapbuffers function".

colleagueRiley 3 days ago | parent [-]

Even then, that's what GLFW is designed to do, and it's entire source code is still far larger than RGFW's.