Skip to content

Floating TopComponents are not correctly restored on role switch when NB.WinSys.WinSys.Show.Hide.MainWindow.While.Switching.Role is false #9346

@CDbleU

Description

@CDbleU

Apache NetBeans version

Apache NetBeans 29

What happened

I am switching roles with WindowManager.getDefault().setRole(). When coming back to a previous role, everything is restored correctly, until I set the option NB.WinSys.WinSys.Show.Hide.MainWindow.While.Switching.Role to false. In this case floating TopComponents are reopened, but appear at position 0/0 with size 0/0.

My expectation is, that this flag changes the behavior of the main window when switching roles, but not the behavior of the role-switch itself. So even with the flag set to false all TopComponents of the role should be restored correctly.

Language / Project Type / NetBeans Component

Java Maven Project

How to reproduce

I have written a reproducer: https://gitlab.com/cdbleu_projects/nb_roleswitch_reproducer

The Reproducer contains a README wich contains furhter information on how to use the reproducer and what exactly happpens.

Did this work correctly in an earlier version?

No / Don't know

Operating System

WIndows 11 and Linux (RHEL 9)

JDK

JDK 25 (could also reproduce it with JDK 21)

Apache NetBeans packaging

Apache NetBeans platform

Anything else

The problem can be reproduced very reliably (100% ;) ).
It can also be reproduced with NetBeans 28 (I didn't try it with earlier versions.)

As I don't know exactly what the problem it (and whether there might be some intended behavior included) I can't take care of a pull request.

Are you willing to submit a pull request?

No

Metadata

Metadata

Assignees

No one assigned

    Labels

    Platform[ci] enable platform tests (platform/*)UIUser Interfacekind:bugBug report or fixneeds:triageRequires attention from one of the committers

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions