Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Silver Alicorn
Mar 30, 2008

𝓪 𝓻𝓮𝓭 𝓹𝓪𝓷𝓭𝓪 𝓲𝓼 𝓪 𝓬𝓾𝓻𝓲𝓸𝓾𝓼 𝓼𝓸𝓻𝓽 𝓸𝓯 𝓬𝓻𝓮𝓪𝓽𝓾𝓻𝓮
1000th reply

Adbot
ADBOT LOVES YOU

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

Notorious b.s.d. posted:

are there any other (current) consumers of your xdg-shell work?

EFL and Qt are ported to it. SDL2 maintainers are porting to it right now. Weston and mutter both support it natively, while Orbital and the Qt compositor have branches.

Sapozhnik
Jan 2, 2005

Nap Ghost
hmm, i was rather hoping for more meat on xdg-shell vs wl_shell and the nature of its associated deficiencies. is there a ML thread somewhere at least where this is discussed?

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
Nomenclature: Wayland is a message passing protocol. The messages from a client to a compositor are called "requests", and the messages from a compositor to a client are called "events".

So, wl_shell_surface is architected with the client in control of a lot of things. The client controls when the window is maximized, and that means that there's no way for the compositor to have a keybinding or gesture (drag to top of the screen) to maximize a window at all. We could add additional events to that to say "hey, client, please maximize this surface", but that comes with its own problems.

For a tiling WM, you really always want the "maximized" state, too, so the concept of the client controlling everything isn't great. So, really, what you want is a "hey, client, you're maximized now" event.

So, there's a wl_surface.attach "request" to attach a new buffer to the surface. If an app is redrawing at 60fps, then you'll call wl_surface.attach 60 times a second.

The issue with the "hey client, you're maximized now" event is that there's a race condition when transitioning states. If we do the maximize binding and the client has an attach in-flight, we aren't sure whether the client has noticed the "you're maximized now" event, and so we have no idea if the attached buffer is for a maximized client or not.

So, the client is rendering at 60fps. It makes an "attach", and it's queued up in the compositor's socket buffer. The compositor sees a keybinding, it sends "hey, you need to be maximized", and then notices the attach in its buffer. It is going to move the surface to the top-left, since it's expecting the maximized buffer to be full-sized, and what you end up seeing is the surface be in the top left corner but not have the full size of the monitor. It looks awful.

xdg-shell solves this by having one event that tells the client the size that the compositor requests it should be, along with a bitfield of states that the client is in (maximized, fullscreen, among others). This is known as the "configure" event. It also makes the client send a sentinel request, "ack_configure" immediately before it attaches its new buffer so the compositor knows where it in the stream.

When the compositor sees the "ack_configure" event, it knows that the client has seen the event, and so it goes ahead and does the full state transition with the new buffer. So everything is atomic and fluid: you hit the keybinding, and it maximizes without any intermediate state.

It's all the small touches like these that complicate the protocol, but make the experience more fluid and modern.

Sapozhnik
Jan 2, 2005

Nap Ghost
ah neat, thanks for the explanation.

i look forward to trying out this smooth glitch-free wayland stack sometime soon

Notorious b.s.d.
Jan 25, 2003

by Reene

Suspicious Dish posted:

Nomenclature: Wayland is a message passing protocol. The messages from a client to a compositor are called "requests", and the messages from a compositor to a client are called "events".

So, wl_shell_surface is architected with the client in control of a lot of things. The client controls when the window is maximized, and that means that there's no way for the compositor to have a keybinding or gesture (drag to top of the screen) to maximize a window at all. We could add additional events to that to say "hey, client, please maximize this surface", but that comes with its own problems.

For a tiling WM, you really always want the "maximized" state, too, so the concept of the client controlling everything isn't great. So, really, what you want is a "hey, client, you're maximized now" event.

So, there's a wl_surface.attach "request" to attach a new buffer to the surface. If an app is redrawing at 60fps, then you'll call wl_surface.attach 60 times a second.

The issue with the "hey client, you're maximized now" event is that there's a race condition when transitioning states. If we do the maximize binding and the client has an attach in-flight, we aren't sure whether the client has noticed the "you're maximized now" event, and so we have no idea if the attached buffer is for a maximized client or not.

So, the client is rendering at 60fps. It makes an "attach", and it's queued up in the compositor's socket buffer. The compositor sees a keybinding, it sends "hey, you need to be maximized", and then notices the attach in its buffer. It is going to move the surface to the top-left, since it's expecting the maximized buffer to be full-sized, and what you end up seeing is the surface be in the top left corner but not have the full size of the monitor. It looks awful.

xdg-shell solves this by having one event that tells the client the size that the compositor requests it should be, along with a bitfield of states that the client is in (maximized, fullscreen, among others). This is known as the "configure" event. It also makes the client send a sentinel request, "ack_configure" immediately before it attaches its new buffer so the compositor knows where it in the stream.

When the compositor sees the "ack_configure" event, it knows that the client has seen the event, and so it goes ahead and does the full state transition with the new buffer. So everything is atomic and fluid: you hit the keybinding, and it maximizes without any intermediate state.

It's all the small touches like these that complicate the protocol, but make the experience more fluid and modern.

you should add this to the article

the concrete example really illuminates the value

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
I was going to add something like that, but figured it was already getting a bit too long, so I just cut it there. It's already out to the blog aggregators. I'll explain a bit more in a followup blog post next week I guess.

Bloody
Mar 3, 2013

im ga.y

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

funny.computer!

Bloody
Mar 3, 2013

Suspicious Dish posted:

funny.computer!

dont post my email provider

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
Here you go Mr. Dog: http://afaikblog.wordpress.com/2014/06/18/a-notifications-update/

Captain Foo
May 11, 2004

we vibin'
we slidin'
we breathin'
we dyin'

This thread is real cool. I do a little bit of halfassed Linux sysadmin at work and run a lubuntu laptop but I like knowing what's behind the scenes if you will

VAGENDA OF MANOCIDE
Aug 1, 2004

whoa, what just happened here?







College Slice

Captain Foo posted:

This thread is real cool. I do a little bit of halfassed Linux sysadmin at work and run a lubuntu laptop but I like knowing what's behind the scenes if you will

more like whats behind the curtains

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
E! True Linux Stories

The Management
Jan 2, 2010

sup, bitch?

api call girl posted:

more like whats behind the curtains

more like if the curtains match the drapes

Notorious b.s.d.
Jan 25, 2003

by Reene

The Management posted:

more like if the curtains match the drapes

they're both made out of beard hair, so, yes.

gabensraum
Sep 16, 2003


LOAD "NICE!",8,1
i had an iptables question while the forums were down but rose to the occasion and figured it out myself. radium moves in mysterious ways.

Notorious b.s.d.
Jan 25, 2003

by Reene
hey suspicious dish

i thought of a use case of mine that could actually be filled by wayland, if people are thinking about it sooner rather than later: multiple DPIs, different DPI per monitor

so loving sick of plugging in an external monitor with half the dpi of my desktop and having X11 render everything exactly the same on both displays

even just scaling the painted windows, leaving the clients unaware, would be better than the current state

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
That's a use case that Wayland can support, yep, and Weston can support it already, I believe.

Notorious b.s.d.
Jan 25, 2003

by Reene
for once i do not dread the grim future of the linux desktop

theadder
Dec 30, 2011


is lunix on the desktop arrived yet

Bloody
Mar 3, 2013

which loonix do i put on my laptop

Notorious b.s.d.
Jan 25, 2003

by Reene

Bloody posted:

which loonix do i put on my laptop

fedora

Cybernetic Vermin
Apr 18, 2005

the entire linux movement have always been incredibly stupid randomly replacing things that more or less works for purposes of ~purity~, ~~vision~~, and, god loving forbid, ~~~good engineering practices~~~ (see also: linux audio not working at any point in the past 20 years). but wayland is soooo fuuuuuuucking loooooooooooooong overdue

x11 was poo poo the day it was designed, wayland appears incredibly sane in comparison, and in fact a lot of the toolkit and similar work is pretty drat decent but hampered by a hilariously bad underlying infrastructure. trust loving nerds to fetishize the pointless network transparency as a too desirable feature to give up, at a point where every other os had far superior network transparency by copying dumb byte buffers around

Cybernetic Vermin
Apr 18, 2005

also, linux on the desktop is never happening but at least linux will perhaps stop being an incredible nuisance in the niches where it works if the graphics stack situation (well, and audio and such) can get cleaned up. if you are a 90%+ market share montrosity like windows you can get away with some cruft and annoyances, but linux having a far worse graphics stack was always a huge sticking point even for the niches where you can pick whatever

theadder
Dec 30, 2011


emptyquote if ur still not using lunix on the desktop

Bloody
Mar 3, 2013

theadder posted:

emptyquote if ur still not using lunix on the desktop

Bloody
Mar 3, 2013

wait does a development vm that i use once a month count

theadder
Dec 30, 2011


nope

VAGENDA OF MANOCIDE
Aug 1, 2004

whoa, what just happened here?







College Slice

theadder posted:

emptyquote if ur still not using lunix on the desktop

Cybernetic Vermin
Apr 18, 2005

wait, anyone runs linux on the metal in any other role than as a virtual machine host in 2014?

x11 sucks in vm setups too~~

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

Cybernetic Vermin posted:

x11 was poo poo the day it was designed, wayland appears incredibly sane in comparison

Wayland could not have been done 30 years ago when X11 was invented. You didn't have enough memory for buffer contents for every window. Not to mention that every app rendering into buffers independently is really dumb when you have limited memory. The design of X11 of "a server that hands out pieces of the front buffer" was a smart design for the goals that the authors had in the day: a low-memory, fast graphics system that could work across multiple terminals so that expensive apps could be used in multiple places.

The rapid increase in available memory, increase CPU speed, and development of a new pixel processing architecture simply means that the goals of X11 became obsolete. If I were to design a system that tried to meet the same goals, I'd end up very close to X11.

I don't hate X11 for trying to meet its goals, which were very good goals back in the day. I hate how we've piled poo poo onto it over the years, flailing to adapt the architecture to meet new goals, without realizing when these goals conflict.

Cybernetic Vermin posted:

and in fact a lot of the toolkit and similar work is pretty drat decent but hampered by a hilariously bad underlying infrastructure. trust loving nerds to fetishize the pointless network transparency as a too desirable feature to give up, at a point where every other os had far superior network transparency by copying dumb byte buffers around

I have no idea what "network transparency" means. I couldn't add it to Wayland even if I wanted to, because I have no idea what the goal even is. Usually it's used for a replacement for "remote display" like with ssh -X, but that's better done by a proper remote display protocol like RDP. Hell, people talk about NoMachine's NX as being a perfect example of X11's "network transparency", but that protocol isn't X11, it's actually a lot more like RDP than "remote rendering". NX's software actually often client-side rendering and ships bytes across the wire rather as video-codec-like compression rather than pushing rendering commands to the remote server.

Cybernetic Vermin
Apr 18, 2005

better things than x11 were designed before x11, wayland is a *lot* better, but x11 was total poo poo the day it was invented. it is sort of a classic idiot nerd thing to hail old disfunct poo poo as good, but NeWS predates x11, and *really* *was* *better* in *every* *way*

network transparency is a standard term in reference to the x11 protocol and i am rather perplexed how i managed to introduce it to a redhat developer. you more or less make the intended point; relatively dumb but lower-level byte transport works a lot better than what x11 offers natively

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
No, I've certainly heard the term "network transparency" before, and sometimes by coworkers. It still doesn't describe any set of achievable goals, nor why traditional remote desktop solutions like RDP and VNC don't count, but extremely similar protocols like NX do.

Malcolm XML
Aug 8, 2009

I always knew it would end like this.

Suspicious Dish posted:

No, I've certainly heard the term "network transparency" before, and sometimes by coworkers. It still doesn't describe any set of achievable goals, nor why traditional remote desktop solutions like RDP and VNC don't count, but extremely similar protocols like NX do.

theres a video by a the dudes behind wayland where he basically explains that x11 is awful at being network transparent


also lol@people complaining about plan9 being naive about network transparency and then clinging to x11 lovely network transparency

Malcolm XML
Aug 8, 2009

I always knew it would end like this.

Suspicious Dish posted:

No, I've certainly heard the term "network transparency" before, and sometimes by coworkers. It still doesn't describe any set of achievable goals, nor why traditional remote desktop solutions like RDP and VNC don't count, but extremely similar protocols like NX do.

b/c vnc is awful, rdp is a lot better but still sucks, and sperglords still think that X11 is fast because they used it over lan links and assume its fast over wan links


there isn't a good solution out there.

Notorious b.s.d.
Jan 25, 2003

by Reene

Malcolm XML posted:

b/c vnc is awful, rdp is a lot better but still sucks, and sperglords still think that X11 is fast because they used it over lan links and assume its fast over wan links

the problem with x11 is not that x11 is terrible, it's that client-side fonts are a disaster. if you build rxvt or emacs without client side fonts, they're great across wan links.

client-side fonts basically turn x11 into a really bad, confusing version of vnc

Notorious b.s.d.
Jan 25, 2003

by Reene

theadder posted:

emptyquote if ur still not using lunix on the desktop

begging for emptyquotes is just sad

it's like asking for a buyback

Notorious b.s.d.
Jan 25, 2003

by Reene

Cybernetic Vermin posted:

better things than x11 were designed before x11, wayland is a *lot* better, but x11 was total poo poo the day it was invented. it is sort of a classic idiot nerd thing to hail old disfunct poo poo as good, but NeWS predates x11, and *really* *was* *better* in *every* *way*

X predated NeWS, and NeWS was proprietary.

there are a thousand forgotten proprietary window systems. i'm not sure why people eulogize NeWS and forget about att 3b2 or sunview and all the rest

Adbot
ADBOT LOVES YOU

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
I, too, as a software engineer, have opinions on NeWS. They do not hold NeWS very highly regarded. It's a similar system to Plan 9's rio, and I don't like either architecture.

I won't go into detail.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply