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.
It has the same symtoms like 30274 and 30510 but different way how to achieve such behaviour. In automated tests we used to add AWTEventListener to default Toolkit and wait for 'quiet' period without events. If a listener with AWTEvent.HIERARCHY_EVENT_MASK is added, it causes unwanted switching of tabs in editor. To reproduce: - run IDE in MDI - open 2 or more files in editor - execute attached class by internal executor - double-click file already open in editor but not focused. It is focused for a while but focus is moved back to the last open file - double-click to open a file not open in editor => it is OK Tested in build 200302030100, Solaris, JDK1.4.1_01.
Created attachment 8765 [details] Test case
This is really mess caused by adding componentShowing(). -> to make sure component is visible there is a bunch of TopComponent.setVisible(false/true) from our focus event dispatcher. Call of setVisible() causes creating another focus event from processing of previous one - it is really ugly practice. Fix of this issue is relatively easy: Just do not call TopComponent.setVisible(true) from SplitContainerImpl.componentSelected(). But this fixed issue #24485. It is magic circle. I spent already 2 days on investigation but still no idea why adding another listener to Toolkit causes this change of behaviour. Perhaps it could be that setVisible() also generates hierarchy events. Current Winsys API is not suitable for componentShowing() approach when we want to initialize only GUI of TopComponent added in the end. Current implementation calls TopComponent.setVisible() everywhere just to be sure that proper TopComponent is/is not visible. Winsys redesign should solve this but I do not what solution shoudl be aplied now. Peter any idea?
Actually focus is not lost it is assigned to toolbar of visible top component in Editor.
I removed fix of #24422, #24485. These issues are not reproducible for me when I removed original fix. Please Marian can you verify on Solaris? This issue is fixed too by removing of above fixes. If there will be problem with component visibility we will have to find some other solution. I tested on JDK 1.4.1_01. Modified: core/src/org/netbeans/core/windows/frames/SplitContainerImpl.java r.1.98
Verified in 20030206-0100. Thanks.
The fix was reverted, because it has caused regression of issue #24422, see issue #31427.
Btw. why is this P2? Decreasing it doesn't correspond to the guide which explains which kind of issues are P2's
It is P2 when we apply a rule "product feature"="testability": P2 * product feature is significantly affected, a workaround may exist bug is difficult to use or impractical * intermittent crash or deadlock, happens fairly often * critical usability problem * severe performance problem * affects another developer's progress Please, fix ASAP.
Well now it seems to be working, also Jiri confirmed it. So there had to be made some change between Marek commit and my rollback which in fact made the difference. Closing as worksforme.
Verified in build 200302260100.