From 9348d87b922e2902db6b986a99689942a8ba3bd6 Mon Sep 17 00:00:00 2001 From: R1kaB3rN <100738684+R1kaB3rN@users.noreply.github.com> Date: Tue, 7 Jan 2025 12:14:23 -0800 Subject: [PATCH] refactor: remove assignment of u32 array conversion - The python-xlib doesn't provide a typeshed, and the type returned from Window.get_full_property has already been observed. The assignment was just to workaround mypy's strictness --- umu/umu_run.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/umu/umu_run.py b/umu/umu_run.py index 4037c577b..9cb7c2645 100755 --- a/umu/umu_run.py +++ b/umu/umu_run.py @@ -408,7 +408,6 @@ def get_gamescope_baselayer_appid( ) -> list[int] | None: """Get the GAMESCOPECTRL_BASELAYER_APPID value on the primary root window.""" try: - baselayer_appid: list[int] root_primary: Window = d.screen().root # Intern the atom for GAMESCOPECTRL_BASELAYER_APPID atom = d.get_atom(GamescopeAtom.BaselayerAppId.value) @@ -416,9 +415,8 @@ def get_gamescope_baselayer_appid( prop: GetProperty | None = root_primary.get_full_property(atom, Xatom.CARDINAL) # For GAMESCOPECTRL_BASELAYER_APPID, the value is a u32 array if prop and prop.value and isinstance(prop.value, array): - # Convert data to a Python list for safety - baselayer_appid = prop.value.tolist() - return baselayer_appid + # Ignore. Converting a u32 array to a list creates a list[int] + return prop.value.tolist() # type: ignore log.debug("%s property not found", GamescopeAtom.BaselayerAppId.value) except Exception as e: log.error("Error getting %s property", GamescopeAtom.BaselayerAppId.value)