Live data from Hacker News

How X Window Managers Work, and How to Write One (2014)

jichu4n.com

151–160 of 250 posts

Re: How X Window Managers Work, and How to Write One (2014)

#151
post #123

Earlier quoted context omitted.

There's absolutely no reason to write an X server from scratch to add native compositing support. You're also massively overstating the complexity of an X server. Writing X servers that are advanced enough to be usable is something a lot of individuals have done. It's nothing like matching a modern browser. Incidentally, if I were to try to do this today, I'd gut a proxy like Xephyr and make it rootless to support ol…

> You're also massively overstating the complexity of an X server. Writing X servers that are advanced enough to be usable is something a lot of individuals have done. If so, why are we observing apparent shortage of developers to maintain the actual Xorg? I can't believe there are no people interested in maintaining it in the whole world. I thought it's so complex it just requires much more expertise and dedication…

Because Xorg is a huge beast with plenty of legacy, and it's also not a very fun project to hack on because it's largely maintenance of stuff people only care about when it breaks.

E.g. support for a bunch of backends of which most are not worth supporting if you want to implement a server from scratch, but which Xorg has been saddled with, as well as support for a bunch of legacy X functionality that nobody would bother implementing if implementing a server from scratch because most clients never use it.

E.g. a major source of complexity is supporting various X visuals that are irrelevant today when you can decide to only support truecolor natively. Another is support for a bunch of drawing primitives that you might as well just ditch all but the very simplest of, and support for legacy clients via a proxy like Xephyr. That said, most of those drawing primitives are also supported by any 2d canvas style library like Cairo or Skia that does client side 2d rendering, so if you want to implement them for an X server, just picking up one of those libraries would be time far better spent than implementing it yourself.

It'd certainly be a lot of work, and a lot more work to write an X server from scratch that is a complete replacement for e.g. Xorg - you'd need to support a number of X protocol extensions, but most clients backends will fall back on core functionality if extensions are not available (you'd definitely want to support some of them, like Xrender and SHM though, or your server would be largely unusable with modern clients).

At the same time, if someone wants to write a new X server, it'd be silly to do the work of writing their own backends when the could just grab wlroots and build an X server on top of that. "Modern X11" can be reduced to a relatively narrow superset of Wayland functionality if you defer most of the weirder legacy functionality that is rarely but very occasionally used to a proxy like XWayland, Xephyr or XPRA (all of which do, that said, rely on Xorg code) and make people use those for clients that need it.

Honestly, I think this is the most likely/viable future for X on Linux. It'd drastically reduce the amount of code to maintain and share that burden with other projects, and would make it far more viable to keep maintaining X support for those of us who wants (part of) it.

Re: How X Window Managers Work, and How to Write One (2014)

#152
post #83

Earlier quoted context omitted.

All "equivalents" you mention have less functionality than their originals and some only work on specific compositors like wlroots/sway. Like all things Wayland it's a mess with zero benefits for the user. HTTPS vs HTTP is a false equivalent. HTTP works just fine like before. X11 can be made fully secure (e.g. QubesOS does it) but nobody uses it because there is really no need on a FOSS system where 100% of clients y…

When your solution to "make something secure" is to isolate instances of it in airtight sandboxes, IT IS NOT SECURE. Theoretically Xorg can be made fully secure: just isolate clients so they can only receive events and bitmap information from windows created on the same client connection. It would be relatively straightforward, if quite involved, to implement. But nobody wants to implement it because everyone qualifi…

>So just... shut up with the irrelevant bullshit and use Wayland

There are still, to this day, tons of features which end consumers rely on that are still unsupported out of the box with wayland. If you're writing a replacement for x, it had damned well better have feature parity with x. Saying 'shut up and switch' is not an argument for switching.

Also, this sort of attitude is precisely why linux never took off on the desktop. Such arrogance.

Re: How X Window Managers Work, and How to Write One (2014)

#153
post #20

Earlier quoted context omitted.

What "Wayland people"? You probably mean the former Xorg developers who shifted to full time Wayland development long ago. Xorg is on life support, it has been getting bug fixes and nothing else for the past several years. From reading the sibling comment, if BSD guys want to keep using Xorg, they'll probably have to maintain it themselves.

FYI there are crowdfunding efforts to keep Xorg maintained https://news.ycombinator.com/item?id=29034479 . The recipient is the current X server maintainer so it's likely this is the best way to help keeping Xorg maintained.

Cool. I will push the money their way. I believe in multi-user graphical Computing, and I'd hate to see it go.

Re: How X Window Managers Work, and How to Write One (2014)

#154
post #61

Earlier quoted context omitted.

> Zero cases in the wild Follow along this post and you'll end up with one case in the wild all by yourself on your own machine: https://theinvisiblethings.blogspot.com/2011/04/linux-securi... Xace was designed to address the mess that is Xsecurity and using the SELinux sandbox for GUI apps, except Xace barely works for mitigating exploits well on the desktop; it's so finicky that Dan Walsh himself concluded that XAC…

I read the article, I'm still not clear on why it's a problem. I'd have a very big problem if another user, using my machine via x forwarding, could capture my inputs, but that doesn't seem to be the case here? It seems that this is only for applications running on the same display . So, to be blunt, this 'security feature' breaks a whole hell of a lot of use cases. If wayland wished to go down this route they should…

That is exactly what will happen on a Wayland when you use the portal API, it shows a prompt asking for permission to record your screen and then it sends the stream over pipewire.

It is true that it isn't strictly the responsibility of the Wayland protocol, the API functionality is still there just it has moved somewhere else where it's more appropriate.

Re: How X Window Managers Work, and How to Write One (2014)

#155
post #129
post #124

Earlier quoted context omitted.

That’s something about its stability. It says nothing about its fundamentally bad abstraction of modern graphics stacks, that can’t be fixed.

Users don't care about the underlying abstraction. The points raised before at least covered features that users cared about, even if they where presented without context, vsync worked fine on any NVIDIA desktop system I used, especially without compositor.

Users do care when the bad abstractions cause bugs that linger and don't get fixed, of which there are quite a lot...

Re: How X Window Managers Work, and How to Write One (2014)

#156
post #20

Earlier quoted context omitted.

FYI there are crowdfunding efforts to keep Xorg maintained https://news.ycombinator.com/item?id=29034479 . The recipient is the current X server maintainer so it's likely this is the best way to help keeping Xorg maintained.

Cool. I will push the money their way. I believe in multi-user graphical Computing, and I'd hate to see it go.

It hasn't gone, it has just moved to other places, i.e. the web browser. In my opinion, X is a failed experiment, we know now that there are better ways to do things.

Re: How X Window Managers Work, and How to Write One (2014)

#157
post #156

Earlier quoted context omitted.

Cool. I will push the money their way. I believe in multi-user graphical Computing, and I'd hate to see it go.

It hasn't gone, it has just moved to other places, i.e. the web browser. In my opinion, X is a failed experiment, we know now that there are better ways to do things.

The web browser is not multi-user graphical computing.

And that is not a negative about web browsers or all the things we're doing with them. Just to be clear.

Re: How X Window Managers Work, and How to Write One (2014)

#158
post #128
post #93

Earlier quoted context omitted.

Or just try to go at things with an open-mind and hell, you might learn something? X comes from a time when GPUs were not even a thing, it’s current role on a typical desktop is basically just to be a middleman in the communication of applications and the compositor. Wayland cuts out this middleman, fixes unfixable problems in X (you can’t have displays with different DPIs), and is backwards compatible through XWayla…

> a middleman in the communication of applications and the compositor There's an implicit assumption here, that one is even using a compositing window manager. I'm guessing that you do, and that's cool -- you do you! But there are lots of people, who, when sitting down at a fresh install of any operating system, start by turning off all the 3d/transparency/drop shadow/animation/eye candy they can find. I'm one of the…

"This is factually not true. Right now I'm sitting in front of a thinkpad connected to two monitors, all 3 displays have different DPIs. I can drag my windows around between them just fine. Everything works. I'm happy."

Funny thing about that: if you want them to be scaled correctly based on different factors for each monitor, then you need a compositor...

Re: How X Window Managers Work, and How to Write One (2014)

#159
post #156

Earlier quoted context omitted.

It hasn't gone, it has just moved to other places, i.e. the web browser. In my opinion, X is a failed experiment, we know now that there are better ways to do things.

The web browser is not multi-user graphical computing. And that is not a negative about web browsers or all the things we're doing with them. Just to be clear.

I would be interested to know why you think that, is this website not a multi-user graphical thing running on a computer?

Edit: Also I'm pretty confused as to why anyone refers to X as "multi-user", are you talking about multi-pointer X? That doesn't really have anything to do with X in particular and is also possible in Wayland.

Re: How X Window Managers Work, and How to Write One (2014)

#160
post #63
post #55

Earlier quoted context omitted.

> hey, you lose copy-paste, screenshots, xdotool and most of the apps you used before. Wayland has had working screenshots, screen recording, clipboard functionality for text and arbitrary mimetypes, etc. for years on wlroots, GNOME, and KWin. It also has ydotool, an xdotool alternative. For pure keyboard automation it also sports wtype. Which apps don't support Wayland? The only ones on my machine that need XWayland…

> barely any current distros still ship X in their default installations. Bold statement. Citation needed? Debian does, and that's hardly a small percentage of market share. I guess if you include Android as a Linux distribution then you might be correct.

No, Android's doing its own thing, not X11 or Wayland.
Post reply on HN