errael commented on issue #7952:
URL: https://github.com/apache/netbeans/issues/7952#issuecomment-2692520603
There's #8285 which is pretty small (lots of logging stuff for removal
before a final PR); assuming nothing better comes along...
Look at `HookFileMenu` and the early return in `propertyChange()` for the PR.
Basic problem is that `Alt-F` handling, when starting in a detached window,
intermediately transfers focus to a `TopComponent`. See the "With Activation
(behavior after #4603)" log data below; notice that the
`tc.requestActivation()` processing happens after the `Alt-F` handling which
leaves the focus in the wrong spot.
I don't particularly like this solution. But can't think of anything better,
possibly a custom focus manager (ouch).
---
### Skip Activation (behavior before #4603)
#### Docked
Ctrl-0
```
: PropChange: (60) MainWin JFrame@425473fa, KBFocusWin JFrame@425473fa
: currentTC NewClass.java:MultiViewCloneableTopComponent@24687610,
TCWin JFrame@425473fa
: old ExplorerTree@4464d834, new (null)
: PermanentFocusOwner: old ExplorerTree@4464d834, new (null)
: PropChange: (61) MainWin JFrame@425473fa, KBFocusWin JFrame@425473fa
: currentTC NewClass.java:MultiViewCloneableTopComponent@24687610,
TCWin JFrame@425473fa
: old (null), new QuietEditorPane@2dc11d2b
: PermanentFocusOwner: old (null), new QuietEditorPane@2dc11d2b
trackTC: activated oldTC: null:ProjectTab@5493c897 'explorer' : nPanes = 0
trackTC: activated newTC:
NewClass.java:MultiViewCloneableTopComponent@24687610 'editor' : nPanes = 1
```
Ctrl-1
```
: PropChange: (62) MainWin JFrame@425473fa, KBFocusWin JFrame@425473fa
: currentTC null:ProjectTab@5493c897, TCWin JFrame@425473fa
: old QuietEditorPane@2dc11d2b, new (null)
: PermanentFocusOwner: old QuietEditorPane@2dc11d2b, new (null)
: PropChange: (63) MainWin JFrame@425473fa, KBFocusWin JFrame@425473fa
: currentTC null:ProjectTab@5493c897, TCWin JFrame@425473fa
: old (null), new ExplorerTree@4464d834
: PermanentFocusOwner: old (null), new ExplorerTree@4464d834
trackTC: activated oldTC:
NewClass.java:MultiViewCloneableTopComponent@24687610 'editor' : nPanes = 1
trackTC: activated newTC: null:ProjectTab@5493c897 'explorer' : nPanes = 0
```
Alt-F
```
: PropChange: (64) MainWin JFrame@425473fa, KBFocusWin JFrame@425473fa
: currentTC null:ProjectTab@5493c897, TCWin JFrame@425473fa
: old ExplorerTree@4464d834, new (null)
: PropChange: (65) MainWin JFrame@425473fa, KBFocusWin JFrame@425473fa
: currentTC null:ProjectTab@5493c897, TCWin JFrame@425473fa
: old (null), new JRootPane@71996adf
```
#### Floating
Ctrl-0
```
: PropChange: (110) MainWin JFrame@425473fa, KBFocusWin ModeDialog@69af4248
: currentTC NewClass.java:MultiViewCloneableTopComponent@24687610,
TCWin JFrame@425473fa
: old ExplorerTree@4464d834, new (null)
: PropChange: (111) MainWin JFrame@425473fa, KBFocusWin JFrame@425473fa
: currentTC NewClass.java:MultiViewCloneableTopComponent@24687610,
TCWin JFrame@425473fa
: old (null), new QuietEditorPane@2dc11d2b
: PermanentFocusOwner: old ExplorerTree@4464d834, new
QuietEditorPane@2dc11d2b
trackTC: activated oldTC: null:ProjectTab@5493c897 'anonymousMode_1' :
nPanes = 0
trackTC: activated newTC:
NewClass.java:MultiViewCloneableTopComponent@24687610 'editor' : nPanes = 1
```
Ctrl-1
```
: PropChange: (112) MainWin JFrame@425473fa, KBFocusWin JFrame@425473fa
: currentTC null:ProjectTab@5493c897, TCWin ModeDialog@69af4248
: old QuietEditorPane@2dc11d2b, new (null)
: invoke handleActivation
: SKIP ACTIVATION (null)
: PropChange: (113) MainWin JFrame@425473fa, KBFocusWin ModeDialog@69af4248
: currentTC null:ProjectTab@5493c897, TCWin ModeDialog@69af4248
: old (null), new ExplorerTree@4464d834
: PermanentFocusOwner: old QuietEditorPane@2dc11d2b, new
ExplorerTree@4464d834
trackTC: activated oldTC:
NewClass.java:MultiViewCloneableTopComponent@24687610 'editor' : nPanes = 1
trackTC: activated newTC: null:ProjectTab@5493c897 'anonymousMode_1' :
nPanes = 0
```
Alt-F
```
: PropChange: (114) MainWin JFrame@425473fa, KBFocusWin ModeDialog@69af4248
: currentTC null:ProjectTab@5493c897, TCWin ModeDialog@69af4248
: old ExplorerTree@4464d834, new (null)
: PropChange: (115) MainWin JFrame@425473fa, KBFocusWin JFrame@425473fa
: currentTC null:ProjectTab@5493c897, TCWin ModeDialog@69af4248
: old (null), new QuietEditorPane@2dc11d2b
: invoke handleActivation
: SKIP ACTIVATION QuietEditorPane@2dc11d2b
: PermanentFocusOwner: old ExplorerTree@4464d834, new
QuietEditorPane@2dc11d2b
: PropChange: (116) MainWin JFrame@425473fa, KBFocusWin JFrame@425473fa
: currentTC null:ProjectTab@5493c897, TCWin ModeDialog@69af4248
: old QuietEditorPane@2dc11d2b, new (null)
: invoke handleActivation
: SKIP ACTIVATION (null)
: PermanentFocusOwner: old QuietEditorPane@2dc11d2b, new (null)
: PropChange: (117) MainWin JFrame@425473fa, KBFocusWin JFrame@425473fa
: currentTC null:ProjectTab@5493c897, TCWin ModeDialog@69af4248
: old (null), new JRootPane@71996adf
: invoke handleActivation
: SKIP ACTIVATION JRootPane@71996adf
: PermanentFocusOwner: old (null), new JRootPane@71996adf
```
### With Activation (behavior after #4603)
#### Floating
Ctrl-0
```
: PropChange: (206) MainWin JFrame@425473fa, KBFocusWin ModeDialog@37cb1fdf
: currentTC NewClass.java:MultiViewCloneableTopComponent@24687610,
TCWin JFrame@425473fa
: old ExplorerTree@4464d834, new (null)
: PropChange: (207) MainWin JFrame@425473fa, KBFocusWin JFrame@425473fa
: currentTC NewClass.java:MultiViewCloneableTopComponent@24687610,
TCWin JFrame@425473fa
: old (null), new QuietEditorPane@2dc11d2b
: PermanentFocusOwner: old ExplorerTree@4464d834, new
QuietEditorPane@2dc11d2b
trackTC: activated oldTC: null:ProjectTab@5493c897 'anonymousMode_1' :
nPanes = 0
trackTC: activated newTC:
NewClass.java:MultiViewCloneableTopComponent@24687610 'editor' : nPanes = 1
```
Ctrl-1
```
: PropChange: (208) MainWin JFrame@425473fa, KBFocusWin JFrame@425473fa
: currentTC null:ProjectTab@5493c897, TCWin ModeDialog@37cb1fdf
: old QuietEditorPane@2dc11d2b, new (null)
: invoke handleActivation
: handleActivation: evtObject (null)
: PropChange: (209) MainWin JFrame@425473fa, KBFocusWin ModeDialog@37cb1fdf
: currentTC null:ProjectTab@5493c897, TCWin ModeDialog@37cb1fdf
: old (null), new ExplorerTree@4464d834
: PermanentFocusOwner: old QuietEditorPane@2dc11d2b, new
ExplorerTree@4464d834
trackTC: activated oldTC:
NewClass.java:MultiViewCloneableTopComponent@24687610 'editor' : nPanes = 1
trackTC: activated newTC: null:ProjectTab@5493c897 'anonymousMode_1' :
nPanes = 0
```
Alt-F
```
: PropChange: (210) MainWin JFrame@425473fa, KBFocusWin ModeDialog@37cb1fdf
: currentTC null:ProjectTab@5493c897, TCWin ModeDialog@37cb1fdf
: old ExplorerTree@4464d834, new (null)
: PropChange: (211) MainWin JFrame@425473fa, KBFocusWin JFrame@425473fa
: currentTC null:ProjectTab@5493c897, TCWin ModeDialog@37cb1fdf
: old (null), new QuietEditorPane@2dc11d2b
: invoke handleActivation
: handleActivation: evtObject QuietEditorPane@2dc11d2b
##### focus change later
: PermanentFocusOwner: old ExplorerTree@4464d834, new
QuietEditorPane@2dc11d2b
: PropChange: (212) MainWin JFrame@425473fa, KBFocusWin JFrame@425473fa
: currentTC NewClass.java:MultiViewCloneableTopComponent@24687610,
TCWin JFrame@425473fa
: old QuietEditorPane@2dc11d2b, new (null)
: PermanentFocusOwner: old QuietEditorPane@2dc11d2b, new (null)
: PropChange: (213) MainWin JFrame@425473fa, KBFocusWin JFrame@425473fa
: currentTC NewClass.java:MultiViewCloneableTopComponent@24687610,
TCWin JFrame@425473fa
: old (null), new JRootPane@71996adf
: PermanentFocusOwner: old (null), new JRootPane@71996adf
: PropChange: (214) MainWin JFrame@425473fa, KBFocusWin JFrame@425473fa
##### by earlier activation
: currentTC NewClass.java:MultiViewCloneableTopComponent@24687610,
TCWin JFrame@425473fa
: old JRootPane@71996adf, new (null)
: PermanentFocusOwner: old JRootPane@71996adf, new (null)
: PropChange: (215) MainWin JFrame@425473fa, KBFocusWin JFrame@425473fa
: currentTC NewClass.java:MultiViewCloneableTopComponent@24687610,
TCWin JFrame@425473fa
: old (null), new QuietEditorPane@2dc11d2b
: PermanentFocusOwner: old (null), new QuietEditorPane@2dc11d2b
trackTC: activated oldTC: null:ProjectTab@5493c897 'anonymousMode_1' :
nPanes = 0
trackTC: activated newTC:
NewClass.java:MultiViewCloneableTopComponent@24687610 'editor' : nPanes = 1
--
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