Skip to content
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

3.4.1 doesn't work with trackpad on macOS #19506

Open
markcmiller86 opened this issue May 10, 2024 · 3 comments
Open

3.4.1 doesn't work with trackpad on macOS #19506

markcmiller86 opened this issue May 10, 2024 · 3 comments
Labels
bug Something isn't working impact medium Productivity partially degraded (not easily mitigated bug) or improved (enhancement) likelihood medium Neither low nor high likelihood
Milestone

Comments

@markcmiller86
Copy link
Member

markcmiller86 commented May 10, 2024

Describe the bug

If a trackpad is being used instead of a mouse on a macOS laptop, the viewer window will not relinquish the pointer once it acquires it. If a mouse is used instead, it will work fine.

Desktop

  • OS and version: macOS laptop with trackpad
  • VisIt Version: 3.4.1

This is for @iulian787 and @vijaysm at ANL

@markcmiller86 markcmiller86 added bug Something isn't working likelihood medium Neither low nor high likelihood impact medium Productivity partially degraded (not easily mitigated bug) or improved (enhancement) labels May 10, 2024
@BenWibking
Copy link
Contributor

I am also seeing this. Just commenting here for update notifications on a fix or workaround.

@cyrush cyrush added this to the 3.4.3 milestone May 13, 2024
@markcmiller86
Copy link
Member Author

@BenWibking or @vijaysm, I wonder does hitting escape key when using trackpad and the pointer seems to un-stick the stuck pointer?

Also, just capturing some notes from ChatGPT...

It sounds like your Qt application might be handling mouse events in a way that interferes with how trackpad events are managed on macOS. Here are a few steps and considerations to help you diagnose and potentially fix the issue:

  1. Check Event Handling: Verify how your application handles mouse events. If your application uses custom mouse event handling (e.g., overriding mousePressEvent, mouseReleaseEvent, mouseMoveEvent), ensure that events are being properly passed to the base class when not explicitly handled. For example:

    void MyWidget::mousePressEvent(QMouseEvent *event) {
        if (event->button() == Qt::LeftButton) {
            // Handle left button
        } else {
            QWidget::mousePressEvent(event); // Pass other events to the base class
        }
    }
  2. Focus Policy: Make sure the focus policy of the widgets is correctly set. A widget must accept focus to properly handle keyboard and mouse events. You can set the focus policy in the constructor or using the setFocusPolicy() method.

    setFocusPolicy(Qt::StrongFocus);
  3. Event Propagation: Check if mouse events are being stopped from propagating correctly in your application. If any widget consumes the mouse events without passing them to its parent, this might lead to unexpected behavior.

  4. Grabbing the Mouse: If your application explicitly grabs the mouse input (using grabMouse()), ensure it releases it appropriately with releaseMouse(). An incorrect or missing release call could explain why the application retains control of the pointer.

    grabMouse();
    // Later
    releaseMouse();
  5. Debugging: Add logging to the event handling methods to see how events are being processed when using the trackpad versus an external mouse. This might reveal differences in event sequences or types.

  6. Qt Version and macOS Compatibility: Verify that you are using a version of Qt that supports the version of macOS you are targeting. Sometimes, bugs or incompatibilities are specific to certain combinations of Qt and macOS versions. Checking the Qt release notes or forums might provide insights or patches.

  7. macOS-Specific Behavior: Since this issue is specific to macOS, look into whether macOS-specific flags or configurations are needed. For example, check if Qt's macOS-specific integration documentation suggests any configurations for trackpad support.

If you've checked these areas and the issue persists, it might be helpful to look into minimal reproducible examples and see if the problem occurs in a simpler context. Additionally, checking forums or filing a bug report with the Qt project, including details of your setup and code snippets, could also provide further assistance.

@BenWibking
Copy link
Contributor

@BenWibking or @vijaysm, I wonder does hitting escape key when using trackpad and the pointer seems to un-stick the stuck pointer?

That didn't seem to help for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working impact medium Productivity partially degraded (not easily mitigated bug) or improved (enhancement) likelihood medium Neither low nor high likelihood
Projects
None yet
Development

No branches or pull requests

3 participants