-
Bug
-
Resolution: Incomplete
-
P4
-
17, 21
If a Swing component such as a combo box is embedded in a macOS native modal panel, any popup menu it creates is useless, because:
1. The menu is displayed under the native panel instead of on top of the panel.
2. The menu does not respond to mouse events.
I believe there is a single cause for these problems, which is in the method CPlatformWindow.initializeBase. This code identifies the owning window as follows:
if (owner instanceof CPlatformWindow) {
this.owner = (CPlatformWindow)owner;
}
In the embedded case the owner is a CViewPlatformEmbeddedFrame, which is not a CPlatformWindow.
When this.owner is null, the code that sets the window level (applyWindowLevel) is not run, so the window is displayed at the default level, which is lower than the modal panel level. Also, when this.owner is null, the popup window is not installed as a child of the native panel, so it is blocked from mouse events because it is unrelated to the native modal panel.
1. The menu is displayed under the native panel instead of on top of the panel.
2. The menu does not respond to mouse events.
I believe there is a single cause for these problems, which is in the method CPlatformWindow.initializeBase. This code identifies the owning window as follows:
if (owner instanceof CPlatformWindow) {
this.owner = (CPlatformWindow)owner;
}
In the embedded case the owner is a CViewPlatformEmbeddedFrame, which is not a CPlatformWindow.
When this.owner is null, the code that sets the window level (applyWindowLevel) is not run, so the window is displayed at the default level, which is lower than the modal panel level. Also, when this.owner is null, the popup window is not installed as a child of the native panel, so it is blocked from mouse events because it is unrelated to the native modal panel.