Skip to content

Conversation

@tobiasmelcher
Copy link
Contributor

If keydown events for Command +/= or Command - are not consumed by any event handler, invoke the native methods makeTextLarger or makeTextSmaller on the WebKit control to provide zooming functionality on macOS.

#3036

@BeckerWdf
Copy link
Member

Would a similar change also work for webkit on linux?

And if I understand it correctly, this does not zoom the web page but "only" increases the font - icon etc. stay unchanged.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 3, 2026

Test Results (macos)

   54 files     54 suites   7m 56s ⏱️
4 527 tests 4 284 ✅ 243 💤 0 ❌
  104 runs    104 ✅   0 💤 0 ❌

Results for commit 574552f.

♻️ This comment has been updated with latest results.

@tobiasmelcher
Copy link
Contributor Author

Would a similar change also work for webkit on linux?

And if I understand it correctly, this does not zoom the web page but "only" increases the font - icon etc. stay unchanged.

The current changes are only in the cocoa part for MacOS. Support for linux need to be done separatly; I don't know and have not checked if the linux webkit implementation also supports these two methods.

Yes, the native calls makeTextLarger/makeTextSmaller only change the font size, not the icons. The benefit from this solution is that it doesn't require javascript and works also for the scenario when Javascript is explictly disabled in the Browser control like in the Java Element Info.

@tobiasmelcher
Copy link
Contributor Author

https://webkitgtk.org/reference/webkit2gtk/2.36.5/WebKitWebView.html#webkit-web-view-set-zoom-level
Webkit GTK seems to have a setZoomLevel function.

@sratz
Copy link
Member

sratz commented Feb 3, 2026

https://webkitgtk.org/reference/webkit2gtk/2.36.5/WebKitWebView.html#webkit-web-view-set-zoom-level
Webkit GTK seems to have a setZoomLevel function.

I don't see any equivalent API on cocoa, at least not for the legacy API that SWT uses:
https://developer.apple.com/documentation/webkit/deprecated-symbols?language=objc

For the newer API there is something:
https://developer.apple.com/documentation/webkit/wkwebview/pagezoom?language=objc

@tobiasmelcher
Copy link
Contributor Author

https://webkitgtk.org/reference/webkit2gtk/2.36.5/WebKitWebView.html#webkit-web-view-set-zoom-level
Webkit GTK seems to have a setZoomLevel function.

I don't see any equivalent API on cocoa, at least not for the legacy API that SWT uses: https://developer.apple.com/documentation/webkit/deprecated-symbols?language=objc

For the newer API there is something: https://developer.apple.com/documentation/webkit/wkwebview/pagezoom?language=objc

I first tried the new WKWebView API for pagezoom and it simply didn't work. I also then found out that Eclipse uses the old deprecated API https://developer.apple.com/documentation/webkit/webview-swift.class?language=objc . Let's hope that Apple will not delete this API. I see the need that we will switch to the new WKWebView API.

@merks
Copy link
Contributor

merks commented Feb 9, 2026

Don't ever merge. Only rebase. I don't think we even can accept PRs with merges.

@tobiasmelcher
Copy link
Contributor Author

Don't ever merge. Only rebase. I don't think we even can accept PRs with merges.

I clicked the "Update Branch" button in the github UI - big mistake - why is the button visible?

If keydown events for Command +/= or Command - are not consumed by any
event handler, invoke the native methods `makeTextLarger` or
`makeTextSmaller` on the WebKit control to provide zooming functionality
on macOS.
@merks
Copy link
Contributor

merks commented Feb 9, 2026

It just has a bad (in my opinion) default:

image

@tobiasmelcher
Copy link
Contributor Author

Build error not related to this change? Who can help to fix this issue?

07:46:39  [ERROR] Failed to execute goal org.eclipse.tycho:tycho-p2-plugin:5.0.2:p2-metadata-default (default-p2-metadata-default) on project org.eclipse.swt.svg: Execution default-p2-metadata-default of goal org.eclipse.tycho:tycho-p2-plugin:5.0.2:p2-metadata-default failed: Error trying to download org.eclipse.swt.svg version 3.132.0.v20251202-1523 from https://download.eclipse.org/eclipse/updates/4.39-I-builds/I20260204-1800:
07:46:39  [ERROR] Download of osgi.bundle,org.eclipse.swt.svg,3.132.0.v20251202-1523 failed on repository https://download.eclipse.org/eclipse/updates/4.39-I-builds/I20260204-1800. Retrying. :
07:46:39  [ERROR]    download from https://download.eclipse.org/eclipse/updates/4.39-I-builds/I20260204-1800/plugins/org.eclipse.swt.svg_3.132.0.v20251202-1523.jar failed: Server returned HTTP code: 400 for URL https://download.eclipse.org/eclipse/updates/4.39-I-builds/I20260204-1800/plugins/org.eclipse.swt.svg_3.132.0.v20251202-1523.jar
07:46:39  [ERROR] -> [Help 1]
07:46:39  org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.eclipse.tycho:tycho-p2-plugin:5.0.2:p2-metadata-default (default-p2-metadata-default) on project org.eclipse.swt.svg: Execution default-p2-metadata-default of goal org.eclipse.tycho:tycho-p2-plugin:5.0.2:p2-metadata-default failed: Error trying to download org.eclipse.swt.svg version 3.132.0.v20251202-1523 from https://download.eclipse.org/eclipse/updates/4.39-I-builds/I20260204-1800:

@merks
Copy link
Contributor

merks commented Feb 9, 2026

That's just this cursed issue:

https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/issues/6783

I just restarted the build and hope the curse is lifted...

@tobiasmelcher
Copy link
Contributor Author

thanks a lot for the help @merks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants