Skip to content

Edge: Implement mouse-related event listener support #2097

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sratz
Copy link
Member

@sratz sratz commented May 5, 2025

  • MouseListener

    • up
    • down
    • doubleClick
  • MouseMoveListener

    • move
  • MouseTrackListener

    • exit
    • enter
  • MouseWheelListener

    • scroll
  • DragDetectListener

    • dragDetected

The implementation is JavaScript-based by attaching listeners to the DOM for all relevant events and forwarding them to the WebView via window.chrome.webview.postMessage().

The event handling is analogous to IE's
IE#handleDOMEvent(org.eclipse.swt.ole.win32.OleEvent).

This obsoletes and removes the workaround implemented in #1551.

- MouseListener
  up
  down
  doubleClick

- MouseMoveListener
  move

- MouseTrackListener
  exit
  enter

- MouseWheelListener
  scroll

- DragDetectListener
  dragDetected

The implementation is JavaScript-based by attaching listeners to the
DOM for all relevant events and forwarding them to the WebView via
window.chrome.webview.postMessage().

The event handling is analogous to IE's
IE#handleDOMEvent(org.eclipse.swt.ole.win32.OleEvent).

This obsoletes and removes the workaound implemented in eclipse-platform#1551.
@sratz sratz added the edge Edge Browser label May 5, 2025
Copy link
Contributor

github-actions bot commented May 5, 2025

Test Results

   539 files   -  6     539 suites   - 6   39m 20s ⏱️ + 6m 25s
 4 339 tests  - 37   4 323 ✅  - 35   15 💤  - 3  1 ❌ +1 
16 606 runs   - 37  16 468 ✅  - 35  137 💤  - 3  1 ❌ +1 

For more details on these failures, see this check.

Results for commit 0d75c70. ± Comparison against base commit 3d459ab.

This pull request removes 37 tests.
AllWin32Tests org.eclipse.swt.graphics.ImageWin32Tests ‑ testImageDataForDifferentFractionalZoomsShouldBeDifferent
AllWin32Tests org.eclipse.swt.graphics.ImageWin32Tests ‑ testImageShouldHaveDimesionAsPerZoomLevel
AllWin32Tests org.eclipse.swt.tests.win32.Test_org_eclipse_swt_dnd_DND ‑ testByteArrayTransfer
AllWin32Tests org.eclipse.swt.tests.win32.Test_org_eclipse_swt_dnd_DND ‑ testFileTransfer
AllWin32Tests org.eclipse.swt.tests.win32.Test_org_eclipse_swt_dnd_DND ‑ testHtmlTransfer
AllWin32Tests org.eclipse.swt.tests.win32.Test_org_eclipse_swt_dnd_DND ‑ testImageTransfer_fromCopiedImage
AllWin32Tests org.eclipse.swt.tests.win32.Test_org_eclipse_swt_dnd_DND ‑ testImageTransfer_fromImage
AllWin32Tests org.eclipse.swt.tests.win32.Test_org_eclipse_swt_dnd_DND ‑ testImageTransfer_fromImageData
AllWin32Tests org.eclipse.swt.tests.win32.Test_org_eclipse_swt_dnd_DND ‑ testImageTransfer_fromImageDataFromImage
AllWin32Tests org.eclipse.swt.tests.win32.Test_org_eclipse_swt_dnd_DND ‑ testRtfTransfer
…

♻️ This comment has been updated with latest results.

@HeikoKlare
Copy link
Contributor

HeikoKlare commented May 5, 2025

@sratz
Copy link
Member Author

sratz commented May 5, 2025

May this fix ...?

Not sure.

I just remember that we've been down this road before.

The problem is that if we disable JavaScript via ICoreWebView2Settings.put_IsScriptEnabled(boolean), this will also prevent those listeners from running :(

@sratz sratz marked this pull request as draft May 5, 2025 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
edge Edge Browser
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants