LWN.net Logo

Wayland and Weston 1.0 released

From:  Kristian Høgsberg <hoegsberg-Re5JQEeQqe8AvxtiuMwx3w-AT-public.gmane.org>
To:  wayland-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW-AT-public.gmane.org
Subject:  Wayland and Weston 1.0
Date:  Mon, 22 Oct 2012 19:26:46 -0400
Message-ID:  <20121022232646.GA12708@minato.local>
Archive-link:  Article, Thread

Wayland and Weston 1.0.0 have been released!  

Thanks and congrats to everybody involved for making this happen.
We're entering a new, exciting and somewhat scary phase for Wayland.
As of this 1.0.0 release, we're changing the development model and
committing to the the protocol and client side API we have now.

As I've said before, 1.0 doesn't mean we're done or that the protocol
can't move forward.  What it means, is that we're confident that the
protocol we have now covers the basic features and that we can build
whatever new functionality we need with and on top of 1.0.

Tarballs and tags are out there, in git and from
http://wayland.freedesktop.org/releases:

   c8f39b099d9a5c6c5609046a31ef371655eb2c05  wayland-1.0.0.tar.xz
   1f521a4f7760df73e1d1d8a6791d1c7bf536584e  wayland 1.0.0 tag

   b179dff28403d05e2a4f1a1846772bb83b36b51a  weston-1.0.0.tar.xz
   42470cfc492d03e967ae515d298b1d4712de9a58  weston 1.0.0 tag

I think we will do a 1.0.1 release within a few weeks, mainly to
improve documentation, but other than that there's no roadmap for
further releases at this point.


Protocol Versioning

As we're now starting to use the versioning mechanism, let me just
outline how it works:

 - The interface versioning mechanims in the protocol is modelled
   after how the X extension versioning works.  That's one of the
   things that have worked well in X and the Wayland protocol has that
   built in.  The core idea is that we never break backwards
   compatibility for interfaces.  We only add new requests and events,
   we never remove or modify old ones.  The wl_registry object will
   initially advertise all globals and their interfaces and versions.
   When binding a global object, the client tells the server which
   version it understands.  This version may be lower than what the
   server supports, in which case the server will not send out more
   recent events.

 - As well as adding interfaces over time, we can also deprecate and
   remove interfaces.  Clients discover the supported interfaces
   dynamically and they have the means to fall back gracefully, in
   case an extension isn't available.  We'll only remove interfaces
   after a long deprecation phase and when we have a replacement.

 - Compositors may expose private protocol to be used by components
   tied to and released with the compositor or released separately.
   Either way, the API stability of these interfaces is policy of that
   compositor and outside the scope of the core Wayland protocol.


Versioning convention for releases

 - The protocol and generated code as defined by wayland.xml and the
   client API as defined in wayland-client.h will remain stable for
   all 1.x.x releases.  We may add protocol and API in the 1.x.x
   series, but any client side application that compiles and links
   against libwayland-client.so 1.0.0 will continue to do so for all
   1.x.x releases.

 - The server side generated code and API as defined in
   wayland-server.h will be stable through 1.0.x releases.  On the
   master branch we may move code back and forth between weston and
   wayland or break API in other ways.  Eventually, we'll make a 1.1.0
   release, and keep the server side API stable for the 1.1.x series,
   but there are no concrete plans at this point.

 - Weston will maintain internal module API and ABI stability for the
   1.0.x releases.  We won't do any new development on this 1.0 branch
   and we'll make releases when there's a need for one (if anybody
   needs a release, let the list know).  Feature work continues on the
   master branch and we make no guarantees about the module interface
   there.

   Even though we maintain the module API/ABI in 1.0.x, there is
   currently no official mechanism for developing out-of-tree modules.
   The best approach is to just copy src/compositor.h into the
   out-of-tree module source and develop against that.


Changes since 0.95.0 and 0.99.0

Since 0.95.0, we've fixed a lot of bugs and added much documentation
and we managed to only make few user visible changes.  But just before
0.99.0, a few changes landed that broke the client side API.  Most of
these changes are well documented in the code or in the protocol
definition, but I'll just outline them here:

 - Changes to make the API thread safe.  These are by far the most
   invasive changes and affect the global mechanism and mainloop
   integration.  These changes removed callbacks from the core API and
   introduced the wl_event_queue as a mechanism to control when and
   where event callbacks are invoked.  The new event loop API is
   simpler than what we had before.  For typical toolkit integration,
   follow these steps:

    1) Get the socket fd using wl_display_get_fd()

    2) Add the fd to mainloop and poll the fd for readable by default

    3) When the fd is readable, call wl_display_dispatch() to invoke
       the event callbacks

    4) Before going back to sleep, call wl_display_dispatch_pending()
       and the wl_display_flush() to write buffered requests to the
       server.  If wl_display_flush() returns -1 with errno set to
       EAGAIN, poll the fd for writable as well and call
       wl_display_flush() when the fd becomes writable again.

   Note that all of these calls may return -1 in case of error, either
   from the call or if the display is in an error state.

   The global listener mechanism has been replaced by a new
   wl_registry interface.  Some of the convenience API
   (wl_display_get_global) had to go and on the whole the new
   mechanism is a little more cumbersome to use.  But the change
   itself is pretty mechanical; the bind request and global and
   global_remove events moved into wl_registry, and to listen for
   globals just call wl_display.get_registry and add a listener to
   that object.

 - Atomic surface update mechanism.  The exact semantics of how and
   when changes to surface took effect were a little fuzzy.  In
   practice, everything that fit into a protocol buffer (ie most
   things you'd do to a surface in a frame) would be applied
   atomically due to how we process incoming requests in the server.
   It just wasn't clearly specified or fool-proof in the face of
   protocol buffer overflows or flushes and could cause rendering
   artifacts.  We now have the wl_surface.commit request, which must
   be used to commit the pending changes to a surface.  Any state that
   depends on surface size or content must be done before committing
   and when the server receives the commit request it will apply all
   the batched up changes.  If using EGL, eglSwapBuffers() will attach
   a new buffer and send the commit request.

 - Better and more consistent error checking.  We had a number of
   cases where we didn't handle out-of-memory and in cases of any
   socket errors we just called abort().  We now handle all cases and
   in case of error, the core entry points will return -1 and set
   errno.  For the protocol stubs, any errors will set an error state
   in the wl_display object.  Core entry points will then return -1,
   or the state be inspected with wl_display_get_error().

 - Remove un-namespaced ARRAY_LENGTH and container_of from public API.
   A long time bad habit that we had to break.  Hopefully most
   applications and toolkits weren't using these macros.  Either way,
   toolkits provide similar functionality and worst case they can just
   be copy-and-pasted.


Kristian


(Log in to post comments)

Wayland and Weston 1.0 released

Posted Oct 24, 2012 0:27 UTC (Wed) by rahvin (subscriber, #16953) [Link]

Based on the recent thread on Slashdot a significant number of people haven't read the amazing LWN articles on Wayland and what it is and what it will allow Linux to do. I personally think the Wayland developers could do a lot to silence the constant repeating criticism about replacing X by building the X module, that has been suggested, as soon as possible to allow the X network stack to run on top of Wayland so that every time Wayland comes up people stop bringing up X. There is a persistent misunderstanding of Wayland and what it's for that is very apparent at places like slashdot.

I'm looking forward to Wayland, based on my understanding of it, Wayland will allow some impressive graphics improvements in Linux.

Wayland and Weston 1.0 released

Posted Oct 24, 2012 3:52 UTC (Wed) by ttelford (subscriber, #44176) [Link]

It's not that Wayland needs X: it's that it can't replace it.

To replace X, Wayland needs to be properly network transparent. The Wayland devs have no intention of providing network transparency. (At least if thier FAQ is to be believed).

So Wayland can't be a replacement for X; it's more like a better DirectFB. Bolting X into Wayland is as transparent as running X on Windows or Mac- which means not at all. Bolting X onto Wayland doesn't replace X either: it's continuing to use X.

I have no problems with what Wayland does; but calling it an X replacemt is an insult to both projects.

Wayland and Weston 1.0 released

Posted Oct 24, 2012 11:29 UTC (Wed) by dgm (subscriber, #49227) [Link]

Most users of X do not want or need network transparency. I don't have figures, but 100/1 looks generous to me. Just count the amount of people that use VNC or similar remoting technologies on Windows or OS X.

Wayland and Weston 1.0 released

Posted Oct 24, 2012 16:06 UTC (Wed) by nix (subscriber, #2304) [Link]

Most users of X do not want or need network transparency.
People keep on saying this, but I don't know where the heck the figure comes from. Every single user of X I have ever known has relied upon network transparency (often they were scientific users, running huge mathematical monsters on beefy remote systems).

I know I couldn't get my daily work done without X transparency. I don't presume to know whether this is true of others, but the people who claim that I am a very rare case presume to know that with just as little data to back them up.

Wayland and Weston 1.0 released

Posted Oct 24, 2012 16:11 UTC (Wed) by mpr22 (subscriber, #60784) [Link]

At present, approximately everyone who uses a Linux GUI environment that isn't Android is an X user. (They may not know they are an X user, they may not even know what X is, but they're still using X.)

Wayland and Weston 1.0 released

Posted Oct 24, 2012 16:42 UTC (Wed) by raven667 (subscriber, #5198) [Link]

It's not the remote display of applications which is being disputed, that is clearly a needed feature and the Wayland team has demonstrated it, it's the desire for the protocol to be _transparent_ and use the same technical mechanism for local and remote display which is being disputed. It's OK if there are different local and remote protocols. In many real practical ways this has already happened with X, the toolkits use accelerated local rendering that tries to bypass as much of the X protocol as possible and remoting is done with NX or xpra or other protocols which are not unadulterated X.

Wayland and Weston 1.0 released

Posted Oct 24, 2012 17:35 UTC (Wed) by daniels (subscriber, #16193) [Link]

Not to mention the number of clients who use SHM and/or DRI2, which is almost every single one of them. These aren't available on remote machines (or often claim that they are, but they don't work), so you have two codepaths for local vs. remote rendering.

To me, having a proxy compositor which forwards everything on for you and takes care of the details (including deciding which compression method to use) sounds a lot more appealing than that.

Wayland and Weston 1.0 released

Posted Oct 31, 2012 17:19 UTC (Wed) by renox (subscriber, #23785) [Link]

The main point of the dispute IMHO is: should the protocol be designed to work well with remote display (such as XRender's glyph cache mechanism) and then use that for local display plus optimizations such as DRI2, shared memory or should the protocol be only designed to work well locally as Wayland was described initially?

Because if you add in the toolkit/application optimizations for remote display on top of a protocol designed for local use only, it is very likely that there will be interoperability issues (toolkit X with display server Y..), even if 'tookit X with display X' can be better optimized than a generic protocol.

Then again KH has said that he optimized Wayland to reduce the number of RTT, so we'll see, maybe a Wayland proxy will work well even in remote display..

Wayland and Weston 1.0 released

Posted Oct 25, 2012 10:48 UTC (Thu) by dgm (subscriber, #49227) [Link]

> people who claim that I am a very rare case presume to know that with just as little data to back them up.

Even you know people besides yourself, don't you? Come on, just and count the people around you (co-workers, family, friends) that actually need a remote X display. If you do it honestly you will see that the number is diminutive compared with the amount that just run their code in the same machine used for display. And even those who do need a remote display, usually do not have very sophisticate needs.

Wayland and Weston 1.0 released

Posted Oct 25, 2012 21:24 UTC (Thu) by njs (guest, #40338) [Link]

> often they were scientific users, running huge mathematical monsters on beefy remote systems

I'm amused that xpra has become the feasibility proof for wayland remoting, and here your argument for X is the entire reason xpra exists in the first place -- the X protocol is so unbearably sucky at this exact use case. (Home DSL -> university compute cluster = nasty latency, university wifi is flaky and compute jobs are long, screen/tmux are insufficient because you need visualizations, and PhDs have to be procrastinated on *somehow*...)

Wayland and Weston 1.0 released

Posted Oct 26, 2012 2:51 UTC (Fri) by drag (subscriber, #31333) [Link]

> People keep on saying this, but I don't know where the heck the figure comes from. Every single user of X I have ever known has relied upon network transparency (often they were scientific users, running huge mathematical monsters on beefy remote systems).

I agree, sorta.

Remote desktop and remote applications are now _MAINSTREAM_.

It really opened my eyes working in a large scale corporate environment that HEAVILY depends on remote applications, remote desktops, virtualized desktops, thin clients, think clients, and everything in between for ALL users for pretty much everything. Between remote applications and html-based applications pretty much everything I use except my browser is a remote application of one thing or another and that is the way for almost everybody else around me.

But you know what?

X11 has nothing to do with it at all and would be nearly useless if somebody tried to be use it in the same manner. After seeing what people are now doing with remote applications the idea that something like X11 and it's idea of 'network transparency' is competitive or unique is silly. Microsoft Windows, especially combined with third party solutions like those provided by Citrix, have surpassed it.

OS X and Microsoft Windows has very good X Windows support. OS X has it nearly-native and Microsoft Windows, when combined with third party applications, has pretty much any and all X11 features you'd care to use, including GLX support. And, of course, you see none of those users clamoring for X11 support for any of the applications. What is more they have no problems when they feel the need to do things remotely in a relatively effortless and secure manner.

I am confident that if Wayland developers decided to incorporate some form network support in their system, even if it's just primitive as pixel pushing with jpeg compression (and they take security serious) that few people will find that lacking compared to X11. In addition to that you are not giving up X11 support by using Wayland. So if you need it: it's there.

If X11 'network transparency' is wanted so much then providing the option of NOT using X11 should not be a threat at all. If it's desirable then people will continue to develop and use X11 exclusively even if they can bypass it completely for their windows api needs.

In addition if they ever decide to be competitive with Microsoft Windows and Citrix in terms of network transparency and create a X12 X Windows protocol then Wayland could, using it's compositing approach, incorporate X12 support much easier then if we were still using our X11 X Servers to twiddle bits on our PCI buses in the traditional manner. :)

Wayland and Weston 1.0 released

Posted Oct 26, 2012 3:15 UTC (Fri) by dlang (✭ supporter ✭, #313) [Link]

> In addition to that you are not giving up X11 support by using Wayland

This is only true in the short term

As soon as some graphics toolkit decides that supporting both X11 and Wayland is 'too hard' you no longer have the option.

just look at the flap over GNOME maintainers deciding that supporting both systemd and non-systemd linux systems is 'too hard'

Wayland and Weston 1.0 released

Posted Oct 26, 2012 3:35 UTC (Fri) by rahulsundaram (subscriber, #21946) [Link]

Depends on what you meant by short term. Even in the longer run, there is bound to a lot of custom applications using X and compatibility cannot simply be dropped anytime within say 15 years or so. The broader community might not care but enterprise and hardware vendors who are funding Wayland or X development certainly do. It is not comparable to systemd and GNOME which has no real legacy to worry about.

Wayland and Weston 1.0 released

Posted Oct 26, 2012 4:44 UTC (Fri) by dlang (✭ supporter ✭, #313) [Link]

nobody is saying that your ability to run X applications is going to go away soon.

But we are concerned that the ability to run an X based desktop is going to go away

compatibility with wayland is a one-way street.

if the app is written for wayland it can talk to wayland

if the app is written for X it can talk to wayland

this is being excused by claiming that the major graphics toolkits support both, so you will never find an app that is wayland-only

I'm saying that this is only the case until some toolkit maintainer decides that it's "too hard" to continue to support X, after that, all software that uses that toolkit will be wayland-only.

If they were to make a shim layer that would let a wayland-only app show up on an X desktop, they would go a long way towards relieving this concern.

Wayland and Weston 1.0 released

Posted Oct 26, 2012 6:12 UTC (Fri) by mjg59 (subscriber, #23239) [Link]

Any remoting solution would work just as well in proxying Wayland-specific apps onto X desktops.

Wayland and Weston 1.0 released

Posted Oct 26, 2012 11:34 UTC (Fri) by daniels (subscriber, #16193) [Link]

> If they were to make a shim layer that would let a wayland-only app show up on an X desktop, they would go a long way towards relieving this concern.

Weston has had, pretty much since day one, a really competent nested-under-X11 compositor backend. It works pretty much like Xephyr, in that your desktop is rooted rather than being window-by-window, but it works great.

If the clamour of people who genuinely need X11 and cannot live with anything else is so great, a solution for this will definitely emerge.

Wayland and Weston 1.0 released

Posted Oct 27, 2012 8:41 UTC (Sat) by paulj (subscriber, #341) [Link]

Apps are not "written for X11" today. They're written in some toolkit library, like Qt, GTK+, and the toolkit arranges the rendering (possibly via another library). Apps in the future will continue to be written to use toolkits. So "if the app is written for Wayland" is just a straw-man.

Apps in the future will continue, overwhelmingly, to be written to one of a small number of toolkits. At least some of these toolkits, including the 2 most popular, *already* support multiple rendering outputs (from X11, to Windows, to direct framebuffers, even to HTML!). Hell, they *already* support Wayland!

Your fear is unfounded. You can relax, your apps will, overwhelmingly, continue to work with X11, Wayland, whatever, without you or your apps having to care. X11 will continue to work, even if fewer people use it.

Wayland and Weston 1.0 released

Posted Oct 26, 2012 8:25 UTC (Fri) by dgm (subscriber, #49227) [Link]

> As soon as some graphics toolkit decides that supporting both X11 and Wayland is 'too hard' you no longer have the option.

That would be true if you decided to base your work on a closed toolkit. Good luck then, anyway.

Wayland and Weston 1.0 released

Posted Oct 26, 2012 13:34 UTC (Fri) by drag (subscriber, #31333) [Link]

> As soon as some graphics toolkit decides that supporting both X11 and Wayland is 'too hard' you no longer have the option.

Like I said before:

If X11 networking is valuable then desktop programmers and users will continue to insist on it's usage.

Claiming that having the _option_ to not use X11 will lead to it's demise on the Linux desktop is effectively just admitting that the majority of people not only do not really on X's features, but would actually try to avoid using it because better alternatives exist for programming GUI applications.

The way I look at it is that X11 networking is inadequate at a best and if people would like to see it's continued existence then it's up to the X folks to make it more attractive then it's competition.

In addition to that due to it's API agnostic nature Wayland can actually facilitate the usage of a 'Improved X' then the current X Server-as-display-manager approach to things. However, honestly, I think that in the long term a improved X is not going to appear and people will use other methods for their remote desktop/application needs.

Mac OS X suppot is just about awful

Posted Oct 26, 2012 12:04 UTC (Fri) by dps (subscriber, #5725) [Link]

I have a Mac OS X laptop and the X support is really not what it is cracked up to be. I can run remote X11 things OK but cut and paste is iffy and the experience somewhat suboptimal.

The killer failure of me is that I can *not* run mac os X application remotely, so I can't that M$ office as part of my desktop environment (which has a much bigger display). Unless you use relatively rare X extensions, most obviously xshm. that does not apply if you use X11 applications.

I am not arguing for the same protocol but I anything that does not allow me to mix normal applications running on multiple systems in a single desktop is several steps backward. Mac OS X fails the "can I run local applications on a remote display?" test. I hope wayland will not.

Mac OS X suppot is just about awful

Posted Oct 26, 2012 16:23 UTC (Fri) by daniels (subscriber, #16193) [Link]

> Unless you use relatively rare X extensions, most obviously xshm

'Relatively rare'?! MIT-SHM is used for pretty all image transfer (which is most everything these days) by every major toolkit, and has been shipped with X.Org/XFree86 servers since 1991. It's actually of legal drinking age in the US.

Mac OS X suppot is just about awful

Posted Oct 28, 2012 15:54 UTC (Sun) by nix (subscriber, #2304) [Link]

With a name like 'dps' your respondent is obviously posting through a time-warp from the mid-90s at the very latest. :)

Wayland and Weston 1.0 released

Posted Oct 25, 2012 23:53 UTC (Thu) by jschrod (subscriber, #1646) [Link]

> Most users of X do not want or need network transparency.

Can you please post a link to reviewed research, beyond personal anecdotes, that support that claim?

Thanks.

Wayland and Weston 1.0 released

Posted Oct 26, 2012 8:14 UTC (Fri) by dgm (subscriber, #49227) [Link]

No, and you cannot either. And asking is just silly.

Wayland and Weston 1.0 released

Posted Oct 26, 2012 16:15 UTC (Fri) by cortana (subscriber, #24596) [Link]

I think the burden is on the one making the extraordinary claim (that most users need network transparency) to prove their case.

Wayland and Weston 1.0 released

Posted Oct 24, 2012 3:56 UTC (Wed) by dlang (✭ supporter ✭, #313) [Link]

They already have the ability to run X programs and have them talk to a shim that displays the results in Wayland.

That's not the problem, the problem is having Wayland programs talk to an X server and having a way (other than just VNC style shipping full-screen bitmaps around for every app) to send the results to a remote display.

The Wayland answer is "nobody wants to do that, and anyone who says they do doesn't know what they are talking about", which doesn't do much to satisfy people's concerns who are using the features that they are so dimissive of.

Wayland and Weston 1.0 released

Posted Oct 24, 2012 4:13 UTC (Wed) by mjg59 (subscriber, #23239) [Link]

xpra has demonstrated that this approach works perfectly well.

Wayland and Weston 1.0 released

Posted Oct 24, 2012 4:20 UTC (Wed) by Cyberax (✭ supporter ✭, #52523) [Link]

It works so well that my co-workers used it as an example that pure X can be perfectly usable over WANs :)

Wayland and Weston 1.0 released

Posted Oct 24, 2012 4:35 UTC (Wed) by mjg59 (subscriber, #23239) [Link]

I think I'd be looking for new co-workers…

Wayland and Weston 1.0 released

Posted Oct 24, 2012 5:03 UTC (Wed) by daniels (subscriber, #16193) [Link]

It kind of disproves the point though, and validates the Wayland approach; it shows that you need a proxy compositor to make the latency less biting on all the round-trips you need to do. Which is heaps.

Wayland and Weston 1.0 released

Posted Oct 24, 2012 5:17 UTC (Wed) by mjg59 (subscriber, #23239) [Link]

It disproves the point rather more strongly than that - xpra only sends bitmaps (optionally compressed via a range of codecs), not X.

Wayland and Weston 1.0 released

Posted Oct 24, 2012 12:39 UTC (Wed) by VITTUIX-MAN (guest, #82895) [Link]

Xpra is awesome, even if still rather beta in some places. It allows me to run graphical stuff under a bare shell account, using Xvfb as back end.

One thing that is often overlooked with Xpra is that it also works locally, meaning ´xpra attach´ can be ran in the remote end of the tunnel, and Xpra will use mmap'ed memory in that case. In other words, Xpra is not needed in local end, bare tunneled X will suffice but then of course the advantages of compression are lost.

Just wondering when the Wayland-stack can do the same; as lousy X is sometimes, it also is extremely hackworthy.

Wayland and Weston 1.0 released

Posted Oct 24, 2012 16:08 UTC (Wed) by nix (subscriber, #2304) [Link]

Only if its keyboard support has improved. Last time I tried it I couldn't even type £, let alone use my meta keys. (More generally, keyboard support in any sort of virtualization with X underneath it is very hard -- I don't know if Weston allows this sort of thing to be truly virtualized, but X's keycode->keysym mapping, while praiseworthy in other ways, makes it damn hard by design to get back from a keysym to a keycode of any sort so you can feed it to a remote X server.)

Wayland and Weston 1.0 released

Posted Oct 24, 2012 16:30 UTC (Wed) by mjg59 (subscriber, #23239) [Link]

> Only if its keyboard support has improved

How is that relevant to whether or not sending pixmaps over the wire is an acceptable remoting approach?

Wayland and Weston 1.0 released

Posted Oct 24, 2012 17:37 UTC (Wed) by daniels (subscriber, #16193) [Link]

Huh? X only ever sends keycodes to clients, which are solely and 100% responsible for performing the translation to keysyms. It's possible to get a perfectly lossless translation with infinitely nested X servers, by just copying the keymaps and passing the keycodes straight through.

Wayland and Weston 1.0 released

Posted Oct 24, 2012 19:26 UTC (Wed) by michaeljt (subscriber, #39183) [Link]

> Huh? X only ever sends keycodes to clients, which are solely and 100% responsible for performing the translation to keysyms. It's possible to get a perfectly lossless translation with infinitely nested X servers, by just copying the keymaps and passing the keycodes straight through.

It can be slightly more complicated than that, given that the client system may not have the same mapping of key codes to physical keys (it may well not be running X at all), and that you are wanting to send the server key codes not symbols. On an X server with XKB and a reasonably PC-like keyboard you can get a pretty good idea of how the key codes and physical keys correspond, but that doesn't cover all systems by any means.

Wayland and Weston 1.0 released

Posted Oct 25, 2012 0:32 UTC (Thu) by daniels (subscriber, #16193) [Link]

Right, hence why you also need to copy the keymap. If you can't do that, then you're on your own.

Wayland and Weston 1.0 released

Posted Oct 25, 2012 4:20 UTC (Thu) by amtota (guest, #4012) [Link]

> Right, hence why you also need to copy the keymap. If you can't do that, then you're on your own.
Right. With xpra on posix platforms we try (...) to copy the keymap across, with win32 and osx clients it gets a little bit more complicated.

Going forward, what we need to do is to use the Xkb x11 api rather than the core keyboard api to get a full and exact keymap copy.
Until then, the code in latest version (0.7.1) works well enough for most, including multiple layouts and keyboard switching.

Wayland and Weston 1.0 released

Posted Oct 25, 2012 7:41 UTC (Thu) by michaeljt (subscriber, #39183) [Link]

>> Right, hence why you also need to copy the keymap. If you can't do that, then you're on your own.
The key map doesn't help when you are trying to translate a client's notion of physical key codes to a server's notion, since the key map is orthogonal to the physical keyboard layout. (Well actually it can help with some knowledge of common keyboard mappings, but that isn't nice.)

> Right. With xpra on posix platforms we try (...) to copy the keymap across, with win32 and osx clients it gets a little bit more complicated.

> Going forward, what we need to do is to use the Xkb x11 api rather than the core keyboard api to get a full and exact keymap copy.
Right, Windows and OS X have a nearly (ahem, Microsoft think AltGr is the same as Ctrl+Alt) fixed relationship between key codes and physical key positions on a PC-like keyboard. X11 doesn't, but XKB can give you good information to find out the relationship[1].

[1] https://www.virtualbox.org/browser/vbox/trunk/src/VBox/Fr...

Wayland and Weston 1.0 released

Posted Oct 25, 2012 9:53 UTC (Thu) by michaeljt (subscriber, #39183) [Link]

> The key map doesn't help when you are trying to translate a client's notion of physical key codes to a server's notion, since the key map is orthogonal to the physical keyboard layout.

That is, unless there is some way I am unaware of of finding out the mapping for a well known keyboard layout (e.g. US) for the current system via the X protocol - preferably a method which doesn't depend on XKB.

Wayland and Weston 1.0 released

Posted Oct 26, 2012 11:36 UTC (Fri) by daniels (subscriber, #16193) [Link]

> That is, unless there is some way I am unaware of of finding out the mapping for a well known keyboard layout (e.g. US) for the current system via the X protocol - preferably a method which doesn't depend on XKB.

Such a mapping doesn't necessarily exist: what if you're not using a PC keyboard at all, but have a weird phone-style keyboard? Or if your backend is, say, OS X, which has a slightly different approach to handling keycodes?

The best you can do right now is take the rules and model of the mapping you want to compare to, and compile a keymap with the same rules and model, but with the layout set to 'us'. And that might work, in the most case.

In any case, XKB, painful though it is, is _the_ keyboard mapping for X11, and that's never going to change. Not least because it's exposed at all levels through the totally immutable Xlib ABI.

Wayland and Weston 1.0 released

Posted Oct 26, 2012 11:51 UTC (Fri) by michaeljt (subscriber, #39183) [Link]

> In any case, XKB, painful though it is, is _the_ keyboard mapping for X11, and that's never going to change. Not least because it's exposed at all levels through the totally immutable Xlib ABI.

For my purposes XKB is not particularly painful - dealing with Windows oddities is much worse. The only reason that XKB-less methods interest me is for dealing with servers which don't have it. Not sure how many that is these days, but I am sure that some VNC-like servers will fall into that category - and tend to be rather interesting from a keyboard handling point of view.

Wayland and Weston 1.0 released

Posted Oct 25, 2012 0:09 UTC (Thu) by nix (subscriber, #2304) [Link]

Gah. True. Sorry, I misspoke, I forgot at what side of the server/client boundary the translation happened (it's been a long time since I did much with this and the relevant neurons obviously got trauma-erased).

Wayland and Weston 1.0 released

Posted Oct 24, 2012 4:33 UTC (Wed) by daniels (subscriber, #16193) [Link]

The Wayland answer is "nobody wants to do that, and anyone who says they do doesn't know what they are talking about", which doesn't do much to satisfy people's concerns who are using the features that they are so dimissive of.

Oh, for christ's sake. Where has anyone said that? Who?

Wayland already has working network transparency. It's not in a release, but you can see Kristian demoing it in the presentation he gave at XDC. I've seen it with my own eyes; it's pretty cool.

It's a slightly different approach to the way X does it; X forces it in the protocol, and then clients have to go to entertaining lengths to figure out if they can or can't use SHM/GEM/DRI2/etc. Wayland's (to be more accurate, Weston's) remoting support instead implements a proxy compositor and then pipes things over the network making full usage of compression for images, etc. So we've pulled the latency for clients right down to the bare minimum, and we can do world-class video compression without them having to care about it.

So, it's a much much better remoting protocol than X, which is pretty much the worst remote window system protocol anyone's ever seen. No image compression, all the images forced into the same stream as the control messages, which are extremely chatty and round-trip heavy - so it's incredibly sensitive to both latency and throughput. And if you have high/variable latency and low/variable throughput, it's going to be totally, totally unusable.

Please do me a favour in future and do a little background research - even a quick browse through the comments on any other LWN article about Wayland ever would've helped - before you start slagging off free software projects. Thanks.

Wayland and Weston 1.0 released

Posted Oct 24, 2012 6:03 UTC (Wed) by rsidd (subscriber, #2582) [Link]

Indeed, X's remoting is really bad. It was only ever usable on the sort of high-speed low-latency university LAN where it was developed. It was never intended for use over the internet. And today, even on LANs, X's performance is significantly worse than alternatives.

Wayland and Weston 1.0 released

Posted Oct 24, 2012 12:44 UTC (Wed) by sce (subscriber, #65433) [Link]

> Wayland already has working network transparency. It's not in a release, but you can see Kristian demoing it in the presentation he gave at XDC. I've seen it with my own eyes; it's pretty cool.

https://www.youtube.com/watch?v=L8zwnqKysfI#t=4314s

Wayland and Weston 1.0 released

Posted Oct 24, 2012 16:18 UTC (Wed) by nix (subscriber, #2304) [Link]

The comment thread in <https://lwn.net/Articles/481138/> has several instances of Wayland boosters doing down network-transparency as useless.

I pointed out in that thread that sending giant bitmaps would be devastating for a major use case: scrolling windows full of lots and lots of client-side-rendered text. X has those glyphs in GlyphSets, so doesn't need to send all the giant images over again: things like VNC or SPICE do not, so a single one-line scroll of a full-screen xterm can take half a second or so under such remoting technologies, while under remote X it is nearly instantaneous (you can easily scroll the whole screen line-by-line under remote X in the time it takes VNC et al to scroll a single line).

I asked what Wayland has that provides the same speed boost over giant image lump transfer.

Answer came there none.

Apparently terminal emulators and text editors are not an important use case anymore. (A killer for me, since my Emacs, with huge windows full of lots of text, is *always* run network-remote. It's as fast remotely under X as it would be locally. Obviously it is intolerably slow over a slow remote link, but I'm not using it that way. Oh, and while Emacs supports Gtk and thus would be able to pick up any Gtk-side Wayland remoting support, I note that horrible problems in Gtk's existing support for remote X -- including coredumping whenever a display goes away -- have gone unfixed since 2002, so I am not confident that Gtk Wayland remoting would be in any better shape any time soon.)

Wayland and Weston 1.0 released

Posted Oct 24, 2012 16:31 UTC (Wed) by wmf (guest, #33791) [Link]

sending giant bitmaps would be devastating for a major use case: scrolling windows full of lots and lots of client-side-rendered text
It's possible to compress this down to nothing using motion estimation; whether Wayland can actually implement that remains to be seen but it's not impossible.

Wayland and Weston 1.0 released

Posted Oct 24, 2012 16:42 UTC (Wed) by Cyberax (✭ supporter ✭, #52523) [Link]

That is EASILY fixed by a good compression protocol.

motion detection is not as easy as it should be

Posted Oct 25, 2012 4:25 UTC (Thu) by amtota (guest, #4012) [Link]

Unfortunately that is not the case.
xpra.org uses x264 and vpx codecs to achieve great compression ratios (whilst still maintaining almost pixel perfect quality for our xterms), but even these codecs fail to detect scrolling when more than a few lines move at a time.

Now, we don't want to start writing our own motion detection code, and since the x11 server already knows about the motion, it would be nice if it could expose this information to us... sadly it does not.

motion detection is not as easy as it should be

Posted Oct 25, 2012 11:24 UTC (Thu) by njs (guest, #40338) [Link]

The X server may or may not know about scrolling (it depends on which APIs the client is using), and the interface to expose this would be a nightmare... plus scrolling is an extremely trivial sort of motion to detect (integer number of pixels with absolutely unchanged contents). Why not just write some motion detection code?

Both sides of the connection have the old window contents available (though the server may not keep it in memory right now). A cheap-but-effective algorithm would be: Break this into fixed size chunks (say 16x16 pixels), discard solid-color ones, and hash the remaining with a rolling hash. When you get a new region to send, first run the rolling hash over this region to see if there are any matches. If so, align the new data with the matching old data, subtract, and send the offset + the difference (which will be highly compressible). Then the client inverts this to reconstruct. This will be effective even if some parts of the region are changing at the same time they scroll, new bits of the window are scrolling onto screen, etc., and the computational overhead would still be absolutely swamped by gzip, never mind vpx/x264.

motion detection is not as easy as it should be

Posted Oct 25, 2012 15:34 UTC (Thu) by renox (subscriber, #23785) [Link]

>Why not just write some motion detection code?

Because the more complex compression you do, the more latency you add..

motion detection is not as easy as it should be

Posted Oct 25, 2012 19:33 UTC (Thu) by njs (guest, #40338) [Link]

Yes, that's why I made a point of describing an algorithm that should only add a tiny amount of overhead on top of the existing gzip cost, and less than the super-fancy video encoders that are already used? Detecting simple scrolling is really not complicated.

motion detection is not as easy as it should be

Posted Oct 25, 2012 19:51 UTC (Thu) by hoegsberg (guest, #57768) [Link]

Yeah, and we're working on more or less the exact rolling hash idea you described. It was kinda weird to see you describe the same approach here... It's still work in progress, but there's a few PNGs here that shows the current status: http://people.freedesktop.org/~krh/rolling-hash/

With just a few MULs per pixel, we can detect if a 32x32 blocks starting at that pixel appears in the previous frame. This should basically be as good as any scrolling/copyarea hint we could've gotten from X or a toolkit, and it detects duplicate blocks in may cases where applications don't scroll but just re-render (like resizing). And of course this technique applies to both fullscreen remote display or per-window remote display.

motion detection is not as easy as it should be

Posted Oct 25, 2012 21:07 UTC (Thu) by njs (guest, #40338) [Link]

Hah, awesome. Well, I guess it's the obvious thing to try...

Wayland and Weston 1.0 released

Posted Oct 24, 2012 17:40 UTC (Wed) by daniels (subscriber, #16193) [Link]

The comment thread in https://lwn.net/Articles/481138/ has several instances of Wayland boosters doing down network-transparency as useless.

Yeah, unfortunately I can't do anything about the armchair software developers. Everyone who's actually contributed to Wayland has always had the same answer: remoting's going to come, it'll be better than X, but it won't be part of the core protocol because we don't think that's the right approach. The FAQ is badly worded, but that'll get fixed.

Wayland and Weston 1.0 released

Posted Oct 25, 2012 0:12 UTC (Thu) by nix (subscriber, #2304) [Link]

Agreed. I said 'boosters' not 'developers' for a reason :)

I suppose client-side remoting can fix this just as well as X can: the toolkit knows when you asked to print text, so can send just that over the wire perfectly well.

(It is disturbing to realise that in future different applications will have different degrees of support for remoting depending on what toolkit they're using, but I can't really claim that this differs from the current situation where they have different degrees of support for remoting depending on whether their developers ever tried to minimize roundtrips or whether they are using DRI. It's not as if 'it takes an hour for this program to map a window' is appreciably better than 'not working at all' -- and at least a 'just hurl giant bitmaps' fallback remoting program will work with everything, even if inefficiently.

I am slowly starting to be won over. Dammit. Can't you leave me *any* pointless irrational positions?

Wayland and Weston 1.0 released

Posted Oct 25, 2012 4:00 UTC (Thu) by raven667 (subscriber, #5198) [Link]

> I am slowly starting to be won over. Dammit. Can't you leave me *any* pointless irrational positions?

It's a pleasure to converse with someone who is at least willing to consider another persons position. There are plenty if people here that only seem interested in complaining but not listening, they are not much fun to talk to.

Wayland and Weston 1.0 released

Posted Oct 31, 2012 15:40 UTC (Wed) by daglwn (subscriber, #65432) [Link]

I too have started to come around on this now that it's been made clear that remote display will be possible.

I didn't understand the distinction between "remote display" and "remote transparency" until you clarified that earlier and stated that remote display is indeed a needed feature. Thank you for clearing that up for me.

Wayland and Weston 1.0 released

Posted Oct 25, 2012 15:36 UTC (Thu) by gidoca (subscriber, #62438) [Link]

As far as I understand from the XDC presentation video, it wouldn't be implemented in the toolkit, but as a special wayland compositor. On the computer you want to display the window, you would run the regular weston compositor, plus some client software. On the machine the application runs on, you would instead run some special compositor that speaks the wayland protocol, but sends the buffer over the wire instead of displaying it on the local display. Therefore, you wouldn't need anything special in the toolkit. Note that I don't know any more than what I learned from the talk, so take this with a grain of salt.

Wayland and Weston 1.0 released

Posted Oct 28, 2012 15:58 UTC (Sun) by nix (subscriber, #2304) [Link]

That's the fallback remoter, I think. The *real* remoting would be done in the toolkits, which know exactly what the application has done and can transmit data over the wire with correspondingly high efficiency, just as X does now only actually efficiently. (I hope there'll be a library of some sort implementing authentication and such things, so that the different toolkits don't end up with divergent ways of authenticating the remote connection with different user interfaces. xauth-plus-ssh is bad enough as it is...)

Wayland and Weston 1.0 released

Posted Nov 1, 2012 19:22 UTC (Thu) by wmf (guest, #33791) [Link]

I think toolkit remoting is going to be much more complex (especially when you have to implement it N times) and not necessarily faster than bitmap remoting (cf. the Sun Labs SLIM project). Also, it creates more bad PR because it makes it look like Wayland remoting is five years away.

Wayland and Weston 1.0 released

Posted Oct 30, 2012 21:09 UTC (Tue) by daglwn (subscriber, #65432) [Link]

> A killer for me, since my Emacs, with huge windows full of lots of text,
> is *always* run network-remote.\

I totally agree that remote display is an absolute must.

But have you tried Emacs with TRAMP? It's a pain to set up but once working I've found that it really does what I need to do: compile, debug, shell, etc.

There are some things TRAMP can't do so it's not a complete replacement for remote display but I've found I don't need remote display for Emacs anymore. Other things, sure, but not Emacs.

Wayland and Weston 1.0 released

Posted Oct 31, 2012 0:38 UTC (Wed) by nix (subscriber, #2304) [Link]

I need it for Emacs simply because my remote always-on server is, well, always on, and I fairly often access my Emacs from remote sites via emacsclient while the desktop is off. (The desktop is a power sucker, so it goes off when I'm not using it.)

TRAMP is very nice, but without remote display I'd be left running my Emacs on a machine that was turned off, and not even Wayland can do that. :}

Wayland and Weston 1.0 released

Posted Oct 31, 2012 15:43 UTC (Wed) by daglwn (subscriber, #65432) [Link]

Makes total sense to me. Our company has not yet seen always-on desktop systems as a power problem. Perhaps they will soon. :)

Wayland and Weston 1.0 released

Posted Oct 24, 2012 16:31 UTC (Wed) by gurulabs (subscriber, #10753) [Link]

"Please do me a favour in future and do a little background research"

One problem is that the official Wayland FAQ still (today) says:

Q: Is Wayland network transparent / does it support remote rendering?

A: No, that is outside the scope of Wayland....

So it is no wonder people are still confused on this point.

Wayland and Weston 1.0 released

Posted Oct 24, 2012 16:42 UTC (Wed) by mjg59 (subscriber, #23239) [Link]

Wayland is a local display server. It's like asking whether the Linux kernel supports ssh. Sure, if someone writes it, but it's not in the scope of kernel development.

Wayland and Weston 1.0 released

Posted Oct 24, 2012 17:03 UTC (Wed) by wmf (guest, #33791) [Link]

Writing a pedantically-correct FAQ that encourages misunderstandings is a good way to FUD your own project. It should say something like "Remoting is out of scope for the Wayland protocol or Weston compositor, but this will be solved with a proxy that will be bundled with your distro and will Just Work™".

Wayland and Weston 1.0 released

Posted Oct 24, 2012 17:07 UTC (Wed) by wmf (guest, #33791) [Link]

I hate to respond to myself, but I looked at the actual Wayland FAQ and it's not as bad as the quote above implies, but it's still pretty confusing.

FAQ could be more helpful

Posted Oct 25, 2012 4:28 UTC (Thu) by amtota (guest, #4012) [Link]

I agree, although I am biased as I maintain xpra.org, I would have expected the Wayland devs to get in touch with us or at least provide a link for those who do want to keep network transparency. Oh well.

Wayland and Weston 1.0 released

Posted Oct 26, 2012 0:17 UTC (Fri) by jschrod (subscriber, #1646) [Link]

Ah, the systemd argument.

We're replacing "XYZ" that does "ABC", calling it "xyzzy". Believe us, we're doing best work ever, you won't notice anything, and we'll all live happily ever after.

But, "XYZ" does "DEF" as well. How shall we do it in the future?

Well, "DEF" is not the scope of our replacement. It doesn't belong to "xyzzy".

But... "XYZ" did it...

You don't understand: We define the scope. And we're in the position to tell you that while "ABC" might be of interest to you, all the rest of the world doesn't care. So we define that "ABC" wasn't part of "XYZ" and we don't have to replace it.

But... "XYZ" did "ABC"...

As we said, we don't care. We define, you don't need "ABC".

But then... "XYZ" is not a replacement if it doesn't deliver the same functionality.

You're wrong. You're not in the position to define that. We have the power to define what is a replacement and what is not. And we tell you: "xyzzy" is a full replacement for "XYZ", for all relevant functionality. A maze of twisty little passages, all alike.

The story of the Linux desktop,
Joachim

PS: Chosing the name "xyzzy" as illustration is clearly not correct, as it doesn't support remoting to "Y2", even though it should. But, maybe, sometime in the future we'll be able to kill the dragon (aka we'll be able to really replace X) with our bare hands.

Wayland and Weston 1.0 released

Posted Oct 26, 2012 8:17 UTC (Fri) by dgm (subscriber, #49227) [Link]

> We're replacing "XYZ" that does "ABC", calling it "xyzzy".

Strawman. Wayland does not replace X11. X11 can be run on top of Wayland, just like it does on Windows or OSX. The rest of the argument does not make sense.

Wayland and Weston 1.0 released

Posted Oct 26, 2012 8:25 UTC (Fri) by jschrod (subscriber, #1646) [Link]

> Wayland does not replace X11.

When Qt und GTK focus on Wayland, these DEs will have native Wayland applications, and X will not be a first class citizen any more. It will only be supported as an legacy interface. As long as we don't want to be stuck using current software versions, that means that de-facto Wayland *will* replace X11 in the medium-to-long term.

Besides, the experience of running X11 on Windows or OS X is no good advertisement, either. I've done both, and good integrated support is something different.

Wayland and Weston 1.0 released

Posted Oct 26, 2012 9:32 UTC (Fri) by paulj (subscriber, #341) [Link]

This is rubbish. Qt and GTK are not DEs, but toolkits. Further, these toolkits *both* have long supported rendering outputs *other* than X11 for a long time (from Windows GDI to direct framebuffers, even HTML). So there's just no basis to say that the addition of another rendering context, Wayland, is going to change the quality of X11 support.

The only thing that could change that is if X11 becomes so little used that no one cares to support it anymore.

Wayland and Weston 1.0 released

Posted Oct 24, 2012 17:41 UTC (Wed) by daniels (subscriber, #16193) [Link]

Yeah, it does read quite badly. If you keep on reading, you see it arrive at the real answer of 'yes, it's coming, we just don't think it belongs in core protocol', but unfortunately it starts from a pretty literal interpretation of the question.

Sorry about that. :)

Wayland and Weston 1.0 released

Posted Oct 24, 2012 18:02 UTC (Wed) by apoelstra (subscriber, #75205) [Link]

> Yeah, it does read quite badly. If you keep on reading, you see it arrive at the real answer of 'yes, it's coming, we just don't think it belongs in core protocol', but unfortunately it starts from a pretty literal interpretation of the question.

> Sorry about that. :)

Thanks for your polite replies in this thread. Myself, and I suspect many others, don't take the time to read up on this stuff, and only encounter Wayland discussions on LWN. And as you say, there are many armchair software developers slinging crap around, and the communication from the Wayland devs thus far leaves something to be desired.

So, it's nice to see people rising above the fray and clearing up misconceptions, rather than getting caught up in flamewars (or completely ignoring the thread).

Wayland and Weston 1.0 released

Posted Oct 24, 2012 22:31 UTC (Wed) by rahvin (subscriber, #16953) [Link]

As one of the armchair idiots let me just say I was right along with everyone else's negativity until I read the excellent LWN articles and subsequent wayland developer comments that were in replay to the article. Wayland appears to me that it's going to solve some real problems, remove some serious legacy cruft (almost 90% of X isn't even used) and bring the Linux desktop back to the Unix approach which is a simple tool for each task and X is not a simple tool.

The worst part is the misunderstanding about what Wayland is and what it's trying to do as can be seen in the slashdot article and unfortunately in the posts here as well. (as noted, it doesn't help that the FAQ is badly worded in some cases).

Wayland and Weston 1.0 released

Posted Oct 25, 2012 0:14 UTC (Thu) by nix (subscriber, #2304) [Link]

Agreed. I'll only be unhappy with Wayland if major toolkits don't bother to implement remoting -- but if they do (which seems likely, or Wayland will never take off), it's probably going to become as capable as X already is, with more scope for expansion.

Wayland and Weston 1.0 released

Posted Oct 25, 2012 15:08 UTC (Thu) by renox (subscriber, #23785) [Link]

> Agreed. I'll only be unhappy with Wayland if major toolkits don't bother to implement remoting

I think that "a proxy pushing giant bitmap" remoting will be eventually available whatever the toolkit used, of course in some case (text) it's quite inefficient compared to XRender glyph cache's remoting..

Wayland and Weston 1.0 released

Posted Oct 25, 2012 22:52 UTC (Thu) by rahvin (subscriber, #16953) [Link]

The only thing I can do is point to the comments in the previous articles that even if you are running Wayland you can still run X on top even if someone doesn't do a connector or other tool that only runs the parts of X that are needed.

Wayland and Weston 1.0 released

Posted Oct 27, 2012 8:22 UTC (Sat) by paulj (subscriber, #341) [Link]

The major toolkits already implement remoting that works with Wayland: X11. Hopefully there'll be better remoting protocols in time.

Wayland and Weston 1.0 released

Posted Oct 28, 2012 16:01 UTC (Sun) by nix (subscriber, #2304) [Link]

True! So we *already* have nothing worse than before, as long as someone keeps the X11->Wayland stuff maintained (and I suspect, given the installed base of X applications, that it's not going to fall unmaintained for a long, long time).

Wayland and Weston 1.0 released

Posted Oct 25, 2012 15:42 UTC (Thu) by Seegras (subscriber, #20463) [Link]

I'm not entirely convinced of the Wayland model, because of something totally different than what everyone is always bickering about...

Window decorations under client control. I can just see things like this
http://hallofshame.gp.co.at/phone.htm spreading. And un-killable windows occupying the foreground and, and and... The whole desktop as one big entry in the user interface hall of shame.

Wayland and Weston 1.0 released

Posted Oct 25, 2012 15:58 UTC (Thu) by mpr22 (subscriber, #60784) [Link]

This argument would be more convincing if it weren't for the fact that programs acting as if they don't trust the WM to provide them with furniture have been around on X11-based platforms for over a decade.

Wayland and Weston 1.0 released

Posted Oct 25, 2012 23:43 UTC (Thu) by Jandar (subscriber, #85683) [Link]

What programs would that be and how do they corrupt the decorations of the WM? The prospect of windows with different title-bars and arbitrary positioning of respective buttons is scary. IMHO client-side decorations are an abomination. The one reason mentioned in https://www.youtube.com/watch?v=L8zwnqKysfI for this is a smoother border between decoration and a tilted window. I couldn't care less. Enforced consistence of window-managing buttons is far more important. Why don't the wayland compositor compose the original application-window and the decoration into one resulting window and do the following transformations on this new window? In the video it was said such embedding of windows is highly performant even in the case of nested compositors.

Wayland and Weston 1.0 released

Posted Oct 26, 2012 4:03 UTC (Fri) by mjg59 (subscriber, #23239) [Link]

They set a hint asking the window manager not to draw any window decorations, and then they draw their own. xmms is a pretty obvious example.

Wayland and Weston 1.0 released

Posted Oct 26, 2012 11:39 UTC (Fri) by daniels (subscriber, #16193) [Link]

And Chromium. I think Firefox does it now too.

But yeah, funny how you never saw anyone decrying XMMS as the death of UNIX, and it never seemed to be a particular problem then.

X11 offers (and forces you to use) myriad ways to tell the window manager to shut up and get out of the way. Setting the override-redirect flag on your window - which is required for all menus, combo boxes, tooltips, screensavers, and other things I can't remember off the top of my head - makes it impossible for the window manager to in any way influence what goes on.

Wayland and Weston 1.0 released

Posted Oct 26, 2012 20:07 UTC (Fri) by intgr (subscriber, #39733) [Link]

I don't have a strong opinion on the question of CSD. I can certainly see the benefits it offers, but also the problems.

> And Chromium
Chromium on Linux has an option "Use System Title Bars and Borders" which turns WM decorations back on. (Click on the empty area next to the tab bar)

> I think Firefox does it now too.
Not on my system at least -- still looks Gnomey.

> X11 offers (and forces you to use) myriad ways to tell the window manager to shut up and get out of the way
That's not a problem really -- most apps will accept WM decorations for their main window because that's the natural thing to do. The ones that you're listing (Chromium and XMMS) are exceptions.

The problem is the *common* case with Qt apps running on a Gnome desktop or GTK apps running on a KDE desktop -- they will look inconsistent and possibly behave inconsistently too.

Or consider toolkits that until now didn't *need* to render their decorations -- I wonder whether Tkinter and FLTK even have any decoration-rendering code because usually the OS will be happy to provide that. Now they need to implement decorations themself or rely on some new external dependency (probably a competing toolkit).

Or am I missing something?

Wayland and Weston 1.0 released

Posted Oct 26, 2012 21:42 UTC (Fri) by daniels (subscriber, #16193) [Link]

> The problem is the *common* case with Qt apps running on a Gnome desktop or GTK apps running on a KDE desktop -- they will look inconsistent and possibly behave inconsistently too.

They already do. The contents look totally different. They're designed according to HIGs with fundamentally different ideas. They don't have the same VFS, or open/save dialogs. The button order (OK vs. Cancel) is different. The printing UI isn't common. Keyboard shortcuts are different. And so on, and so forth.

CSD means that window decorations are inconsistent in between applications, but it means that the frame and the application themselves are at least consistent. Swings and roundabouts.

> Or consider toolkits that until now didn't *need* to render their decorations -- I wonder whether Tkinter and FLTK even have any decoration-rendering code because usually the OS will be happy to provide that.

The pithy answer to this is 'life's tough'. Writing a toolkit is already really, really hard. (Window managers too.) You'd be surprised how difficult it is; the /topic in #xorg-devel for years was 'seriously, don't write your own toolkit or window manager'. Especially in X11, and especially with all the synchronisation nightmares that external decorations bring you. It's a lot of code, a lot of frustrations, and a hell of a lot of corner cases.

Wayland greatly simplifies that on the whole by removing a lot of the truly difficult parts (e.g. size incoherence) and hair-tearing corner cases, and since toolkits already render all the content, then I expect rendering decorations won't exactly be onerous for them.

The exception to the rule here is SDL, which AIUI doesn't do any drawing of its own. But that's widely-used enough that I expect they'll be able to adapt quite easily.

Wayland and Weston 1.0 released

Posted Oct 31, 2012 15:53 UTC (Wed) by daglwn (subscriber, #65432) [Link]

> But yeah, funny how you never saw anyone decrying XMMS as the death of
> UNIX, and it never seemed to be a particular problem then.

Heh. I took one look at XMMS and decided it was unusable precisely because of the application-managed decorations making it really non-intuitive. Consistency is important.

I'm not necessarily saying Wayland is wrong here but it is definitely something to keep on top of. Frozen unkillable windows is my biggest concern with this.

Wayland and Weston 1.0 released

Posted Nov 2, 2012 10:09 UTC (Fri) by intgr (subscriber, #39733) [Link]

> Frozen unkillable windows is my biggest concern with this.

This has already been solved in Wayland (or Weston, whatever). Whenever the toolkit pops up a new window, it can register a certain clickable area which acts as the "kill button" if the window isn't responding to events. Normally this area overlaps with the close button on the title bar.

Wayland and Weston 1.0 released

Posted Nov 2, 2012 15:23 UTC (Fri) by nix (subscriber, #2304) [Link]

They're still immobile, though (although admittedly even in X, frozen windows can be dragged but can't be repainted, so they end up looking ugly -- but at least you can get them to get out of the way.)

Wayland and Weston 1.0 released

Posted Nov 2, 2012 16:09 UTC (Fri) by intgr (subscriber, #39733) [Link]

> They're still immobile, though

As far as I understand, dragging (moving) windows will still work -- the draggable title bar is registered with a similar hint like the kill button. Window placement and moving is now exclusively the job of the compositor -- windows don't even receive move events and they may not have a well-defined position with respect to the screen any more, because the compositor is free to do anything with them.

But you're right, resizing windows will probably not work as it does in X11.

Wayland and Weston 1.0 released

Posted Nov 2, 2012 20:30 UTC (Fri) by nix (subscriber, #2304) [Link]

Ah, right. I'd say the useful properties are retained -- you can move a stuck window mostly off the screen if need be. Resizing a stuck window is much less important (at least in my workflow).

Wayland and Weston 1.0 released

Posted Oct 28, 2012 16:02 UTC (Sun) by nix (subscriber, #2304) [Link]

Yes (hello, XMMS), and they're horrifying and I don't use them. The thought of *every* application doing that... also, currently decorations are highly customizable. If they're under toolkit control, the likelihood is they won't be. I'd find that annoying.

Wayland and Weston 1.0 released

Posted Oct 26, 2012 0:54 UTC (Fri) by daniels (subscriber, #16193) [Link]

If you don't trust your applications to do things like shut down correctly, or to not be an entrant into a hall of shame, then don't run them.

The non-technical argument for client-side decorations (which isn't the reason for having them), is that you gain consistency between the app contents and the frame; that phone example you linked to wouldn't be enhanced by being in a window with totally random decorations that don't in any way fit the app. Although, on X11, it'd probably do as Chromium, XMMS and a million others do and have done since the dawn of time and draw their own decorations anyway.

But the technical argument of not needing the synchronisation between the frame and content windows is more than enough - you have no idea how painful that is.

Wayland and Weston 1.0 released

Posted Oct 26, 2012 8:48 UTC (Fri) by renox (subscriber, #23785) [Link]

There is another argument for server side decoration that you fail to consider: smooth resizing of the window.
With client-side decoration, if the application is slow to answer the resizing will feel 'jerky', with server side decoration the window will resize smoothly but the content of the window will be "ugly".
That's a tradeoff but I prefer smooth resizing.

Wayland and Weston 1.0 released

Posted Oct 26, 2012 9:04 UTC (Fri) by daniels (subscriber, #16193) [Link]

With client-side decorations, the client sends exactly one buffer to the server - the complete window - every time it resizes.

With server-side decorations, every time the window's resized, the server has to create and fill a new buffer with the frame, then do a stretch blit (or fill the undefined contents with a solid colour, or whatever) of the contents into the frame window. Asynchronously, the contents are updated and the updated contents are blitted back into the frame. Aside from the waste of resources from the additional buffer, I believe it looks measurably worse. The 'spasm' as you get the frame changing size, followed by the content being stretched, followed by resized content (quite possibly from an old resize event, so just beign differently stretched) is pretty horrific.

Additionally, if your problem is resource starvation such that the client can't keep up, adding additional load in the form of the server drawing decorations for sizes the client's never likely to make, and the extra resource load from the additional blits, exacerbates the problem.

I'd much rather just have the pointer lagging a little behind.

Wayland and Weston 1.0 released

Posted Oct 26, 2012 9:33 UTC (Fri) by renox (subscriber, #23785) [Link]

>Additionally, if your problem is resource starvation such that the client can't keep up,

This isn't the only reason why clients cannot keep up: applications do many thing, so if you don't dedicate a thread to the GUI, a client can be slow to answer even if the system isn't loaded.

>I'd much rather just have the pointer lagging a little behind.

It's a matter of personal preference, I don't!
Plus I don't think that the pointer will lag behind, only that the window won't resize smoothly, I have to look at the sources.

Wayland and Weston 1.0 released

Posted Oct 26, 2012 10:00 UTC (Fri) by daniels (subscriber, #16193) [Link]

Also, the other other reason is that it significantly complicates event handling, and creates absolutely nightmarish corner cases. Client-side decorations have the nice property of ensuring that windows actually have a single defined size, rather than size being some kind of mystical transient property that's likely to have changed by the time you submit your request.

Wayland and Weston 1.0 released

Posted Oct 26, 2012 11:36 UTC (Fri) by renox (subscriber, #23785) [Link]

Oh, there is no question that client-side decorations have benefits.

But there is still this issue of jerkiness when the client is busy and even with a dedicated GUI thread the client may become busy if for example the client use a non-realtime GC (most of the GCs are not real-time), etc.

Loosing smooth resizing of windows is a HIGH price to pay for the benefits of CSD.

Wayland and Weston 1.0 released

Posted Oct 26, 2012 11:47 UTC (Fri) by daniels (subscriber, #16193) [Link]

It's not smooth. Your app goes from actual rendered content -> scaled content -> scaled content -> scaled content -> actual rendered content -> scaled content -> scaled content -> actual rendered content. Imagine an app with a status bar, where you're enlarging the size: your status bar goes from its natural size with sharp fonts, to bigger and blurry, to bigger and blurry again, back to its natural size with sharp fonts, and so on, and so forth. It's a disaster for text, where you see the exact same thing, except even more jarring because the text is likely to get reflowed.

The rapid spasming transition is really, really jarring, and objectively speaking, the scaled content looks worse than genuine client-rendered content. All this is in direct conflict with Wayland's core ethos of 'every frame is perfect'.

So it's either that, or you can leave the window contents in place at the last size the client gave you, and track the new size with an outline. Which is 100% possible to implement within Wayland.

The only benefit it has is the frame window following the pointer.

(And hey, if it forces app authors to actually think about making their clients more responsive to user interaction, that's no bad thing at all.)

Wayland and Weston 1.0 released

Posted Oct 26, 2012 12:33 UTC (Fri) by renox (subscriber, #23785) [Link]

>It's not smooth.[cut]

*Sigh*, at the beginning of the discussion I said 'with server side decoration the window will resize smoothly but the content of the window will be "ugly"' so I know..

>objectively speaking, the scaled content looks worse than genuine client-rendered content

And "objectively speaking" having the frame of the window resize smoothly all the time is better than resizing jerkily when the application is slow to answer to events.

I don't read the text of my windows while I'm resizing them, that why I care more about smooth resizing of the windows frame than having a nice content inside, that is a *trade-off* you prefer one option I prefer the other, that's all.

>And hey, if it forces app authors to actually think about making their clients more responsive to user interaction, that's no bad thing at all.

I actually agree with that, but as I've already said it's not easy at all, especially if you use a GC!

Wayland and Weston 1.0 released

Posted Oct 26, 2012 16:05 UTC (Fri) by raven667 (subscriber, #5198) [Link]

> So it's either that, or you can leave the window contents in place at the last size the client gave you, and track the new size with an outline. Which is 100% possible to implement within Wayland.

This also seems to cover the use case you are looking for, similar to how some older WMs worked.

Wayland and Weston 1.0 released

Posted Oct 26, 2012 16:30 UTC (Fri) by renox (subscriber, #23785) [Link]

>> So it's either that, or you can leave the window contents in place at the last size the client gave you, and track the new size with an outline. Which is 100% possible to implement within Wayland.
> This also seems to cover the use case you are looking for, similar to how some older WMs worked.

Not really, you loose information about how your window will look when resized which is annoying, but I think that this configuration is the best when you're using remote applications on high latency communications, so it's still an interesting configuration.

Wayland and Weston 1.0 released

Posted Oct 26, 2012 16:32 UTC (Fri) by daniels (subscriber, #16193) [Link]

> Not really, you loose information about how your window will look when resized

Which you also lose whilst scaling.

Wayland and Weston 1.0 released

Posted Oct 26, 2012 18:02 UTC (Fri) by renox (subscriber, #23785) [Link]

>> Not really, you loose information about how your window will look when resized
>Which you also lose whilst scaling.

Which are very temporary, short situations.

Wayland and Weston 1.0 released

Posted Oct 26, 2012 18:37 UTC (Fri) by daniels (subscriber, #16193) [Link]

> Which are very temporary, short situations.

Equally as temporary and short as for client-side decorations. Although I still maintain CSDs are likely to be even more responsive for the reasons I listed above.

Wayland and Weston 1.0 released

Posted Oct 28, 2012 16:04 UTC (Sun) by nix (subscriber, #2304) [Link]

You've never had an application lock up and require an xkill?

Wayland and Weston 1.0 released

Posted Oct 26, 2012 3:06 UTC (Fri) by drag (subscriber, #31333) [Link]

> Window decorations under client control.

After the whole 'network transparency' red herring thing this was the next things that I saw people complaining about Wayland's approach.

> I can just see things like this http://hallofshame.gp.co.at/phone.htm spreading.

I don't. It's shit software. Users solve the problem of shit software by not using it. Developers may design and program something like that, but if they do then it won't hurt anything or anybody because nobody will use it.

If it _does_ actually become popular and widely used then users will find that sort of thing very useful and attractive despite the fact it may offend your design sensibilities... although I doubt that will happen to the extreme; because it's almost objectively terrible.

> And un-killable windows occupying the foreground and, and and...

I don't see how not having windows decorations dictated by Wayland is the same as not having control over windows. This problem can be solved by having a equivelent of 'xkill' and/or the use of a particular keyboard sequence that cannot be overridden or intercepted by a application. Also a alt-click-drag feature would be useful in Wayland, just like it is in X.

Wayland and Weston 1.0 released

Posted Oct 26, 2012 8:35 UTC (Fri) by dgm (subscriber, #49227) [Link]

Wayland and Weston 1.0 released

Posted Oct 29, 2012 10:55 UTC (Mon) by njwhite (subscriber, #51848) [Link]

The issue I have with client-side decorations is that presumably there's no (easy, universal) way to turn them off. My window manager is keyboard based, and I enjoy not having to waste my screen real-estate with large titlebars and buttons that I don't need. Not having a way to turn them off easily would be a pain. But maybe that's something the toolkits will just add as an option in .gtkrc or equivalent, in which case I cease to care.

Copyright © 2012, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds