Skip to content

Edge: addMouseWheelListener and addMouseListener have no effect #2164

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

Open
rubenporras opened this issue May 20, 2025 · 4 comments · May be fixed by #2097
Open

Edge: addMouseWheelListener and addMouseListener have no effect #2164

rubenporras opened this issue May 20, 2025 · 4 comments · May be fixed by #2097
Labels
edge Edge Browser

Comments

@rubenporras
Copy link

rubenporras commented May 20, 2025

Describe the bug
When using an Edge browser, if the methods addMouseWheelListener or addMouseListener are used, the listener is registered but never executed.

To Reproduce

    Browser browser = new Browser(browserContainer, SWT.NONE);

    browser.addMouseWheelListener(e -> {
      System.out.println(e.toString());
    });
    browser.addMouseListener(new MouseListener() {

      @Override
      public void mouseUp(final MouseEvent e) {
        System.out.println(e.toString());
      }

      @Override
      public void mouseDown(final MouseEvent e) {
        System.out.println(e.toString());
      }

      @Override
      public void mouseDoubleClick(final MouseEvent e) {
        System.out.println(e.toString());
      }
    });

Expected behavior
The listeners are called when the scroll wheel is used or the buttons of the mouse is are clicked inside the Edge window

Environment:

  1. Select the platform(s) on which the behavior is seen:
    • [] All OS
    • Windows
    • Linux
    • macOS

Workaround (or) Additional context

Use the SWT.IE when creating the browser.
Use a javascript function to react to the scroll wheel / buttons and register a normal BrowserFunction as a callback.

@fedejeanne
Copy link
Contributor

Related to (possibly a duplicate even):

@rubenporras would you like to continue the discussion in some of those? Also, the description of the issue seems wrong, you wrote "if the methods addMouseListener or addMouseListener are used," (same method twice)

@sratz sratz added the edge Edge Browser label May 21, 2025
@rubenporras rubenporras changed the title Edge: addMouseListener and addMouseListener have no effect Edge: addMouseWheelListener and addMouseListener have no effect May 21, 2025
@rubenporras
Copy link
Author

Thanks, I have fixed the title and description of the ticket

@rubenporras
Copy link
Author

From the related PRs, I think that #2097 would fix the problem I am reporting.

@fedejeanne fedejeanne linked a pull request May 21, 2025 that will close this issue
@fedejeanne
Copy link
Contributor

Thank you! I linked the PR

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 a pull request may close this issue.

3 participants