Skip to content

Commit

Permalink
Edge: Disable the internal status bar to align with other Browser impls
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sratz committed Oct 3, 2024
1 parent 4ea366e commit 8056739
Showing 1 changed file with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,13 @@ void setupBrowser(int hr, long pv) {
webView.get_Settings(ppv);
settings = new ICoreWebView2Settings(ppv[0]);

if (webViewProvider.isWebView_12Available()) {
// Align with other Browser implementations:
// Disable internal status bar on the bottom left of the Browser control
// Send out StatusTextEvents via handleStatusBarTextChanged for SWT consumers
settings.put_IsStatusBarEnabled(false);
}

long[] token = new long[1];
IUnknown handler;
handler = newCallback(this::handleCloseRequested);
Expand Down Expand Up @@ -900,12 +907,12 @@ int handleStatusBarTextChanged(long pView, long pArgs) {
long ppsz[] = new long[1];
webViewProvider.getWebView_12(true).get_StatusBarText(ppsz);
String text = wstrToString(ppsz[0], true);
StatusTextEvent newEvent5 = new StatusTextEvent(browser);
newEvent5.display = browser.getDisplay();
newEvent5.widget = browser;
newEvent5.text = text;
StatusTextEvent statusTextEvent = new StatusTextEvent(browser);
statusTextEvent.display = browser.getDisplay();
statusTextEvent.widget = browser;
statusTextEvent.text = text;
for (StatusTextListener statusTextListener : statusTextListeners) {
statusTextListener.changed(newEvent5);
statusTextListener.changed(statusTextEvent);
}
return COM.S_OK;
}
Expand Down

0 comments on commit 8056739

Please sign in to comment.