Skip to content

Bug: Rift doesn't respect focus-change with mouse #399

Description

@hajiboy95

Bug Description

When changing window focus using the mouse by clicking a window, Rift's layout engine selection does not update to match the active window.

Consequently, when a layout mutation shortcut is triggered (such as MoveNode, SwapWindows, or PromoteToMaster), the layout command operates on the last window focused via keyboard shortcuts, rather than the window currently focused by the mouse.

Steps to Reproduce

This works the best with the stack-layout since here it's obvious which window is holding the focus

  1. Focus Window A using a keyboard shortcut (e.g. FocusWindow).
  2. Move the mouse to Window B and click it. Window B is now physically focused and active.
  3. Press a layout movement shortcut (e.g., MoveNode or SwapWindows).
  4. Observe: Window A (the last keyboard-focused window) is moved instead of Window B. In some configurations, focus may also forcibly snap back to Window A.

Desired Solution

  • Synchronize Selection on Focus Change: Ensure that any change in window focus (including mouse clicks and hover events) immediately updates the layout engine's selection state (select_window in the active workspace tree).
  • Robust Target Resolution: When executing a layout command, the layout engine should verify and resolve the target window using the actual active window or the window physically under the cursor, keeping the focus and layout state in sync.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions