Phoenix: A modern X server written from scratch in Zig
git.dec05eba.com
git.dec05eba.com
This project would satisfy people who really actually want Wayland, but were upset by transitional pains or interactions they had around it and want to stick with X11 just-cause while getting some similar benefits. This arguably does describe some people but not sure it's a whole lot in the long run.
But who knows, maybe this could also make an easier to maintain XWayland some day, or a nice basis for implementing more esoteric X11 bits down the road vs. the older Xorg codebase.
Like, why simple "copy the screen" got suddenly so complicated? Why every WM suddenly needs a bunch of features that before were just handled by display server, where they belong ? Why some(most) WMs handle title bars but GNOME doesn't ? Why someone decided title bar management is optional to window manager ?
X11 might need to go but Wayland have learned no lessons from it. It's just knee-jerk "if X11 done it this way, let's do it differently"
But hey, you can probably run automotive UIs with your desktop compositor.
And Gnome devs are just being silly at this point.
Are you implying title bars should be mandatory in all WMs? I'm using DWM on X and I love that I have no title bars. If a program tries to force one on me I disable it or use something else if that's not possible.
Not for the client, or if you want to write a wm and is forced to write a compositor.
And actually I'm not even even convinced about the server if talking about a minimal server like this that insists on DRI/GBM, and ditches all the old rendering cruft.
It shouldn't be hard, all I want to do is fuzzy match window titles to named audio streams in pipewire, but "Oohh noo that's a security flaw!" say the patronizing Wayland developers who care more about making their own lives as developers simple than supporting basic desktop functionality.
It also vastly improved battery on my Dell Pro laptop. 58% battery used in 7h45m (light compilation day, but no suspend).
This is one of my big problems with Wayland; the fragmentation of Wayland imposes an unacceptable cost to picking the wrong DE, whereas with X all my tools for X still work regardless of my DE.
Wayland doesn't solve any problems I have, and would create new ones, such as having to adapt to new tools or write my own compositor.
Battery life just isn't a relevant consideration for me.
The future of WMs is, IMO, Arcan - https://arcan-fe.com/ - but that's an ambitious project and I don't blame the main developer for deliberately going out of his way to avoid advertising it before it's ready. In the meanwhile, Wayland and X11 both more-or-less work with the occasional major pain in the ass.
It learned no lessons from X11. It made most things harder to write and pushed more things that really every WM needs and doesn't care much to implement differently to WMs making them harder.
For example, stuff like "WM need to manage raw inputs, so they can have more power over them" is cute on paper but in reality most of them don't want to because there is no benefit to reinventing that part. Sure, that part in X11 could be better, maybe it should have better interface for WMs to configure common options in common way without getting into input-driver-specific options, but that just required rework of the idea, not throwing it into the bin and replacing with near entirely worse framework that wastes everyone time.
Vulkan, various node replacements come to mind.
Wayland at this point has existed almost as long as X11, longer if you only count the Linux years, yet its still not quite there.
Read this including my response.
A lot of X features are actually Xorg features and they only work because there is a single implementation that everyone tried to integrate with.
Turns out the moment there are two implementations, which is hard on X and easy on Wayland, you can no longer rely on targeting a single implementation for direct integration anymore.
This means a lot of non-X but Xorg features need a protocol extension in Wayland, because things are being standardized that previously were exclusive to Xorg.
I think one of the intrinsic problems with relying on developers being paid by their employers is they can easily become personally disinvested from the thing they're maintaining; they get paid well, the day-to-day grind gets stale, they get interests and hobbies other than computing but keep working on the thing because it's their job. Eventually they find that just buying a Mac is an easier lifestyle at home, and gradually maintaining X transforms from something they do out of passion for the project into something which is just a job. So they look for ways to make their job easier, hit on the classic "instead of maintaining old thing it'll be more fun to make our own", and because they are now untethered from the needs of real users they only need to make sure the new thing supports the bare minimum to keep their employer happy. They no longer care how real users feel, any use case that isn't required in the checklists approved by management get deliberately abandoned. So we end up with Wayland lacking common sense desktop features in demand by users for years because it's simply not convienent for the developers who are now dispassionate 9-5ers.
I prefer to take my chances with enthusiasts keeping X working on shoestring budgets. Maybe a few more years of development of coding models will make ongoing maintenance easier going forward and I'll never have to switch. I'm willing to make that bet. If it turns out that in 5 years I am forced to switch, at least by then Wayland will be five years more mature, and maybe my cynicism will even be proven wrong by then and Wayland will be good by then (but I'm not holding my breath for that.) Anyway, I have nothing to lose by using X as long as humanly possible.
This definitely doesn't match my memory, and I was there :) Most of the good reasons remain unavailable in X11 to this day.
There definitely were some attempts to advance X11 that post-date Wayland, most notably the proposals by Keith Packard, but they never got much traction.
You two here don't mention any of the reasons. It is hard to discuss this when there are no specifics, so what was needed, and what was not added?
After a quick scan, Arcan seems to be pushing a microkernel approach, with some clients providing display server capabilities and others talking to them via shared memory. This will have the same problem as all other microkernels - nice for research, but the extra completely outweights the marginal benefits over a monolithic thing that generally has a smaller API surface to maintain.
>Applications will be isolated from each other by default and can only interact with other applications either through a GUI prompt asking for permission, such as with screen recorders, where it will only be allowed to record the window specified or by explicitly giving the application permission before launched (such as a window manager or external compositor).
You realize that's worse, right? And to be clearer: core Wayland protocol does not have countless ways. It has zero.
Instead of a single protocol with the strong X11 reference X server the wayland compositors pick and choose between libinput, or libei, or libportal with the InputCapture PR, xdg-desktop-portal with the InputCapture interface, some I've probably missed, or maybe you have nothing at all (weston). It's a gamble if your choice of desktop environment and it's wayland compositor's non-core wayland protocols will match up with those the developer for $software chose. On X11 linux everything that works somewhere works everywhere. With the various waylands if you stay within your desktop's ecosystem you'll probably not notice, but go beyond it and you will.
Each wayland desktop pretty much runs it's own compositor with it's own set of third party libs because the wayland core protocol spec is very minimal. I would say incomplete. ref: https://wayland.app/protocols/
Wait, what? I tried this last year. I didn't find any way to do this that wasn't dependent on the WM.
Something like a screen reader needs to talk to an app and query the toolkit for the contents of a window in a semantic way - that's a toolkit feature not a compositor one.
> Wayland has no concept of global coordinates or global key bindings. The protocol itself is designed around atomicity which is a nice concept, but is fundamentally in conflict to the need of assistive technologies to control the entire state of the desktop globally. As such, atspi methods like get_accessible_at_point are impossible in Wayland.
Wait so is this turning Wayland into a client/server model like X11, where eventually it could support existing window managers and other stuff separate from the compositor?
I remember a year or two ago wondering if that would ever happen and I think I only got one reply saying it wouldn't happen because it was unnecessary.
But, right now, XLibre[0] is available, ready for use and very active.
Tho admittedly kiosk-wm (https://github.com/JOT85/kiosk-wm) is much more succinct.
GLFW for my window library.
Wayland is overkill.
I would go straight /dev/fb if it meant I could also antialias and make it pretty and didn’t need a cursor.
iOS/Mac/Android is on completely other level.
I have not tried this myself, so I can not speak from experience, but if they have removed features that people used, then they are in a similar situation as wayland. So I don't see what the difference then would be. Perhaps your analysis was also incomplete?
The very thing that makes people biased towards X11/Xorg both negatively and positively is that it is a huge monolith and the only X implementation on Linux. The moment you have two implementations, you're gonna get the same complaints against the second X server as Wayland is receiving.
You think this is an indictment to the second implementation and that they shouldn't bother by saying an "analysis was incomplete" but in my opinion it's exactly backwards. This is an argument that eternally perpetuates X11 not because of technical capability but rather because it was there first.
After all, the moment there is any implementation that is second it might miss a single feature that nobody actually uses, but theoretically could be used when combining an old binary with a new X implementation.
But this argument misses the obvious fact that X11/Xorg is already dead since any code change will break existing applications. Meaning X11 has become an unsalvageable fossil.
I think there is a reasonably agreed on set of things that can be removed from X, like server-side drawing primitives, and GLX
It will be obsolete someday, anyways.
(For me this is specifically on Fedora, and I always switch back to X11 from Wayland.)
The only problem I have is with JetBrains IDEs, which seem to have shaky support. They're usable (meaning you can code), but the experience is so wonky that I basically consider they don't support Wayland.
The reason I switched from i3/x11 is that we've got some 27" 5k screens at work that are basically useless at 100%, and Sway handles different scaling settings flawlessly (except for IntelliJ, which seems lost).
As per Windows placement, Firefox won't restore windows on original positions supposedly because of Wayland, somebody please correct me if I'm wrong.
When I only use a scaling factor of 1 on all the screens, it's usable enough, although it still feels sluggish.
I run two different distributions myself, I know a bunch o people on even more different distributions, set of configuration and based on empirical analysis I can assure you that no one has problem with windows placement.
Out of the box I used have more problem with X11 (tearing and font rendering being the most annoyingly common ones) than I have with Wayland.
If it also runs Wayland apps, many may prefer it actually.
Actually I still have more issues on Wayland than X. Although it is at least starting to swing in the other direction - e.g. KDE's screen recording feature doesn't work on X. The button's still there but if you click it nothing happens.
The only thing maybe worth discussing is video acceleration. this aside, I have been using gnome on Wayland for years and no problems what-so-ever. I really don't know what the fuss is about.
I would prefer that people start moving this legacy nonsense behind and finally start accepting new and better things and focusing on things that have future. Same thing happened with systemd, it improves massively everything Linux, yet some people just want their services started with scripts.
What problems do you have when things don't work for you on Wayland?
* straight up doesn't work on at least one of my laptops (driver problems AFAICT)
* does run on the other one, but crashes at an alarming rate compared to Xorg
* breaks all of my accessibility tools (some have (worse) replacements, some don't)
You can blame the apps all you want, but it's a fact of life, and Wayland has been around for 18 years.
At this point you'd hope they'd pull an early 90s Microsoft: https://www.joelonsoftware.com/2000/05/24/strategy-letter-ii...
I think we are finally at the point where you can say most things work and it's silly to go back to X11, but even so Wayland has clearly been a huge failure.
It's a bit like the name 'Apollo'; besides the moon landing project, I know like 2 dev projects called that and also there is a sales SaaS platform with that name.
Surely people should run a search first before choosing a name...
It's symbolic.
I remember people naming new software projects this back in the 1980s for the same reason.
They could at least use PhoenX or FenX to link it with X
It was Project Phoenix (resurrection of the Netscape browser). This resulted in the Firebird browser (Firebird and Thunderbird). But Firebird was an existing database that objected to the name. So, we got Firefox instead.
At least that is how I remember it.
All the first 3 names were taken. They probably had to bribe even the holders of the Firefox trademark to get it (though the terms were never disclosed).
Edit: Here you go: https://www.zdnet.com/article/mozilla-holds-fire-in-naming-f...
An X11 rewrite with some security baked in is an awesome approach. Will be watching!
I’m all for an X12.
If you take the time to read through that (very partial) list of cruft and footguns in X11 it probably makes it a little easier to understand why a clean-slate approach was able to attract momentum and why many hands-on involved developers were relatively tired of X11. Critics would of course respond that backwards compatibility is worth the effort and rewrites are often the wrong call, etc. It's the Python 2/3 debate and many others.
Just... without all that mess that turned out to be at best +/-, at worst outright negative causing problems for everyone involved. And near all of the "advantages" are "the server is built from scratch" not "the protocol was the limitation"
For example, in python 2 you could explicitly mark unicode text with u"...". That was actively BLOCKED with python 3.0 which supposedly was about unicode support! The irony was insane, they could of just no-oped the u"". I got totally sick of the "expert" language designers with no real world code shipping responsibilities lecturing me. Every post about this stuff was met by comments from pedantic idiots. So every string had to have a helper function around it. Total and absolute garbage. They still haven't explained to my satisifaction why not support u"..." to allow a transition more easily to 3.
Luckily sanity started prevailing around 3.5 and we started to see a progression - whoever was behind this should be thanked. The clueless unicode everything was walked back and we got % for bytes so you could work with network protocols again (where unicode would be STUPID to force given the installed base). We got u"" back.
By 3.6 we got back to reasonable path handling on windows and the 3 benefits started to come without antagonistic approaches / regressions from 2. But that was about 8 years? So that burnt a lot of the initial excitement.
> [...]
> By 3.6 we got back to reasonable path handling on windows and the 3 benefits started to come without antagonistic approaches / regressions from 2. But that was about 8 years? So that burnt a lot of the initial excitement.
So it's a great analogy. Wayland started out proudly proclaiming that it intentionally didn't support features in the name of "security" but everyone should "upgrade" because this was totally better, and has been very slowly discovering that actually all the stuff it willfully dropped was useful and has mostly evolved back to near feature parity with Xorg.
It’s always drama and they’re the center of it.
(I’m joking of course, Merry Christmas)
I remember Usenet.
X11 was built for multi-user terminals a kin to today’s Microsoft VDI garbage.
There’s some good. A lot of bad. And some WTF in there.
Also happy winter solstice.
In addition, you can offload OpenGL compatibility to Zink (again leaning into Vulkan).
> pull in a group of long term maintainers.
"Use new cool language" seems to be a prerequisite for this nowadays ...
At least Zig is very compatible with C.
Just use OpenGL. I don't know when this trend to overcomplicate everything using Vulkan began, but I hate it.
Vulkan has substantial advantages for multi-threaded code, as well as exposing the underlying asynchronous nature of running code on the GPU. The kind of thing you want to be able to control with a desktop compositor where controlling vsync and present timing is very important.
Personally, I have a 3200x2400 e-ink monitor that has a bezel that covers the outer few columns of pixels. I use a custom modeline to exclude those columns from use. And, a fractional scaling of .603x.5 on this now 3184x2400 monitor to get 1920x1200 effective resolution. Zero idea how to accomplish this with wayland-- I do not think it is possible, but if anyone knows a way, I am all ears.
I ran into, at least, ten issues without solutions/work-arounds (like the issue with my monitor) when I tried to switch this year, after getting a new laptop. Reverted to a functional, and productively familiar, setup with X.
Overscan is not supported in wlroots yet. Seems the issue is that handling overscan is display driver specific.
But, now I know the keyword to look for.
I've been an i3 user for almost two decades, but eventually switched to Sway - to this day there's no InputCapture portal, so I can't use Synergy with Sway, forcing me to switch to i3 while I'm working.
It's been over 10 years of things like that. There's always SOMETHING missing.
I'm still using Wayland because it's what came with my distro (endeavour OS, gnome), but it's really strange how it came broken out of the box.
https://gitlab.com/yjftsjthsd-g/docker_sway-vnc
(This is not a defense of Wayland, just trying to share useful information)
Also that's only really relevant to this running in a container. My point was that you can have headless Wayland.
My desktop is a bit long in the tooth (22.04), but I've long given up on trying to screen shot or screen share from Wayland. I have my Macbook sitting next to it and use it for those things, where it works basically flawlessly.
Kind of waiting for 26.04 to upgrade at this point, but I'm not really expecting any of this to be better yet.
edit: If I had it to do over again, I wouldn't have gone Wayland at 22.04.
What's missing?
This dilution of responsibility should make you feel much better.
Any function that is a threat should be behind capabilities.
A program should be able to request moving its windows. The user should ultimately decide what should happen: allow or nah.
That limited capability still has a risk of denial attacks (just throwing up pop-ups that extend beyond the current window’s boundaries), but those can be mitigated in a number of ways (limit the new window’s boundaries to the current window’s, or just limit how many windows can be opened, etc.).
If you took people who absolutely never tried any computing, and gave them macos, windows, and for example Plasma, they would NOT consider windows or macos to be ready for the desktop. If you go 15 years back, even way more so.
even in the early 2000s, windows was so hilariously crappy that you had to make floppy disks to even get to install the thing. If PCs didnt come preloaded with windows, regular users would never ever be able to install it, versus the relative ease a typical linux distribution was to install. This is also one of the large reasons that when their windows slowed down due to being a piece of shit with 1000000 toolbars, people threw it out and bought a new, despite the fact that a reinstall would have solved it.
A Window Manager and Window Server don't come by default with Linux... It's always an install-time option on the major distros.
> even in the early 2000s, windows was so hilariously crappy that you had to make floppy disks to even get to install the thing.
Windows in the early 2000s installed just fine without a floppy directly from CD or PXE booting.
Windows in early 2023 didn't even detect the network card it needed to download network card drivers. After changing mobos I needed to boot into linux to download network drivers for windows...
Windows in early 2025 still uses SCSI emulation to talk with NVMe and only now the server part got a proper driver
Windows in early 2025s still need virtio driver injection to boot properly as a VM without IDE emulation
"Drivers working out of the box" were never windows strong part
You can enable this in Win 11 25H2. I have it enabled on my box. Doesn't seem to make that much of a difference, so it's more or less a moot point that it has been using SCSI emulation.
> Windows in early 2025s still need virtio driver injection to boot properly as a VM without IDE emulation
Interesting, in Hyper-V that's a non-issue.
when was it sata became the norm? im thinking circa 2001-ish, and what windows was latest here? im thinking windows xp. lets try remember, did windows xp include sata drivers on the installation medium?? oh wait, it didnt. There wasnt even ahci at the time, and windows xp didnt include a single sata driver for any of the chipsets at the time
> A Window Manager and Window Server don't come by default with Linux... It's always an install-time option on the major distros.
desktop distributions generally come with a desktop environment default selected, or prompt you to choose between a few. one feature that has been there since more or less forever is alt + left/rightclick mouse to move/resize windows, which is significantly better than finding the title bar or corners like. for an operating system called "windows" its pretty hilarious it has the worst window management of them all, dont you think?
> desktop distributions generally come with a desktop environment default selected
You missed the point. "Linux", the kernel, does not come with a WS/WM.
There's some truth to this. I've been installing fresh Windows 11s on family computers this holiday season, and good lord is it difficult to use.
The number of tweaks I had to configure to prevent actively hostile programs from ravaging disk read/writes (HDD pain), freezing and crashing, or invasive popups was absurd.
I don't know what "prime time" means here.
edit: apart from, you know. Applications and drivers for random hardware.
It was fine for non-technical users since at least early GNOME 2, if you're ready to help them set up and maintain. Semi-technical users (Windows power users, gamers, &c — people who like to install and configure things, but fear the deep dark abyss of the terminal) were and remain more problematic.
Unity days were the nadir of linux desktop ux — it was when Gnome 2 was gone, and 3 not yet there. Still better than contemporaneous Windows 8, though.
People are always task-oriented, not tool oriented unless they’re nerds.
It was not a war "which desktop is easier to use", it was "which system can run stuff I need". And if "the need" was "video games and office stuff", your only choice was windows.
KDE from 15 years back was HUGELY better than windows at the time, and frankly, also windows now
As a user you can pass `--release` to `zig build` to request release mode. If the application doesn't want to pick for you, you'll get an error and then you can pick for yourself.
In this case, it looks like the author of Phoenix wants to choose ReleaseSafe as the official release mode of the application.
Phoenix is the name of my hometown, btw.
I say let X11 die, bury it, and never let it rise again.
Then we can all focus on making just one display server as good as possible.
X11 was a single, pretty janky implementation. Wayland is the worst of both worlds -- it's cleaned up a little, but it's still kinda janky. In exchange for a little bit of cleanup, mainly around bitmap fonts, it's no longer a unified protocol.
And to top it off -- it kept the worst part of the X11 protocol, the XKB extension, but got rid of input handling entirely, which means that every platform needs to reach for platform specific code to implement reading from the mouse and keyboard.
Yay.
With Wayland, you don't even get compatibility with Gnome and KDE. You need conditional compilation to get mouse events if you port to FreeBSD Wayland.
For the medium term, if your goal is to reduce fragmentation, X11 is the portable target, even if you use Wayland.
You cannot possibly use this as an argument in Wayland's favor. X11 sucked because it baked everything, including multiple outdated kitchen sinks, into a single Xorg monolith. Wayland sucks because it factors out everything, including really important features, into optional extensions, ensuring that anything more interesting than "draw pixels to a window" will always be different on every single compositor.
So, in theory, we can embrace a rather-minimal X11 implementation that can run the modern UI, including some desktop features missing in Wayland.
The distribution sprawl I largely see as a detriment to the ecosystem.
totally awesome! And once we are done with X11, lets put pulseaudio to the grave! We can all focus on having an audio stack that does realiably stream to many sinks!
And polkit... su and sudo should have been enough
That'll happen first, I think. The trick is that pipewire is actually a fully functional replacement, instead of trying to declare everything out of scope, so with only minor effort people can just switch and everything works.
Run gui apps in your container, local or remote.
Perfect
This is really the main issue with wayland. Yes, it might be more stable these days and work fine for you. We can talk how how it makes writing you own WM needlessly complicated and all that but the one thing that makes wayland unacceptable is its lacking accessibility story. After so many years.
Accessibility is not something you can worry about adding later. It is the first thing you should think about when designing new software.
I've been using wayland for a while now and am very happy with it, but my accessibility needs are pretty basic.
Here is a slightly-hopeful article: https://fireborn.mataroa.blog/blog/i-want-to-love-linux-it-d...
I don't think there's any concrete proof of this. Ideally I think people want accessibility handled by their WM/DE; you're not getting Windows or macOS-quality a11y "for free" unless your desktop embraces it. At which point you might as well make it a separate, aftermarket protocol and slap it into d-bus.
If the Linux ecosystem is going to be fragmented and move past single-point-of-failure, polishing Xorg's accessibility works against the goal of standardized a11y.
From the README:
At the moment it can render simple applications that do GLX, EGL or Vulkan graphics (fully hardware accelerated) nested in an existing X server.
And that sounds about right. As far as I can tell it doesn't yet have a lot of the core X11 stuff that "normal" clients expect. For example xterm doesn't start because requests like X_AllocColor, X_OpenFont, X_PutImage (a few picked at random from the error output) are not implemented yet.glxgears on the other hand does work :)
This is interesting to me, why would vsync being enabled mean that the desktop compositor needs to stick around for a full screen app?
In X11 "screen" has a particular meaning, and only supporting a single screen doesn't preclude multi-monitor support or virtual desktops.
I'm just thinking why did it take me so long to do the switch. I still keep X around, but not sure how long. Like keeping vim around after switching to nvim few years back..
https://github.com/marler8997/zigx
https://www.youtube.com/watch?v=aPWFLkHRIAQ
Compared to libX11, it avoids dynamic dependencies, uses less memory, and provides better error messages.
This is true, although entertainingly, the "server" part has always been easily confused.
In X11, the "server" runs on your local machine, and the "client" frequently runs on a remote system.
The way most people think about it, "client" is your local machine and "server" is the remote machine that has lots of applications and is potentially multi-user, but X turns that backwards. The big iron is the client and the relatively dumb terminal is the server.
This is because of its mainframe style history and technically it does make sense, it's just that everybody else does things the other way around.
For the people who weren't around in the ancient mainframe times who end up messing with Linux for the first time, this is confusing for a while.
Add to that that the user manages the ssh connection while the X connection is managed for them...
The server is usually a remote machine, especially back in the time when "client-server" architecture was emerging in mainstream (business) vernacular.
[1] https://www.donhopkins.com/home/catalog/unix-haters/x-window...
https://en.wikipedia.org/wiki/Windowing_system#Display_serve...
XLibre is trying to advance the existing implementation which Xorg abandoned, whereas Phoenix is writing a new, compatible server from scratch.
I doubt the XLibre authors understand the X security model, either – they never do, in forks like this – and they've alienated most of the security researchers who might otherwise clean up after them.
Phoenix and Wayback are much more interesting projects, in my book. Wayback's designed to actually work, and I expect it to be production-ready much sooner; but I expect Phoenix to be the more technically interesting project, since it's deliberately breaking from the X11 spec.
this might make a good alternative to Xwayland though, which can be exciting.
We can see innovation in this space.
Next I suppose is porting Motif to Windows.
OP if you're the author I suggest you rename to avoid confusion. Don't name it Rails either haha!
(I still think they should've stuck with "Firebird", little danger of confusing a browser with a database system mostly used by Delphi devs)
But I don't see how a X server implementation should avoid name collision with web frameworks.