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.
[s1s5](030521), [jdk1.4.1](02) Steps to reproduce: - run IDE in SDI mode - open some java file - push from main menu Window | Explorer -> Explorer isn't focused neither radiobutton isn't selected !
This is part of more general focus transfer behaviour: In SDI native frames are used. Simple call of requestFocus() does not guarantee that focus is transferred between native windows (such problem is not present in MDI). In current Window System API there is no way how to transfer focus between native windows. Here I must say: It works on Windows but it does NOT work on Linux. (Not sure about Solaris now.) In JDK API there is method Window.toFront() which is more agressive it fronts window and focuses it (not always but at least more probably on Linux). toFront() was used in TopFrameTypeImpl.setSelected() BUT it breaks focus follows mouse behaviour: It fronted NB SDI windows as mouse cursor was just moved over. So as fix of issue #31076 Peter removed call of toFront() from setSelected(). BUT now focus transfer does NOT work as in this issue. Another example: When you open some source file in source editor - file is opened but focus stays in explorer. One another example: Double click on file in explorer which is already opened in source editor. In MDI focus is transferred to source editor in SDI focus stays in explorer. Question: Shall we manage focus in SDI in the same way as we do in MDI?
It would mean to modify behaviour of TopComponent.requestFocus() to call Window.toFront() when TopComponent's parent window is not yet focused.
One additional thing: Why TopFrameTypeImpl has non empty setSelected()?
Fixed in main trunk. Method toFront() is now called from TopFrameTypeImpl.requestFocus(). Tested 'focus follows mouse' mode due to issue #31076 because to fix #31076 call of toFront() was removed. Focus follows mouse mode works correctly (Tested on Linux KDE and Solaris CDE.) Focus is now requested from TopFrameTypeImpl.setSelected(true) only when window is not focused. Fix of issue #29939 was changed we tested on windows that focus cycling does not happen. So method tryRequestFocus() was removed. Fix also fixes SDI window activation when openign file or double clicking file in Explorer -> Source Editor frame is selected and focused. Modified: core/windows/src/org/netbeans/core/windows/frames/TopFrameTypeImpl.java r.1.3
*** Issue 33814 has been marked as a duplicate of this issue. ***
verified in [nb_dev](200306110100)
*** Issue 32716 has been marked as a duplicate of this issue. ***
*** Issue 34935 has been marked as a duplicate of this issue. ***
*** Issue 35824 has been marked as a duplicate of this issue. ***