Skip to content

Focusing the native window should trigger a focus event #9482

Closed

Description

@paulrouget

Some notes:

In ports/glutin/window.rs, along events like Event::Closed, we should handle the Event::Focused(focused) event and forward it to script_thread / document.

Once there, I'm not sure exactly what should be done. There is already a focus-handling mechanism at the document level (*_focus_transaction), but events are not dispatched as per

// TODO: dispatch blur, focus, focusout, and focusin events

At the compositor level, focus_parent_pipeline ensures that the chain of iframes are properly focused. But I don't see where iframes are unfocused.

On blur then focus, we might want to save self.focus_pipeline_id, unfocus all the iframes, and when focus comes back, focus the previous saved pipeline.

I'm also not sure how to deal with the script thread requesting focus while the native window is not focused.

Activity

  1. added
    A-content/dom
    on Feb 1, 2016
  2. added a commit that references this issue on Sep 25, 2026
    15aa067
  3. added a commit that references this issue on Oct 6, 2026
    f511f69
  4. added a commit that references this issue on Oct 12, 2026
    ed61a98
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-content/domA-gfx/compositing

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions