On Wed, 9 Sep 2026 12:46:17 GMT, Marius Hanl <[email protected]> wrote:

> This fixes a asymmetry in `ControlAcceleratorSupport` that causes a bug and 
> also a test to fail (an existing `Disabled` test).
> 
> All `addAcceleratorsIntoScene` will register a listener on the 
> `anchor.sceneProperty()`.
> The anchor is:
> - The `Node`
> - The `TabPane` for a `Tab`
> - The `Tree/TableView` for a `TableColumnBase`
> 
> Until this PR, the `removeAcceleratorsFromScene` sequence was sometimes 
> inconsistent:
> - For `Node`: 
>   - Unregister the `sceneProperty` on `Node`
>     - Then remove the accelerators from `Scene`
> - For `Tab` -> Get `TabPane`
>   - Then remove the accelerators from `Scene`
> - For `TableColumnBase` -> Get `Tree/TableView`
>   - Then remove the accelerators from `Scene`
> 
> Note how the "Unregister the `sceneProperty` on `Node`" step is completely 
> missing for `Tab` and `TableColumnBase`, explaining the bug and failing test 
> for only those two cases.
> 
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

This pull request has now been integrated.

Changeset: 7986fde4
Author:    Marius Hanl <[email protected]>
URL:       
https://git.openjdk.org/jfx/commit/7986fde4aa2a53892da1dbf2af5800b240768ada
Stats:     16 lines in 2 files changed: 0 ins; 11 del; 5 mod

8268374: MenuItem's accelerator gets fired even when ContextMenu is set to null

Reviewed-by: aghaisas, angorya

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

PR: https://git.openjdk.org/jfx/pull/2306

Reply via email to