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()
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()
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"