Skip to content

Fail loudly when a focus backend's enumeration API is missing #128

Description

@jonocodes

Context

The GNOME focus extension's ListWindows() guards the enumeration call with a ternary:

const actors = typeof global.get_window_actors === "function"
  ? global.get_window_actors()
  : (typeof global.display.get_window_actors === "function"
      ? global.display.get_window_actors()
      : []);

The final : [] fallback is exactly what hid the stage-2 (#126) bug fixed in e166242: the code called the method on the wrong receiver (global.display instead of global), the guard swallowed the missing method, and ListWindows silently returned [] on every real GNOME 50 session. The running-windows list showed "no running programs" and looked like an honest empty state rather than a broken API call.

Ask

Decide whether a missing enumeration API should fail loudly instead of degrading to an empty list. Options:

  • Keep the empty-list fallback but log() a one-time warning when neither global.get_window_actors nor global.display.get_window_actors is a function, so the journal shows the API drift.
  • Or drop the silent fallback entirely and let the method throw (the daemon's watch_windows already logs gdbus failures at debug and sleeps through them — a thrown error there is visible, an empty list is not).

The distinction matters: "no windows open" and "the enumeration API moved" are different states that today look identical to the user.

Discovered while verifying #127.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestfocus-watcherActive-window / app-awareness detectionhuman-verification-requiredCode is complete; a human must verify on real hardware / a live session before closing

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions