Skip to content

Fix: MacOS and Linux users can now open the right-click popup contextual menu on force view #6978

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
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Scoppio
Copy link
Collaborator

@Scoppio Scoppio commented May 4, 2025

What it does?

Mac and Linux apparently only consider a right mouse click being a popup trigger event on press, and windows considers only on release. This change makes sure that the popup will open on any OS.

Related issues

@Scoppio Scoppio added Bug Accessibility Work dealing with improving the accessibility of the application GUI User Interface Severity: Critical Issues described as critical as per the new issue form labels May 4, 2025
@Scoppio Scoppio self-assigned this May 4, 2025
@Copilot Copilot AI review requested due to automatic review settings May 4, 2025 20:08
@Scoppio Scoppio requested a review from a team as a code owner May 4, 2025 20:08
@Scoppio Scoppio changed the title fix: MAC and Linux users can now open the right-click popup contextual menu on force view fix: MacOS and Linux users can now open the right-click popup contextual menu on force view May 4, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request ensures that the right-click popup contextual menu opens consistently across operating systems by handling mouse events differently on Mac/Linux versus Windows. In addition, it refines some TODO comment formatting and replaces console error printing with proper logging.

  • Adjusted right-click event handling in ChatLounge.java to support OS-specific behavior.
  • Updated TODO comment formatting in ChatLounge.java.
  • Improved error handling and logging in SBFStatsDialog.java with a potential correction in stats panel initialization.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
megamek/src/megamek/client/ui/swing/lobby/ChatLounge.java Updated mouse event handling and refined comments to trigger the popup on the correct mouse events.
megamek/src/megamek/client/ui/dialogs/SBFStatsDialog.java Introduced MMLogger for error logging and modified the stats panel initialization, which may lead to instance field shadowing.

@Scoppio Scoppio changed the title fix: MacOS and Linux users can now open the right-click popup contextual menu on force view Fix: MacOS and Linux users can now open the right-click popup contextual menu on force view May 4, 2025
Copy link

codecov bot commented May 4, 2025

Codecov Report

Attention: Patch coverage is 0% with 15 lines in your changes missing coverage. Please review.

Project coverage is 30.32%. Comparing base (362ce65) to head (5a793bd).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
.../src/megamek/client/ui/swing/lobby/ChatLounge.java 0.00% 12 Missing ⚠️
.../src/megamek/client/ui/dialogs/SBFStatsDialog.java 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##             master    #6978   +/-   ##
=========================================
  Coverage     30.32%   30.32%           
- Complexity    15837    15840    +3     
=========================================
  Files          2888     2888           
  Lines        283253   283257    +4     
  Branches      49328    49329    +1     
=========================================
+ Hits          85903    85908    +5     
+ Misses       191748   191746    -2     
- Partials       5602     5603    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accessibility Work dealing with improving the accessibility of the application Bug GUI User Interface Severity: Critical Issues described as critical as per the new issue form
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Issue] Unable to convert to SBF
1 participant