errael commented on PR #8288:
URL: https://github.com/apache/netbeans/pull/8288#issuecomment-2708433800

   > the focus behavior for _File_ > _Close_ has now changed.
   
   @nmatt Not really. There's a difference between focused component (Swing 
concept) and active component (NB concept). Before NB15 it was much easier for 
active/focused to be different components. The steps in 
https://github.com/apache/netbeans/pull/8288#issuecomment-2705433980, leave the 
`Projects` window _active_ and at the same time the `Editor` is _focused_. This 
breaks some things, see #4437.
   
   > The change in behavior might very well be due to other changes since 
NetBeans 15
   
   Unlikely.
   
   > in case something was overlooked in the present fix
   
   The effect of #4603/#8288 is to `TopComponent` activate the last focused 
component of a sequence of focus changes. It is certainly true that the active 
`TopComponent` behavior has changed. These PRs do not change the focused 
component.
   
   The focus change after `Alt-F` from floating window is a 3 step process. 
Typically
   ```
   permanentFocusOwner old ExplorerTree@d60489e, new QuietEditorPane@19568ae9
   permanentFocusOwner old QuietEditorPane@19568ae9, new (null)
   permanentFocusOwner old (null), new JRootPane@7ac53ef
   ```
   And then hitting `\<ESC>` moves focus to the previously focused component
   ```
   permanentFocusOwner old JRootPane@7ac53ef, new (null)
   permanentFocusOwner old (null), new QuietEditorPane@19568ae9
   ```
   Which is why the active `TopComponent` becomes the editor. If `Alt-F` were 
simply one step, `ExplorerTree --> JRootPane`, you would probably get the 
behavior you're looking for. The purpose of this PR is to keep the active 
`TopComponent` in sync with the focused component.
   
   This gets us back to the previous message
   
   > Where focus ends up is handled by the KeyboardFocusManger.
   > You might want to open an issue about focus changes that you find 
problematic.
   
   Perhaps some adjustments to some focus traversal policy would provide more 
intuitive behavior. That's out of scope for this PR.
   


-- 
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: notifications-unsubscr...@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@netbeans.apache.org
For additional commands, e-mail: notifications-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to