RFR: 8263385: IGV: Graph is not opened in the window that has focus.

Koichi Sakata ksakata at openjdk.java.net
Fri May 28 06:36:03 UTC 2021


On Tue, 18 May 2021 07:16:30 GMT, Richard Reingruber <rrich at openjdk.org> wrote:

>> This pull request enables IGV opens a graph in the window that is focused.
>> 
>> At the moment IGV opens a graph in the window that has the graph and is found first. So in this pull request I used preferentially the active EditorTopComponent.
>> 
>> I tested the following scenarios manually:
>> 
>> 1. Open a graph, open clone, then open another graph (as described in the bug report). It replaces the clone graph with the last opened graph.
>> 2. Open a graph, open clone, swap tabs by dragging the clone graph, then open another graph. It replaces the clone graph with the last opened graph.
>> 3. Open a graph, open clone, change the focus from the clone graph to the first graph, then open another graph. It replaces the first graph with the last opened graph.
>> 4. Open a graph, open clone, open the same graph xml file from the toolbar, open a graph in the second folder, then open a graph in the first folder. It replaces the leftmost graph that was opened the first with the last opened graph.
>
> Hello Koichi,
> 
> thanks for taking care of this issue.
> 
> I've built and tested this pull request and found that it works in most cases.
> 
> Here's what did not work:
> 
> 1. Open Graph -> new Tab T1 is created 
> 2. Open Clone -> new Tab T2 is created
> 3. Use the mouse to drag T2 down in the lower part of the window until the red frame indicates that the window will be split horizontally -> The window will be split horizontally. T2 is the lower window and has focus.
> 4. Open another Graph in the outline
> 5. IGV shows that graph in T1 even though T2 had focus. This is unexpected.
> 
> Despite that I think your change is good.
> 
> Unfortunately I can only test but not review the change itself as I am not familiar with IGV source code.
> 
> Thanks, Richard.

@reinrich That doesn’t seem doable. I've analyzed the code. 
When splitting graph windows, each window has its own mode, model and sub model that are classes in OpenIDE and NetBeans. So when splitting horizontally, there are two mode objects. It needs to get the last active editor mode to show a selected graph.
The `org.netbeans.core.windows.model.ModesSubModel` class has the property named `lastActiveEditorMode`. This is the mode object that is last active mode and is an editor mode. But `lastActiveEditorMode` can be accessed only from those NetBeans internal classes such as `org.netbeans.core.windows.Central` or `org.netbeans.core.windows.model.Model`. Therefore, it doesn't seem to be able to get last active editor mode from the classes of IGV and show a graph in the window of the mode, I think.

Since this pull request can't satisfy the needs, I intend to close this PR.

https://github.com/apache/netbeans/blob/39496d3400eada7398a8428f05c90589aa1f3b74/platform/core.windows/src/org/netbeans/core/windows/model/ModesSubModel.java#L303

-------------

PR: https://git.openjdk.java.net/jdk/pull/4078


More information about the hotspot-compiler-dev mailing list