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

Overloaded native NetBeans popup menu #2

Open
jkovalsky opened this issue Apr 28, 2023 · 2 comments
Open

Overloaded native NetBeans popup menu #2

jkovalsky opened this issue Apr 28, 2023 · 2 comments

Comments

@jkovalsky
Copy link

jkovalsky commented Apr 28, 2023

Unfortunately sometimes your popup menu replaces the default menu provided by NetBeans. It would be better to just add your menu items to the NetBeans ones. See the screenshots to understand what I mean. Tested in NetBeans 18 RC2.

Before plugin installation:
Before plugin installation

After plugin installation:
After plugin installation

@hajdam
Copy link
Owner

hajdam commented Apr 28, 2023

Hi,
thank you for reporting this issue.
Unfortunately, the plugin currently cannot detect this specific popup menu.
If this is an issue, as this might be happening in other components in NetBeans or other plugins, currently only options is to disable or uninstall Gui Popup Plugin.

Technical details:
Plugin currently detects when to show popup menu if invocation event is consumed (either by component popup menu or custom handler).
This specific component shows popup menu via listener and doesn't consume the event:
https://github.com/apache/netbeans/blob/c084119009d2e0f736f225d706bc1827af283501/ide/notifications/src/org/netbeans/modules/notifications/center/NotificationTable.java#L104

I'll try to take a look if there might be some other way how to detect this situation. Not sure how often similar code is used, but creating workaround/blacklist for this specific component would probably be insufficient/fragile solution.

In worst case this could warrant removal of the plugin from plugin portal or at least disabling popup functionality of the plugin :-(

hajdam added a commit that referenced this issue Apr 29, 2023
@hajdam
Copy link
Owner

hajdam commented Apr 29, 2023

Component added to blacklist to prevent popup menu takeover. Fix will be included in next release, but in far future.

Technical details:
Standard popup menu should be invoked with mouse MOUSE_PRESSED or MOUSE_RELEASED (depending on platform), but NotificationTable component invokes it later with MOUSE_CLICKED event and also cannot handle that popup menu is already show (some components can replace popup menu).

Hopefully there are not many components that handle popup menu in similar fashion, as I don't see how this could be detected / prevented (unless showing popup menu with some kind of delay, but that would prevent right-click hold-release). Opted to use blacklist.

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

No branches or pull requests

2 participants