Wayland in GNOME: two progress reports
The X11 replacement protocol Wayland has been in development since 2010. Compared to X11 itself, it is still a relatively new project, but the enthusiasm with which distributions and large software projects announced their intent to support Wayland makes it at least understandable that users would ask how much longer they need to wait before Wayland is made available to them. At GUADEC 2014 in Strasbourg, France, a pair of talks presented the latest status of Wayland support in various GNOME desktop components.
The desktop and GTK+
Jasper St. Pierre presented an overview of GNOME's Wayland support on July 28. St. Pierre's talk started off with an atypical question-and-answer session as he debugged some last-minute problems with his current Wayland session in GNOME's Mutter. One audience member asked when Wayland would be available by default in a Linux distribution; in reply St. Pierre joked "I'll tell you at the end of this talk when it has run without crashing the whole session." More seriously, another audience member asked whether Wayland would support multiple copy/paste buffers; St. Pierre responded that nothing explicitly forbids it, but that in some places the protocol assumes it. Adding multiple buffers would require changing the protocol in ways that the Wayland developers "really don't want to do."
Although many in attendance were already familiar with X11's security problems, St. Pierre illustrated them at the top of his talk by showing a quick-and-dirty GTK+ program he had written that would exploit X11's lack of application isolation—by, among other things, logging keystrokes and drawing into another application's window. These insecurities are at the heart of GNOME's interest in switching to Wayland, he said. His keylogger could record passwords typed even when the GNOME screen-lock was active, he noted. There have been attempts to improve X security through extensions, he said, but they were "so complex to configure that even the SELinux people said 'we're not going to try implementing that.'"
But in addition to improving security by isolating each process's connection to the display server, Wayland offers GNOME real feature benefits, he said, such as automatic scaling of content on high-DPI monitors and real synchronization of redraws. The most common demos of Wayland, he explained, show off oddities like tilting windows to an angle. That understandably means little to users, he said, but to display developers it shows instantaneously that there are important things possible in Wayland that were impossible in X. Wayland will enable smoother redrawing when dragging and resizing windows. The current tearing and lag that users see is really a shortcoming in X, he said, but users often just blame GNOME or Linux in a generic sense.
The current state of GNOME support for Wayland is a mixed affair. The demonstration apps run quite well under GNOME's Mutter window manager, he said, but support for the GTK+ toolkit comes from the Wayland backend for the lower-level GIMP Drawing Kit (GDK) library, which he called "very, very iffy." Most noticeably, he said, is that GDK's Wayland backend is missing clipboard and drag-and-drop support.
Mutter support is also incomplete, as things are still stabilizing. "I just fixed screen recording support last week," he said. The stability of the Wayland version of Mutter also depends on which GPU driver is used, he explained. The Intel drivers are the most complete; the open-source drivers for NVIDIA chips are in between, while the closed-source NVIDIA drivers do not work with Wayland at all. The reason is that NVIDIA does not offer all of the functions that the open drivers require for Wayland; the company's binary X.org drivers are tied directly into X, so only the company can implement Wayland support for them.
Outstanding questions
In response to an audience question, St. Pierre further explained that supporting a new GPU, generally speaking, is not any harder under Wayland than under X. Supporting a new GPU on Linux essentially boils down to supporting mode setting and supporting direct rendering. Wayland support hinges on the direct-rendering aspect, but most of the work required to support a new GPU is the same for Wayland as it is for X.
There is also ongoing work to figure out how best to support taking screenshots of the whole desktop. Users expect the feature, but it has major security implications. If an application can take a screenshot unattended, it can also use that capability to record username/password combinations and other sensitive data. The straightforward solution is to force screenshot capture to require a user to verify the action; that would at least allow the user to detect if an unauthorized screenshot attempt is made.
St. Pierre spent a large portion of the session slot responding to questions. One question dealt with whether Wayland will be faster or more efficient than X11. It will certainly not be faster in the first few releases, St. Pierre said, but the potential is there for a lot of optimization work. For example, he said, a lot of video content is encoded in YUV color and has to be converted to RGB color for X. But many modern graphics chips support YUV natively; skipping that color-space conversion would be a big time-saver. In addition, he said, "performance" is sort of a generic term. A user might not see a noticeable frame-rate increase in Wayland, but would benefit from other performance improvements like lower CPU and memory overhead.
Another audience member asked whether Wayland would require applications to use client-side window decorations (which GNOME 3 implements but other desktops do not). St. Pierre responded that it would not; the subject is a longstanding debate, and no position has been written into the Wayland protocol. Making both options work was mostly a social problem to solve, not an engineering one, he said. If KWin decides it needs specific changes for its server-side window decorations, St. Pierre said, it is far better for him to sit down with maintainer Martin Gräßlin and come up with a handshake protocol than to try and work around the issue in Mutter.
Two other questions raised more difficult application-compatibility concerns. One person asked how Wayland's isolation of a process's window contents would affect graphics applications like GIMP and Pitivi, which often have a color-picker tool that lets the user copy a pixel's RGB value. St. Pierre replied that Wayland would not currently allow that feature. Similarly, in response to another question, he noted that Wayland will cause a lot of trouble for supporting (and reassigning) global keybindings.
When another audience member asked "how do we sell users on this change, if the fact is that GIMP doesn't work anymore but you can drag windows without tearing?" St. Pierre joked that "I installed Wayland and all I got was new bugs" t-shirts would become popular. The truth, he said, was that a lot of bugs will appear because of the switch, and that if that fact is not handled properly, there is a real risk that the most noticeable outcome will be people getting unhappy about the change.
WebKit
St. Pierre covered GNOME's Wayland support at the desktop environment and toolkit level, but Žan Doberšek followed up with a session specifically about Wayland support in the GTK+ version of WebKit, which GNOME uses for its Web browser and as the HTML renderer in several other applications.
In large part, he said, the WebKitGTK+ support for Wayland relies on the same GDK backend support as other applications. But there are also several factors unique to the WebKit case. First, GDK does not support hardware-accelerated video compositing, which WebKit needs for video playback. The solution the project has taken is "inventive," he said. Only specific HTML and CSS features trigger the need for the feature, so they can be treated as a special case. Under X, these compositing operations can be handed off to OpenGL.
But, under Wayland, that same technique is not allowed because it involves handing graphics to a separate process—a major security risk. Instead, WebKitGTK+ has its own nested Wayland compositor that runs inside the main UI process. Making this work required writing an extension to Wayland, but only a small one. It currently works on Intel graphics, but is less well supported elsewhere, because it relies on several specific OpenGL extensions.
The other troublesome factor confronting WebKitGTK+ is how to handle plugins. Opinion is divided, he said. "Personally, I don't want to tackle it because I want plugins to die," he added. The only solution that looks plausible, he said, is if there is reusable work from Mozilla's JavaScript-based, open-source Flash renderer.
The hardware-accelerated compositing work, though, is on track for a future release already. It could land in the WebKitGTK+ 2.6 version, he added, although there has not been a stable candidate released yet. Performance issues still have to be addressed, as does WebGL support.
Overall, there may not be a clear answer to the question of "when will GNOME have Wayland support?" But it is still helpful to see an update on the project's process. The WebKitGTK+ engine is one of the few special cases—most applications will rely on Mutter and GTK+ for their Wayland support—but, on the other hand, accessing the web is one of the most important uses of a modern desktop.
[The author would like to thank the GNOME Foundation for travel assistance to attend GUADEC 2014.]
Index entries for this article | |
---|---|
Conference | GUADEC/2014 |
Posted Jul 30, 2014 19:07 UTC (Wed)
by intgr (subscriber, #39733)
[Link] (2 responses)
That sounds like a pretty significant omission. To the contrary, the ability to delegate rendering part of some window to another, more restricted process, should be a security-enhancing feature.
Hopefully the developers realize this and just haven't got around to it yet?
Posted Jul 30, 2014 20:36 UTC (Wed)
by iabervon (subscriber, #722)
[Link]
And, actually, the ideal that a web page shouldn't be able to take over the browser UI matches the ideal that an application shouldn't be able to take over the window system UI, so it makes sense that the browser would use the same mechanism, down to being a Wayland compositor.
Posted Jul 31, 2014 6:04 UTC (Thu)
by daniels (subscriber, #16193)
[Link]
Posted Jul 31, 2014 5:41 UTC (Thu)
by eru (subscriber, #2753)
[Link] (3 responses)
I don't get this. Doesn't the colour to be picked normally come from an image window that belongs to the same GIMP process as the colour picker tool?
Posted Jul 31, 2014 7:26 UTC (Thu)
by peregrin (guest, #56601)
[Link] (2 responses)
Posted Aug 17, 2014 11:47 UTC (Sun)
by eru (subscriber, #2753)
[Link] (1 responses)
Posted Aug 17, 2014 13:11 UTC (Sun)
by Cyberax (✭ supporter ✭, #52523)
[Link]
Posted Jul 31, 2014 7:48 UTC (Thu)
by iq-0 (subscriber, #36655)
[Link] (10 responses)
There an application is also prohibited from interacting with another's content, but specific programs can be activated as "Accessibility Tools".
That's a bit of a hack, but some sort of "privileged access request" could be made and (optionally) cached by the compositor (preserved in it's global config or just for one session), but that would be up to the compositor to deal with).
Posted Aug 4, 2014 12:37 UTC (Mon)
by salimma (subscriber, #34460)
[Link]
Would be great if in the future such access can be further limited -- right now once an app registers as an accessibility tool you pretty much have to trust them not to abuse the privilege.
Posted Aug 6, 2014 8:54 UTC (Wed)
by moltonel (guest, #45207)
[Link] (8 responses)
Delegating the color-picking rights to a service app is prone to abuse as well : unless that service add a UI and some constraints, a client app could color-pick all the screen's pixels to get a screenshot. Such a service (as an app or as a Wayland extension) sounds like the way to go though.
Posted Aug 13, 2014 0:31 UTC (Wed)
by zlynx (guest, #2285)
[Link] (5 responses)
For example, the display may be 8 bit per channel and the image 16 or 32 bits per channel.
That said, I know you probably picked GIMP just as an example.
Posted Aug 13, 2014 21:18 UTC (Wed)
by ABCD (subscriber, #53650)
[Link] (4 responses)
Posted Aug 13, 2014 21:47 UTC (Wed)
by zlynx (guest, #2285)
[Link] (3 responses)
If you need the color of a screen object, take a screen shot and load that as an image.
If GIMP is still using screen color when picking colors from a GIMP image, that is a problem in my opinion, since as I said, it cannot be reading the real color.
Posted Aug 14, 2014 16:30 UTC (Thu)
by nye (subscriber, #51576)
[Link] (2 responses)
"I don't use that feature, therefore you shouldn't have it either."
Personally, I've never actually needed to use colour profile support. I presume you'd be happy if I suggested removing that then?
(Also, it seems that people here are forgetting that GIMP, in common with most image editors, is capable of taking screenshots itself, so that's another feature that would have to be axed in the name of 'security'.)
Posted Aug 14, 2014 17:17 UTC (Thu)
by zlynx (guest, #2285)
[Link] (1 responses)
Posted Aug 15, 2014 6:59 UTC (Fri)
by iq-0 (subscriber, #36655)
[Link]
For screengrabbing (and thus screencapture) what you see is probably also what you want (you want to record/capture what is being presented), so with possible loss of color depth.
For the color-picker you probably don't want to emulate that through screen capture and than afterward looking at the picture, but it could be done by grabbing/capturing just that surface (or what the term is in Wayland).
Posted Aug 15, 2014 8:06 UTC (Fri)
by iq-0 (subscriber, #36655)
[Link] (1 responses)
But the (relatively) simple question about "should application X be allowed to capture/grab the screen" is one that the compositor would ideally not handle itself. That question can be delegated to an external process that checks the policy (by prompting for each use (with a possible "always" option) or by considering certain programs to be generic "accessibility tools" and should thus always be allowed to do that (screen readers, print screen handlers, etc.).
Posted Aug 25, 2014 0:43 UTC (Mon)
by gmaxwell (guest, #30048)
[Link]
Instead, there should be some split-out, highly confined programs that run as separate processes and can sniff the color of one pixel (or the average of some local area, based on switches) under the mouse; and another that grabs the screen or another window but only after providing a dialog. Then gimp can just invoke these programs— preserving the functionality for the user but not totally bypassing the very useful security improvement.
The same thing should be done for file access in the SELinux environments for the vast majority of desktop applications which need to only access their own data plus a few files specified by the user which are always accessed via a file chooser.
Posted Jul 31, 2014 7:57 UTC (Thu)
by ncm (guest, #165)
[Link] (9 responses)
Posted Jul 31, 2014 13:37 UTC (Thu)
by sebas (guest, #51660)
[Link]
Posted Jul 31, 2014 16:45 UTC (Thu)
by magcius (guest, #85280)
[Link] (7 responses)
That doesn't have any security issues, because it can't use that interface to steal the screen contents.
Posted Jul 31, 2014 18:48 UTC (Thu)
by robclark (subscriber, #74945)
[Link] (5 responses)
except you could one by one request the color of every pixel..
possibly rate-limiting requests is a reasonable compromise for someone who has desktop configured in a more permissive mode?
Posted Jul 31, 2014 20:31 UTC (Thu)
by Karellen (subscriber, #67644)
[Link] (3 responses)
Posted Jul 31, 2014 20:45 UTC (Thu)
by drago01 (subscriber, #50715)
[Link]
Posted Jul 31, 2014 20:47 UTC (Thu)
by robclark (subscriber, #74945)
[Link] (1 responses)
Posted Aug 7, 2014 21:33 UTC (Thu)
by ssokolow (guest, #94568)
[Link]
Posted Aug 4, 2014 18:36 UTC (Mon)
by drag (guest, #31333)
[Link]
That's a awful lot of click on the part of guy choosing the pixel.
Having the compositor carry out privileged tasks on behalf of applications seems like a acceptable solution.
It's quite easy to imagine a situation were a application has a legit reason to grab a screen capture. Gnome-shell has the desktop record feature built-in so you can encode images of your desktop activity into video files.
To have in secure seems simple enough:
Application requests image/video/pixel capture, sends requests to compositor, compositor communicates with user to initiate the capture, and then compositor provides path to the data back to the application when it is finished writing it out to the file system (or whatever)
Posted Aug 10, 2014 7:54 UTC (Sun)
by jkhanlar (guest, #98262)
[Link]
Posted Jul 31, 2014 15:42 UTC (Thu)
by iabervon (subscriber, #722)
[Link] (4 responses)
Posted Jul 31, 2014 18:25 UTC (Thu)
by gioele (subscriber, #61675)
[Link] (1 responses)
It is reasonable to have the compositor handle the screenshotting mechanism, but I think it should be the role of a 3rd-party application to trigger that mechanism, or at least to receive the output of that mechanism.
Maybe a solution could be to have the compositor waiting for "take a screenshot" actions (key combinations, gestures, etc.) and then launch a user-specified application to handle the results. Applications like gimp could configure themselves as temporary screenshot receivers while gnome-screenshot, for example, would be the default receiver.
Posted Jul 31, 2014 18:49 UTC (Thu)
by iabervon (subscriber, #722)
[Link]
Posted Aug 4, 2014 0:09 UTC (Mon)
by pjm (guest, #2080)
[Link] (1 responses)
Posted Aug 17, 2014 11:49 UTC (Sun)
by eru (subscriber, #2753)
[Link]
Posted Aug 2, 2014 23:21 UTC (Sat)
by meyert (subscriber, #32097)
[Link] (1 responses)
Posted Aug 3, 2014 15:20 UTC (Sun)
by magcius (guest, #85280)
[Link]
Posted Aug 3, 2014 7:53 UTC (Sun)
by job (guest, #670)
[Link] (14 responses)
This sounds like what we want in theory, and will probably make it easier to write graphic drivers, but for now it is almost unusable in the Linux world. The only driver that is reasonably feature complete and only somewhat unstable is Intel, the other is absolute crap and does not seem to get better.
Is it going to get better, or will everyone have to switch to Intel? Where does that leave the professional 3D workstations?
Posted Aug 3, 2014 11:48 UTC (Sun)
by tao (subscriber, #17563)
[Link] (11 responses)
Posted Aug 12, 2014 12:22 UTC (Tue)
by nye (subscriber, #51576)
[Link] (10 responses)
They do use OpenGL, but with Nvidia's binary Xorg driver.
Posted Aug 12, 2014 12:49 UTC (Tue)
by tao (subscriber, #17563)
[Link] (9 responses)
Posted Aug 13, 2014 12:15 UTC (Wed)
by nye (subscriber, #51576)
[Link] (8 responses)
Posted Aug 13, 2014 17:57 UTC (Wed)
by tao (subscriber, #17563)
[Link] (7 responses)
The closed drivers are at the mercy of NVidia, ATI, etc.
If you expect to do things that requires getting the most out of the hardware, you'll need a drivers written will full specs available. That means either through NVidia/ATI releasing said specs, or writing the driver themselves.
It's reasonable to expect that Wayland/Xorg uses opengl in a sensible manner, it's reasonable to expect that the kernel provides a vendor neutral way to handle direct rendering, framebuffers, etc., but anything beyond that requires either extreme amounts of reverse engineering or vendor support. The former is a serious waste of time and is unlikely to happen except in situations when no options are supported. Since one vendor has fully working drivers (Intel) and one vendor is trying to catch up (ATI) it doesn't take a genius to realise that developers, when poked about NVidia issues, will tell you to buy other hardware or ask your vendor to provide docs or an updated driver.
So. If the open drivers are under-performing on your hardware, and it's hardware for which little or no documentation exists, either ask for an updated closed driver, or documentation to help the open driver along.
Posted Aug 14, 2014 9:07 UTC (Thu)
by etienne (guest, #25256)
[Link]
And if none is given by the company you gave money to, then stop giving them money, and tell it competitors you have cash available for the features you need.
Posted Aug 14, 2014 16:25 UTC (Thu)
by nye (subscriber, #51576)
[Link]
It's likely the case that the people most able to actually *alter* the answer to that question are Nvidia, because so much of the time it will hinge upon their drivers, but simply answering the question itself is a different matter, and it looks like the Wayland developers are probably in the best position to know - and based on magcius's comment, it appears that they do indeed know something.
Posted Aug 15, 2014 19:14 UTC (Fri)
by ThinkRob (guest, #64513)
[Link] (4 responses)
I'm not so sure you can use that excuse. AMD opened their card documentation seven years ago. The open drivers still suck. In that time, Intel's drivers have gone from complete crap to being the top of the open-source heap.
Posted Aug 17, 2014 11:14 UTC (Sun)
by mathstuf (subscriber, #69389)
[Link] (3 responses)
Posted Aug 24, 2014 21:41 UTC (Sun)
by ThinkRob (guest, #64513)
[Link]
Suck compared to the closed-source drivers on every other platform.
Posted Aug 24, 2014 21:50 UTC (Sun)
by mpr22 (subscriber, #60784)
[Link] (1 responses)
Posted Aug 25, 2014 19:54 UTC (Mon)
by mathstuf (subscriber, #69389)
[Link]
Posted Aug 3, 2014 15:23 UTC (Sun)
by magcius (guest, #85280)
[Link] (1 responses)
As for OpenGL support, nouveau and radeon are actually quite good now; they've improved somewhat considerably in the past year after power management aren't pegging the drivers at the lowest possible speed.
NVIDIA is working on Wayland support in their proprietary driver. I don't have anything I can share publicly yet, unfortunately.
Posted Aug 5, 2014 23:41 UTC (Tue)
by nix (subscriber, #2304)
[Link]
Posted Aug 6, 2014 9:06 UTC (Wed)
by moltonel (guest, #45207)
[Link] (2 responses)
Am I missing something here, does copy-paste depend on the window system for some feature or performance ? Or does Wayland handle clipboards just out of habit, or because it took less time to implement ?
Posted Aug 6, 2014 9:25 UTC (Wed)
by moltonel (guest, #45207)
[Link] (1 responses)
Posted Aug 6, 2014 20:04 UTC (Wed)
by magcius (guest, #85280)
[Link]
The linked comment doesn't make any sense, and we won't support a model like that. Copying a giant image file should not dump it out to disk when the application already has it in memory, and certainly not in every format that can be transferred up-front. That would completely sacrifice performance, especially because applications re-take the clipboard when selecting text.
Wayland in GNOME: two progress reports
Wayland in GNOME: two progress reports
Wayland in GNOME: two progress reports
One person asked how Wayland's isolation of a process's window contents would affect graphics applications like GIMP and Pitivi, which often have a color-picker tool that lets the user copy a pixel's RGB value.
Wayland in GNOME: two progress reports
Wayland in GNOME: two progress reports
If so, then also screen-sharing tools like Webex also become impossible to implement on top of Wayland. That would be a major loss, such tools are vital for teleconferencing. (Where I work, Webex is used so extensively that any OS that does not support it would be basically useless as the only desktop operating system.)
Wayland in GNOME: two progress reports
Wayland in GNOME: two progress reports
Wayland in GNOME: two progress reports
Wayland in GNOME: two progress reports
Wayland in GNOME: two progress reports
Wayland in GNOME: two progress reports
Wayland in GNOME: two progress reports
Wayland in GNOME: two progress reports
Wayland in GNOME: two progress reports
Wayland in GNOME: two progress reports
Wayland in GNOME: two progress reports
As I understand it, wayland allows for surfaces to be embedded/passed along to make better use of hardware rendering. If you can just grab/capture that surface and then look at that, than you would have your color value. The burden of handling all color schemes would than be a problem for the capturer, but it would prevent loss of information.
Wayland in GNOME: two progress reports
The details of implementation of the policy check is up to the compositor. It could well be desktop environment specific (or a Freedesktop standards proposal could be made, but that is outside of the Wayland scope). The only thing that the wayland protocol should specify is that such a policy might be in place and how a compositor should react if a policy is denied. (Should it be transparent to the requestor (empty buffer) or should it return a "access denied")
Wayland in GNOME: two progress reports
Wayland in GNOME: two progress reports
Wayland in GNOME: two progress reports
Wayland in GNOME: two progress reports
Wayland in GNOME: two progress reports
Wayland in GNOME: two progress reports
Wayland in GNOME: two progress reports
Wayland in GNOME: two progress reports
Wayland in GNOME: two progress reports
Wayland in GNOME: two progress reports
Wayland in GNOME: two progress reports
Wayland in GNOME: two progress reports
Wayland in GNOME: two progress reports
Wayland in GNOME: two progress reports
screenshot-like needs
Also collaboration tools that do screen sharing, like Webex.
screenshot-like needs
Wayland in GNOME: two progress reports
Wayland in GNOME: two progress reports
Wayland in GNOME: two progress reports
Wayland in GNOME: two progress reports
Wayland in GNOME: two progress reports
Wayland in GNOME: two progress reports
Wayland in GNOME: two progress reports
Wayland in GNOME: two progress reports
Wayland in GNOME: two progress reports
Basically vote with your wallet, and be consistent.
Wayland in GNOME: two progress reports
Wayland in GNOME: two progress reports
Wayland in GNOME: two progress reports
Wayland in GNOME: two progress reports
I find that the free driver for AMD parts renders the games I want to play both slowly and incorrectly, while the proprietary driver renders them correctly and at an acceptable frame rate.
Wayland in GNOME: two progress reports
Wayland in GNOME: two progress reports
Wayland in GNOME: two progress reports
Wayland in GNOME: two progress reports
Clipboard as a window system feature ?
Clipboard as a window system feature ?
Clipboard as a window system feature ?