Live data from Hacker News

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

jichu4n.com

201–210 of 250 posts

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

#201
post #181

Earlier quoted context omitted.

> And I am sure, if you really think about it, you know this yourself. I already disliked systemd on its own merit, but the condescending "if you disagree you're a troll or an idiot" attitude of its proponents really helped cement the feeling.

Please avoid making bad faith interpretations. I'm reading that comment as this: surely you can acknowledge that sysvinit is not a good solution for many people? And just for the purpose of adding some structure around sysvinit, systemd does an adequate job? And if you have an advanced use case that requires a very specialized init system, I hope you can understand how that is uncommon?

You didn't ask, but I think that:

>Systemd is neither unnecessary nor stupid. And I am sure, if you really think about it, you know this yourself. It would not have been adopted so widely and quickly if it were.

Was bad faith, naive, and frankly... insulting -- so I just chose to ignore it.

My reservations are well grounded, and when ones concerns are echoed by ESR, Linus, and tytso, I don't think they can be dismissed so easily.

Certainly some people wanted features that sysvinit couldn't provide, obviously, because so much effort went into systemd. But surely everyone in this conversation is experienced enough to know that just because "lots of people" choose something, that doesn't always mean it's a good choice. :)

I'm still using sysvinit on my main machine, and on all "critical" servers not because I have an advanced use case requiring a specialized init system but because I have a simple use case and a computing philosophy that requires simple init system. I have a strong (I'll admit, borderline fanatic) affinity for the "unix philosophy" of accomplishing things through the composition of simple to understand and debug tools that do one thing, and do it well.

To me, SystemD is about as far as you can get from "do one thing, and do it well" and "simple to understand and debug". It's a monolith (right?) which is why it's not running directly on the hardware. Unfortunately, Debian now builds some packages that I use occasionally with SystemD specified during the configure stage, and I don't want to maintain my own packaging of tools with different compile flags, at least not yet. Presently, I solve this by having a separate VM for "all tasks that need systemd", but I hope to replace that with something lighter weight, perhaps containers instead.

SystemD provides some features I imagine most users want, and that I strongly see the benefit of, but for the vast majority of those features, those reasons I'd want to use systemd, I'd already solved it myself, through the composition of existing and simple tools. A good example is networking. My computer does exactly what I want it to do, every time, in all permutations of wireless, wired ethernet, wireguard, knowing to mount certain NFS shares when I'm at home, randomizing mac address in certain situations, knowing when &c. It's great functionality, and I got there over time by building simple and easy to debug shell scripts, which call out to tools like `ip`, `iw`, `wpa_supplicant` and reading from /sys/class/net.

I also don't use pulseaudio, as audio happens to be one of the subsystems I have strong experience with, and pulse is an unnecessary (and sometimes error prone) layer, considering I get along just fine with ALSA.

The one thing I'm jealous of is faster boot times. But I'll happily boot a few seconds slower in exchange for PID 1 being simple, and my other services being simple and hence easy to debug.

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

#202

This is a great article and I remember reading it numerous times while I was implementing my own window manager. For someone interested in working on a really fun and rewarding hobby project a WM is a great one to look into since there are so many resources starting from really small implementations: - https://github.com/mackstann/tinywm - https://github.com/venam/2bwm - https://github.com/dylanaraps/sowm - https://g…

Don't forget that X includes X-in-X servers, Xnest/Xephyr, that mean you don't have to live in your WM while you build it.

Is there similar functionality for Wayland?

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

#204
post #3
post #2

Maybe don't write an Xorg window manager right as the replacemeant for Xorg starts to take off though

1. The article was written in 2014. 2. While it appears that Wayland is poised to replace X11 on Linux desktops given the amount of backing Wayland has compared to X11, it is not clear whether Wayland will replace X11 in the BSD ecosystem. According to the FreeBSD Wiki, Wayland is not ready to be a daily driver ( https://wiki.freebsd.org/Graphics/Wayland ), though work has been done getting Wayland compositors and ot…

3. Wayland has been "starting to take off" for longer than many of the readers here have been alive.

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

#205
post #159

Earlier quoted context omitted.

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.

Well, on an X window display, I could have:

Fonts from one machine Window management from another An application running on yet another, with it's program data sourced from yet another machine accessing data on still another machine. All of which is displayed on another machine also supplying user input.

Or, I could do something crazy like put a window on your display, with appropriate permission of course, and you could interact with it.

A big wall type display could take windows from a number of users.

The promise back then, and something I used a lot, an many still do use today, is being able to run something and display it somewhere else. Say my cellphone is on my desk. I could ask it to do something for me, and the window into that activity appears on the display like any other window does.

Another case might be several users running on one machine each with their own displays and inputs.

Here is a real world case:

High end CAD software, managed data, many users.

With X, one can make a big application server and that is not visible to users at all in terms of the application or data to be manipulated.

Users run the program via X, running X servers on anything they want. PC, Mac, Linux, whatever.

The only way to interact with the managed data is through the application.

One copy of the application, one data repository, many users.

With X doing that kind of thing is easy, and it works whether one user runs the app on their local machine attached to a shared data repository, or many users run on a remote machine perhaps that machine itself also holding the data repository.

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

#206
post #135

Earlier quoted context omitted.

Why can't the new display server just re-implement the X protocol? The implementation could leave out the unused parts.

It does, it’s called XWayland. So almost all functionality of “legacy” programs will continue to function under Wayland.

That word "almost" has me worried.

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

#207
post #46
post #43

Earlier quoted context omitted.

Ah, I think I get it. You want to use a "point" abstraction, not a "pixel" abstraction, right? In your example, I imagine everything would work just fine, but images will be physically bigger on the 70 DPI monitor because, well, the pixels are bigger. I'm guessing that Wayland adds a layer of indirection, resampling the framebuffer based on the DPI to preserve the same point size across displays with different pixel…

Yeah. I suppose this functionality isn't everyone's cup of tea. The cool thing about Wayland though is somehow it makes the windows still look crisp and good while making them the same size. With the canonical hack to xorg, they always looked blurry and gross. The gnome wiki had this to say on it: "On a Wayland display server, each connected monitor will have a scale that depends on the DPI. A scale affects the scale…

> So it seems like it actually modifies the drawing at the application level rather than rescaling it like an image.

X also supports exactly this. Qt uses this information. gtk doesn't for whatever reason, forcing the workarounds.

Most the so-called "X limitations" are actually just toolkit bugs if you get into the weeds.

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

#208
post #201
post #181

Earlier quoted context omitted.

Please avoid making bad faith interpretations. I'm reading that comment as this: surely you can acknowledge that sysvinit is not a good solution for many people? And just for the purpose of adding some structure around sysvinit, systemd does an adequate job? And if you have an advanced use case that requires a very specialized init system, I hope you can understand how that is uncommon?

You didn't ask, but I think that: >Systemd is neither unnecessary nor stupid. And I am sure, if you really think about it, you know this yourself. It would not have been adopted so widely and quickly if it were. Was bad faith, naive, and frankly... insulting -- so I just chose to ignore it. My reservations are well grounded, and when ones concerns are echoed by ESR, Linus, and tytso, I don't think they can be dismiss…

I don't understand why this philosophy discussion seems to get brought up so frequently or why anyone needs to care about philosophy in the context of a computer program. Linux distributions that adopted it are not sitting around pondering the meaning of life or the existential nature of what it means to boot a computer, they were using it to solve a real problem that they had. It was a complex problem, it was not a simple problem that could have been solved with a simple solution. So what you are saying is not really related to the question.

I don't think the opinions of ESR, Linus, and tytso are relevant here either as none of those people work on init systems. If you developed your own solutions with shell scripts, that's great for you, but I hope you can see how that doesn't work at scale in a big distribution. BTW systemd includes a lightweight implementation of containers so I also don't understand what you're talking about when you said you needed to then put it in a VM or container. The exact problem you're having can also be solved... by just using systemd. So it actually seems like you're making things more complex than it needs to be by jumping through hoops to avoid it.

Audio is also my expertise, and using just ALSA is an experience in pain. You need some kind of userspace daemon in order to get a good experience with that.

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

#209
post #40
post #24

Earlier quoted context omitted.

> replacemeant for Xorg WHY. What's the compelling reason for Wayland? How will it make my life better? As someone who's used Linux as their only computing environment for 20 years, I'm terrified of my Xorg being taken away. It works! I understand it! And, I'm still bitter over my init system becoming unnecessarily complicated and stupid with systemd. There's what feels like a rising attitude in the F/OSS community o…

The biggest reason is security. X offers no GUI isolation. This is a basic mitigation that should have been the norm a decade or two ago. Advanced mixed DPI also comes to mind. Another is performance: Sway easily outperforms DWM/i3/AwesomeWM on most ARM devices when configured for minimal latency.

> The biggest reason is security. X offers no GUI isolation.

This is completely false. X offers both nesting for full isolation and a concept of "untrusted" connections for partial isolation. This is the reason why ssh -Y and ssh -X are separate things.

These facilities could use a little love to make them user friendly, etc., but they're there and have been for ages (enabled by default around 2013, present before then).

X also supports advanced mixed DPI, providing all the information to the application to handle it as they see fit.

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

#210
post #93

Earlier quoted context omitted.

> There's what feels like a rising attitude in the F/OSS community of people wanting to replace things simply because they are old. This has been going on for at least 15 years now. I've been through multiple cycles like this with different desktop environments and GUI toolkits. The churn is even much greater in the Javascript world where if you come back to a project you haven't look at in about 3 months, the first…

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…

This post is completely false. Literally every word of it is false.
Post reply on HN