Skip to content
  • Olivier Fourdan's avatar
    xwayland: Check X11 clients prior to terminate Xwayland · e5347af0
    Olivier Fourdan authored
    Currently, mutter checks for the presence of X11 windows to decide
    whether or not Xwayland can be terminated, when Xwayland is started on
    demand.
    
    Unfortunately, not all X11 clients will map a window all the time, an
    X11 client may keep the X11 connection opened after closing all its
    windows. In that case, we may terminate Xwayland while there are some
    X11 client connected still, and terminating Xwayland will also kill
    those X11 clients.
    
    To avoid that issue, check the X11 clients actually connected using the
    XRes extension. The XRes extension provides the PID of the (local) X11
    clients connected to the Xserver, so we need to match that against the
    actual executable names, and compare with a list of known executables
    that we can safely ignore, such as ibus-x11 or gsd-xsettings.
    
    We also check against our own executable name, considering that the X11
    window manager is also an X11 client connected to the Xserver.
    
    Also, XRes returning the PID of local ...
    e5347af0