Skip to content

Commit f522412

Browse files
amartya4256HeikoKlare
authored andcommitted
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 209d75a commit f522412

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
@@ -1101,6 +1101,16 @@ int handleGotFocus(long pView, long pArg) {
11011101
// calls in #browserFocusIn(Event).
11021102
ignoreFocus = true;
11031103
OS.SendMessage (browser.handle, OS.WM_SETFOCUS, 0, 0);
1104+
1105+
Event newEvent = new Event();
1106+
newEvent.widget = browser;
1107+
Point position = browser.getDisplay().getCursorLocation(); // To Points
1108+
position = browser.getDisplay().map(null, browser, position);
1109+
newEvent.x = position.x;
1110+
newEvent.y = position.y;
1111+
newEvent.type = SWT.FocusIn;
1112+
browser.notifyListeners(newEvent.type, newEvent);
1113+
11041114
ignoreFocus = false;
11051115
return COM.S_OK;
11061116
}

0 commit comments

Comments
 (0)