rkeen-siemens commented on issue #8488: URL: https://github.com/apache/netbeans/issues/8488#issuecomment-7296207569
I would suggest this is a bug rather than a feature request. Here's an example showing the issue when the window is position at the left side of the screen (important as noted below): <img width="470" height="250" alt="Clipped" src="https://github.com/user-attachments/assets/2aaf57b1-f8a2-4829-b9a8-7438fded6f7c" /> [HeavyweightTreeApp.zip](https://github.com/user-attachments/files/35648878/HeavyweightTreeApp.zip) contains this example application. `CustomPopupFactory.getPopup()` returns an `LWPopup`, a component in the frame's glass pane, whenever the overlay fits into the window; otherwise it returns an `HWPopup` (a `JWindow`). Its [comment already notes the open point](https://github.com/apache/netbeans/blob/73554eea4b04ab1dbbbaaf38798ee2fbb04cd87a/platform/openide.explorer/src/org/openide/explorer/view/CustomPopupFactory.java#L69): *"XXX need API to determine if editor area comp is heavyweight, and if so, return a 'medium weight' popup"*. A lightweight popup is only visible over a heavyweight component if AWT's heavyweight/lightweight mixing cuts the popup's area out of the heavyweight. That is not the case with `-Dsun.awt.disableMixing=true`, and in our application not with an OpenGL scene view (a `java.awt.Canvas` that a native renderer draws into). The window position matters because of a second issue in `getPopup()`: `r` is converted into the window's coordinates, but `c.getBounds()`, which it is checked against, is in screen coordinates. With the window at (0,0), as with a maximized IDE, the two are the same and the lightweight popup is used. When the window is moved right (or down) by more than the overlay's position in the window, `contains()` fails and the heavyweight `JWindow` is used, which is shown over the canvas. Suggested fix: use a heavyweight popup when the overlay overlaps a heavyweight component (similar to the [fix for FlatLaf #626](https://github.com/JFormDesigner/FlatLaf/commit/a2859cedb51adee8238214c9513d6aa662b6260b)), or always for these overlays; and compare `r` with the window's size (`new Rectangle(c.getSize())`) instead of `c.getBounds()`. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
