Skip to content

Commit

Permalink
refactor: prefer flat conditionals in monitor_baselayer
Browse files Browse the repository at this point in the history
  • Loading branch information
R1kaB3rN committed Aug 10, 2024
1 parent babc721 commit 74656e9
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions umu/umu_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 74656e9

Please sign in to comment.