This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
[nb_dev](20030130), [jdk1.4.2](b15) Steps to reproduce: - run IDE in SDI mode - switch to Debugging Workspace -> Debugger window is opened and has Debugger view selected - switch to Editing - restart IDE - switch to Debugging workspace -> title of Debugger Window is "Debugger [?]" - issue 30509, but Project tab is selected (no Debugger View) It worked fine in [nb_dev](20030129) - sooner, but not now in [nb_dev](20030130)
It seems it is caused by fix of issue #27789.
I tried to fix but it is almost impossible to fix it generaly. When I fix one case by delaying TopComponent activation it fails in other case because it is done too late. :( The main reason is how MDI desktop modes is currently build. Every TopComponent is added to already live environment - it causes call of requestFocus() and setSelectedTopComponent(). It is too complicated to trace and to even understand what is going on inside. We spent already too much time to fix such issue. Constructing desktop requires complete redesign. First frame should be created, TopComponents added to it (without activating, listening on JTabbedPane, ....) and possibly select desired components/tabs and THEN added to desktop instead of adding TopComponent one by one to live frame. I leave this issue opened.
The same behaviour after opening form file (for example).
*** Issue 30779 has been marked as a duplicate of this issue. ***
IMHO: it's 100 % reproducible by qa-functional tests.
JDK 1.4.1_01: Problem is in current winsys design: When workspace is opened for the first time TopComponent are loaded and added to modes one by one using Mode.dockInto() and TopComponent.open(). It causes call of requestFocus() on EVERY TopComponent added to workspace. Unfortunately not all requests are granted by AWT. requestFocus() on Runtime tab is (sometimes) converted to FOCUS_GAINED event with main window as source. This event is processed later and changed to new FOCUS_GAINED event with Runtime tab as source when Filesystems tab is already correctly selected. This event causes activation Runtime tab in Explorer. One possible fix (workaround) is to avoid all calls of requestFocus() during workspace switching. The best solution would be to redesign way how new workspace is loaded but it is not that simple. Fix: Do not call TopComponent.requestFocus() during workspace switching. Keep last activated TopComponent and activate it after workspace switching is finished.
Fixed in main trunk. Modified: core/src/org/netbeans/core/windows/WorkspaceImpl.java r.1.115 core/src/org/netbeans/core/windows/WorkspaceVisibilityManager.java r.1.28 core/src/org/netbeans/core/windows/frames/DefaultContainerImpl.java r.1.73
Marek: After switching workspaces in one run IDE it works fine , right top components are selected, but if you try next steps , it doesn't work in [nb_dev](20030220) : - run IDE - switch to SDI - switch to GUI Editing -> Filesystems selected in Explorer - fine - switch to Debugging -> Debugger selected in Debugger window - fine - switch back to Editing - restart IDE - switch to GUI Editing -> Runtime selected in Explorer ! - switch to Debugging -> Project selected in Debugger window ! reopen or file new one ?
Ok, I have filed another issue 31246. verified in [nb_dev](20030220)