Beispiel #1
0
def get_display_manager():
    """Return the appropriate display manager instance.
    Defaults to Mutter if available. This is the only one to support Wayland.
    """
    try:
        return MutterDisplayManager()
    except DBusException as ex:
        logger.debug("Mutter DBus service not reachable: %s", ex)
    except Exception as ex:  # pylint: disable=broad-except
        logger.exception("Failed to instanciate MutterDisplayConfig. Please report with exception: %s", ex)
    try:
        return DisplayManager()
    except (GLib.Error, NoScreenDetected):
        return LegacyDisplayManager()
Beispiel #2
0
def get_display_manager():
    """Return the appropriate display manager instance.
    Defaults to Mutter if available. This is the only one to support Wayland.
    """
    if DBUS_AVAILABLE:
        try:
            return MutterDisplayManager()
        except DBusException as ex:
            logger.debug("Mutter DBus service not reachable: %s", ex)
        except Exception as ex:  # pylint: disable=broad-except
            logger.exception("Failed to instanciate MutterDisplayConfig. Please report with exception: %s", ex)
    else:
        logger.error("DBus is not available, lutris was not properly installed.")
    if LIB_GNOME_DESKTOP_AVAILABLE:
        try:
            return DisplayManager()
        except (GLib.Error, NoScreenDetected):
            pass
    return LegacyDisplayManager()
Beispiel #3
0
        primary display or a list of configurations as returned by `get_config`.
        This method uses XrandR and will not work on Wayland.
        """
        return change_resolution(resolution)

    @staticmethod
    def get_config():
        """Return the current display resolution
        This method uses XrandR and will not work on wayland
        The output can be fed in `set_resolution`
        """
        return get_outputs()


try:
    DISPLAY_MANAGER = MutterDisplayManager()
except Exception as ex:
    logger.exception(
        "Failed to instanciate MutterDisplayConfig. Please report with exception: %s",
        ex)
    try:
        DISPLAY_MANAGER = DisplayManager()
    except (GLib.Error, NoScreenDetected):
        DISPLAY_MANAGER = LegacyDisplayManager()

USE_DRI_PRIME = len(_get_graphics_adapters()) > 1


def get_compositor_commands():
    """Nominated for the worst function in lutris"""
    start_compositor = None