Skip to content

Commit 8056739

Browse files
committed
Edge: Disable the internal status bar to align with other Browser impls
Only disable this if ICoreWebView2_12 is available and we can send out proper StatusTextEvents. If not (unlikely case, very old WebView2 version) we keep the internal status bar enabled.
1 parent 4ea366e commit 8056739

File tree

1 file changed

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

1 file changed

+12
-5
lines changed

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

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,13 @@ void setupBrowser(int hr, long pv) {
540540
webView.get_Settings(ppv);
541541
settings = new ICoreWebView2Settings(ppv[0]);
542542

543+
if (webViewProvider.isWebView_12Available()) {
544+
// Align with other Browser implementations:
545+
// Disable internal status bar on the bottom left of the Browser control
546+
// Send out StatusTextEvents via handleStatusBarTextChanged for SWT consumers
547+
settings.put_IsStatusBarEnabled(false);
548+
}
549+
543550
long[] token = new long[1];
544551
IUnknown handler;
545552
handler = newCallback(this::handleCloseRequested);
@@ -900,12 +907,12 @@ int handleStatusBarTextChanged(long pView, long pArgs) {
900907
long ppsz[] = new long[1];
901908
webViewProvider.getWebView_12(true).get_StatusBarText(ppsz);
902909
String text = wstrToString(ppsz[0], true);
903-
StatusTextEvent newEvent5 = new StatusTextEvent(browser);
904-
newEvent5.display = browser.getDisplay();
905-
newEvent5.widget = browser;
906-
newEvent5.text = text;
910+
StatusTextEvent statusTextEvent = new StatusTextEvent(browser);
911+
statusTextEvent.display = browser.getDisplay();
912+
statusTextEvent.widget = browser;
913+
statusTextEvent.text = text;
907914
for (StatusTextListener statusTextListener : statusTextListeners) {
908-
statusTextListener.changed(newEvent5);
915+
statusTextListener.changed(statusTextEvent);
909916
}
910917
return COM.S_OK;
911918
}

0 commit comments

Comments
 (0)