Skip to content

Commit 641c477

Browse files
committed
Trigger FocusIn event on Edge Browser focus
This update ensures that the Edge browser triggers a FocusIn event for its listeners whenever the WebView gains focus. contributes to #212
1 parent ff514e8 commit 641c477

File tree

1 file changed

+10
-0
lines changed
  • bundles/org.eclipse.swt/Eclipse SWT Browser/win32/org/eclipse/swt/browser

1 file changed

+10
-0
lines changed

bundles/org.eclipse.swt/Eclipse SWT Browser/win32/org/eclipse/swt/browser/Edge.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1082,6 +1082,16 @@ int handleGotFocus(long pView, long pArg) {
10821082
// calls in #browserFocusIn(Event).
10831083
ignoreFocus = true;
10841084
OS.SendMessage (browser.handle, OS.WM_SETFOCUS, 0, 0);
1085+
1086+
Event newEvent = new Event();
1087+
newEvent.widget = browser;
1088+
Point position = browser.getDisplay().getCursorLocation(); // To Points
1089+
position = browser.getDisplay().map(null, browser, position);
1090+
newEvent.x = position.x;
1091+
newEvent.y = position.y;
1092+
newEvent.type = SWT.FocusIn;
1093+
browser.notifyListeners(newEvent.type, newEvent);
1094+
10851095
ignoreFocus = false;
10861096
return COM.S_OK;
10871097
}

0 commit comments

Comments
 (0)