Resolución de los Problemas en Wayland

Kparal Version unspecified Last review: 2017

Esta página ha sido convertida automáticamente desde Wiki.

Se ha limpiado para publicarlo aquí en el Portal Fedora Docs, pero todavía no se ha revisado su precisión técnica.

Probablemente está

  • Mal formateada

  • Con gráficos y tablas perdidas que no se convierten bien desde mediawiki

  • Desactualizada

  • En necesidad de otro amor

Las revisiones para precisiones técnica son muy apreciadas. Si desea ayuda vea el archivo README en el repositorio fuente para encontrar instrucciones.

Solicitudes de extracción aceptadas en https://pagure.io/fedora-docs/quick-docs

Una vez haya corregido esta página, borre este anuncio.

Wayland está pensado como un reemplazo más sencillo para X11. Wayland cambia el diseño de la arquitectura de un escritorio Linux considerablemente. A diferencia de X11, no hay un servidor independiente dedicado en Wayland. Lo que se hacia anteriormente entre la aplicación, su kit de herramientas, el Xserver y el administrador de ventanas ahora se comparte entre la aplicación, su kit de herramientas y el compositor Wayland que maneja la composición, la entrada, la administración de ventanas, etc. Las aplicaciones y los kits de herramientas están ahora a cargo de su propia renderización y composición (decoraciones en el lado cliente), por lo que cualquier problema generalmente se ubica entre el kit de herramientas (por ejemplo GTK+) y el compositor Wayland (por ejemplo mutter).

Puede leer más sobre Wayland en GNOME en la página wiki iniciativa Wayland. Puede leer más sobre el estado actual de las funciones de Wayland en la página funciones de Wayland.

Identificar problemas de Wayland

¿Está ejecutando una sesión Wayland?

En GNOME, hay un botón dentado en la pantalla de acceso que se puede usar para una sesión Wayland (simplemente llamada GNOME, es la opción predeterminada) o una sesión heredada X11 (llamada GNOME on Xorg). Si usted tiene una cuenta de usuario sin contraseña, no verá el icono dentado, se muestra solo cuando aparece el indicador de contraseña. Use el botón dentado para determinar el tipo de sesión a la que está accediendo. Si desea iniciar su sesión de una manera diferente, lea las técnicas avanzadas para probar con Wayland.

gdm-pick-wayland.png

En KDE, hay soporte para ejecutar una sesión Wayland anidada dentro de su sesión X11. Necesitará instalar el paquete kwin-wayland y continuar con este como lo hago. No parece haber soporte listo para ejecutar una sesión completa de Wayland en este momento.

Otros entornos de escritorio no son estos momentos capaces de ejecutar una sesión Wayland.

Identificar el tipo de sesión en tiempo de ejecución

Si desea averiguar que tipo de sesión está ejecutando en este momento, sin salir de la sesión y volver a entrar otra vez, puede usar diversas maneras para averiguarlo:

  • La sesión Wayland debería tener la variable WAYLAND_DISPLAY establecida, la sesión X11 no debería tenerla:

    $ echo $WAYLAND_DISPLAY
    wayland-0
  • loginctl puede darle esta información. Primero ejecute loginctl y encuentre su número de sesión (debe ser un número entero, con su nombre de usuario y asiento asignado). Después busque el tipo de sesión (x11 o wayland):

    $ loginctl show-session <YOUR_NUMBER> -p Type
    Type=x11

Si está ejecutando una sesión X11, no una sesión Wayland, sus problemas no están relacionados con Wayland. Es un error o de la aplicación concreta o del mismo X11, vea Como depurar problemas Xorg.

¿Su aplicación se ejecuta sobre Wayland de forma nativa o usa XWayland (capa de compatibilidad X11)?

Es importante saber si la aplicación problemática es una aplicación nativa Wayland o se ejecuta a través de XWayland, lo que permite que las aplicaciones heredadas aún se ejecuten en el servidor Xorg, pero se muestren en una sesión Wayland.

Hay diversas maneras de identificar si una aplicación está usando Wayland o XWayland:

  • Seleccione la ventana usando xwininfo o xprop. Ejecute:

    $ xwininfo

    El puntero de su ratón cambiará a una cruz bajo X11, no parece cambiar bajo Wayland. Ahora pulse en cualquier lugar dentro de la ventana de la aplicación que desea probar. Si el comando xwininfo termina (debería imprimir las propiedades de la ventana en el terminal), la aplicación bajo prueba se está ejecutando bajo XWayland. Si no sucede nada (el comando xwininfo está todavía esperando hasta que seleccione una ventana), la aplicación en prueba está corriendo bajo Wayland (puede cerrar el comando con Ctrl+C). También puede usar el comando xprop usando las mismas instrucciones.

  • Las aplicaciones XWayland se listan en la salida de xlsclients. Ejecute:

    $ xlsclients

    Sin embargo, esta lista no es siempre del todo confiable, es posible que falten algunas aplicaciones.

  • Puede intentar ejecutar la aplicación mientras desactiva la variable de entorno DISPLAY:

    $ DISPLAY='' command

    Si la aplicación corre OK, debería estar usando Wayland de forma nativa.

  • Puede ejecutar la aplicación con la variable de entorno WAYLAND_DEBUG=1:

    $ WAYLAND_DEBUG=1 command

    Si ve muchos resultados (en comparación con la ejecución estándar), la aplicación está usando Wayland de forma nativa.

  • Bajo GNOME, puede determinar esto usando la herramienta integrada Looking Glass. Pulse Alt+F2, ejecute:

    lg

    pulse en Windows en la esquina superior derecha de la herramienta y seleccione la ventana deseada pulsando en su nombre. Si ve MetaWindowWayland en la primera línea, esta aplicación está corriendo bajo Wayland. Si ve MetaWindowX11 en la primera línea, esta aplicación está corriendo bajo X11.

Si ha identificado que el problema está en una aplicación XWayland, intente reproducir el problema en una sesión estándar X11. Sí sucede también, no está relacionado con Wayland, es un error o bien de la aplicación concreta o del servidor Xorg, vea Como depurar problemas Xorg. Si el problema sucede solo bajo XWayland pero no en una sesión X11, aún debería informarse contra el servidor Xorg (paquete), puesto que XWayland está incluido en él (como subpaquete xorg-x11-server-Xwayland).

Identificar el componente del problema

Wayland es un protocolo y el problema está raramente en el protocolo mismo. Más bien, es probable que el problema esté en la aplicación, en su conjunto de herramientas o en el compositor.

Los conjuntos de herramientas más notables listos para Wayland son:

  • GTK+ 3 – las aplicaciones predeterminadas en el entorno de GNOME usan casi exclusivamente este conjunto de herramientas. Tenga en cuenta que las aplicaciones que utilizan el más antiguo GTK+ 2 no están preparadas para Wayland.

  • QT 5 – muchas aplicaciones en el entorno KDE utilizan este conjunto de herramientas. Tenga en cuenta que las aplicaciones que utilizan el más antiguo QT 4 no están preparadas para Wayland.

Los compositores Wayland más notables son:

  • Weston

    • la implementación de referencia de un compositor Wayland, mantenido directamente por el proyecto Wayland

  • Mutter - compositor en GNOME. Si está corriendo GNOME, está usando este compositor.

  • Kwin - compositor en KDE. Si está corriendo KDE, está usando este compositor.

Probar bajo diferentes compositores

Si sufre un problema con una aplicación Wayland, es muy útil saber si el problema está presente bajo un único compositor (en este caso es probable que sea un error del compositor) o bajo múltiples compositores (en este caso es probable un error en la aplicación/conjunto de herramientas).

Ejecute su sesión con la referencia del compositor Weston e intente reproducir el problema. Puede ejecutar Weston como una ventana anidada o como una sesión completa. Primero, instale el paquete (puede leer mucha información útil en su página de manual):

$ sudo dnf install weston

Después cree un archivo de configuración que especificará que desea tener soporte XWayland en sus sesiones weston. Cree ~/.config/weston.ini con estos contenidos:

[core] + xwayland=true

Ahora puede iniciar weston como ventana anidada o como sesión completa.

  • Para iniciar una ventana anidada Weston, ejecute esto desde un terminal:

    $ weston

    Debería abrirse una ventana de Weston y debería ver un icono de terminal en la esquina superior izquierda. Use este icono para lanzar un terminal desde el que puede ejecutar la aplicación y otros comandos usando Weston. Salga del compositor simplemente cerrando la ventana o matando el proceso weston.

  • Para iniciar una sesión total Weston (no anidada dentro de otra sesión X11 o Wayland), conmute a un VT libre (Ctrl+Alt+Fx) y ejecute:

    $ weston-launch

    You can exit the session by pressing Control+Alt+Backspace shortcut.

If you can reproduce the issue with Weston, file an issue against the app or its toolkit (gtk+, qt, etc). Otherwise file the issue against the compositor your environment uses (mutter, kwin, etc). If the problem occurs only with XWayland apps but not native Wayland apps, report a bug against Xorg server.

Reporting the issue

Using up-to-date software

Before reporting the bug, please make sure you use the latest available software. Make sure there are no system updates waiting:

$ sudo dnf update

If there are (and the available updates look plausibly related to the components you’re seeing issues with), please update the system and verify whether the issue is still present or has been fixed.

Filing a bug

After you’ve identified against which component to (most probably) report the issue and found no existing report of it, there are several places where to report it:

  • Red Hat Bugzilla - recommended for issues related to wayland itself, weston compositor, non-GNOME apps, KDE project, QT toolkit

  • GNOME Bugzilla - recommended for issues related to mutter compositor, GTK+ toolkit, applications under the GNOME project (most of default apps in Fedora Workstation)

When reporting the issue, please make your report block our tracker, so that we have a good overall picture of what is broken across many different components. In your bug report, set Blocks: WaylandRelated or Blocks: KDEWaylandRelated (you might need to toggle showing advanced fields to see the Blocks: field). That will make it block one of these trackers, depending where you reported the bug:

Information to include in your bug report

  1. System journal. Since there is no unique server like the X11 server, most of the important information will come from the the Wayland compositor and the apps. All of that should be in system journal nowadays. You can save a full journal since last boot like this:

    $ journalctl -ab > journal.log

    You can also edit the file and according to the timestamps remove everything long prior to when the issue occurred, in order to make the log more succinct. * If your system crashed or became unresponsive so that you had to reboot it, you can see the journal from the previous boot using journalctl -a -b -1 instead.

  2. Wayland debug output. If you can reproduce the issue, please run the problematic app like this:

    $ WAYLAND_DEBUG=1 command |& tee debug.out

    You should see loads of output being printed out. It will involve all communication between the app and the compositor.

  3. Information whether the same problem occurs when you run the app using XWayland instead of Wayland. For GTK+ 3 apps, you can force a native Wayland app to run using XWayland like this:

    $ GDK_BACKEND=x11 command

    Vice versa, you can also force a XWayland app to run using Wayland (in case it has just experimental support):

    $ GDK_BACKEND=wayland command

    QT 5 apps run with XWayland by default. You can force Wayland backend:

    $ QT_QPA_PLATFORM=wayland-egl command

    All of this applies to just GTK+ 3 and QT 5 apps.

  4. Hardware description is useful for some hardware-related bugs:

    $ lspci -nn > lspci.out
  5. Package versions. You can collect the list and versions of all your packages installed using:

    $ rpm -qa | sort > packages.out
  6. The usual information that every bug report should have.

Debugging gnome-shell

If gnome-shell gets stuck and unresponsive, it’s very helpful to obtain a backtrace from its process and attach it to the report. If this happens, switch to a different VT if possible (Ctrl+Alt+F3 through F7), or log in using ssh. First install debug symbols:

$ sudo dnf debuginfo-install `rpm -q gnome-shell`

Then attach gdb debugger to your gnome-shell process:

$ gdb -p `pgrep -U $(id -un) -x gnome-shell`
...
(gdb) set logging on
(gdb) thread apply all backtrace full
... press Enter until the whole backtrace is displayed ...
(gdb) quit

You should have the backtrace saved in gdb.txt file.

Debugging mutter

You can debug mutter (used in gnome-shell) by setting its environment variables. These need to be set prior to run gnome-shell, so if you want to log into GNOME from GDM, you need to create a wrapper script called from a desktop file in /usr/share/wayland-sessions.

FIXME: Putting the wrapper script and desktop file here would be helpful.

Known issues, frequent complaints, fundamental changes

Here we will list high-profile issues which are known to be broken, not yet implemented, or intentionally behaving differently from regular X11 apps. Also please look at Wayland features which lists all current missing or in-progress features and their details.

To see all known issues, look at Bugzilla reports as mentioned in Looking for similar reports.

Graphical applications can’t be run as root from terminal

It is not possible to start graphical apps under the root account from terminal when using su or sudo. Apps which use polkit to request administrator permissions for just certain operations and only when needed are not affected (they are not started as root right away). The discussion is ongoing about the best approach to take, see bug 1274451 and "On running gui applications as root" thread in fedora-devel mailing list.

Many well-known X11 utilities don’t work

Power users are familiar with a large range of X11-related utilities, like xkill, xrandr, xdotool, xsel. These tools won’t work under Wayland session, or will only work with XWayland applications but not Wayland applications. Some tools might have a replacement which allows to perform similar tasks.

FIXME: add some Wayland-ready replacements for popular X11 tools

Games and other apps can’t change monitor resolution

It is no longer possible for an app to change monitor resolution. Usually this was done by games to increase performance. Wayland-based games will use a different approach - scaling its output. But for X11 games (running through XWayland) this solution is not available. This results in a number of different types of behavior, based on how the game is written - the game might be fixed in the desktop resolution, or rendered as a small centered image with black bars around it, or crash on startup, or something different. See bug 1289714.

For some games, a possible workaround is to manually set custom monitor resolution before running the game, if you really need it. It will not help always, though.

Screen capture is not available with usual apps

One of the features of Wayland is its security design, which helps to guard the user against malicious apps. Apps can no longer see everything on the screen and spy on you. But that also means you cannot run a common application (like shutter or gtk-recordmydesktop) and use it to make a screenshot or a screencast of your desktop - it will see only its own window, but nothing else (or it might crash right away). System (trusted) apps need to be used to perform these actions.

In GNOME, you can use Screenshot tool (available in overview or as Printscreen hotkey or as gnome-screenshot command) to capture a screenshot of the full desktop or a particular window. You can press Ctrl+Alt+Shift+R keyboard shortcut to start video recording of the whole desktop (stop it by pressing the same shortcut again, there’s an indicator in the upper right corner, or it stops automatically after 30 seconds by default) and find the screencast in ~/Videos. For screencast, you can also use EasyScreenCast gnome-shell extension.

Mouse pointer is lagging/stuttering under load

If your computer is under load, your mouse pointer movement might stop being fluent, but start lagging (get stuck in a place for a short time, then jump to a different place instantly). This is probably more noticeable on slow systems/systems with fewer CPU cores. See bug 745032.

Keyboard events are sometimes quickly repeated

There is a rare issue when you press a key to type a letter and you’ll see multiple copies of the letter typed in. See bug 757942 and bug 777693.

Not all keys can be sent to a remote desktop or a virtual machine

Some applications forward all input, including system-specific keys/shortcuts like or , to a remote system. This is mostly remote desktop viewers like vncviewer or virtual machine managers like virt-manager or boxes. Under Wayland, some of these shortcuts can’t be intercepted, and therefore are used in the host system, not the remote/guest system. See bug 1285770.