예제 #1
0
파일: display.py 프로젝트: djibux/lutris
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()
예제 #2
0
파일: display.py 프로젝트: akapps/lutris
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()
예제 #3
0
파일: display.py 프로젝트: simonsan/lutris
        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
    stop_compositor = None
    desktop_session = os.environ.get("DESKTOP_SESSION")
    if desktop_session == "plasma":
        stop_compositor = (
            "qdbus org.kde.KWin /Compositor org.kde.kwin.Compositing.suspend")
        start_compositor = (
            "qdbus org.kde.KWin /Compositor org.kde.kwin.Compositing.resume")
    elif (desktop_session == "mate"