Skip to content

Edge: Focus jumps back to browser control when trying to leave #1848

@sratz

Description

@sratz

To Reproduce

  • Start with a simple eclipse installation (e.g. platform runtime binary)
  • Close welcome page
  • Open 'Internal Web Browser' view and move it to the editor area
  • Create a dummy project with a dummyFile.txt
  • Open that file
  • Switch to the browser tab
  • Press Ctrl-E -> switch to dummyFile.txt
  • Editor tab jumps to dummyFile.txt
  • Editor tab immediately jumps back to Browser

Screenshots

Image

Environment:

  1. Select the platform(s) on which the behavior is seen:
    • All OS
    • Windows
    • Linux
    • macOS

Workaround (or) Additional context
The are much more situations where this occurs. The Ctrl-E is just a very easy one to reproduce.

The problem is the following:

  • When the Ctrl-E popup closes, focus is returned to SWT-Edge and we receive an SWT.FocusIn event (Edge.browserFocusIn(Event)).
  • We also need to inform WebView2 of this fact and call controller.MoveFocus(COM.COREWEBVIEW2_MOVE_FOCUS_REASON_PROGRAMMATIC);
  • SWT switches to another editor
  • -----async----
  • Now, with an async delay, WebView2 informs us again in handleGotFocus that it has received focus.
  • We move focus to SWT-Browser again, even though this event is now obsolete

Metadata

Metadata

Assignees

No one assigned

    Labels

    edgeEdge Browser

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions