diff --git a/umu/umu_run.py b/umu/umu_run.py index 3410567d5..960eb838a 100755 --- a/umu/umu_run.py +++ b/umu/umu_run.py @@ -588,19 +588,18 @@ def monitor_baselayer( while True: event: Event = d_primary.next_event() + prop: GetProperty | None = None - # Check if the layer sequence has changed to the broken one if event.type == X.PropertyNotify and event.atom == atom: - prop: GetProperty | None = root_primary.get_full_property( - atom, Xatom.CARDINAL - ) + prop = root_primary.get_full_property(atom, Xatom.CARDINAL) - if prop and prop.value == gamescope_baselayer_sequence: - log.debug("Broken base layer sequence detected") - log.debug("Property value for atom '%s': %s", atom, prop.value) - rearranged, _ = rearrange_gamescope_baselayer_order(prop.value) - set_gamescope_baselayer_order(d_primary, rearranged) - continue + # Check if the layer sequence has changed to the broken one + if prop and prop.value == gamescope_baselayer_sequence: + log.debug("Broken base layer sequence detected") + log.debug("Property value for atom '%s': %s", atom, prop.value) + rearranged, _ = rearrange_gamescope_baselayer_order(prop.value) + set_gamescope_baselayer_order(d_primary, rearranged) + continue time.sleep(0.1)