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.
To reproduce: - open several files (JS, HTML etc.) - run some HTML file that is using console.log so something is printed to Browser log window and it is opened - switch to one file in IDE, place cursor in it - switch to another file, place cursor in it - switch back to the first file => cursor (focus) is placed in Browser log instead of the first file Product Version: NetBeans IDE Dev (Build web-main-9149-on-20121108) Java: 1.7.0_10-ea; Java HotSpot(TM) Client VM 23.6-b04 Runtime: Java(TM) SE Runtime Environment 1.7.0_10-ea-b11 System: Linux version 3.2.0-32-generic-pae running on i386; UTF-8; en_US (nb)
I cannot reproduce it. Does something new gets logged into the Browser log or not?
There was just some logging that happened on document.ready but this was happening after time after the log was printed. I'm sorry, I can't reproduce it in today's trunk build :/
I noticed some more information when I reproduced it in today's build: - open JS file and HTML file in IDE - run html file in browser, some logging were produced and showed in Browser log - edit JS file - switch to HTML file using Ctrl+Tab => Browser log has focus, now if I switch back to JS file with Ctrl+Tab, JS file has correctly focus. Switching back again to HTML again makes Browser log focused instead of editor Product Version: NetBeans IDE Dev (Build 201211180002) Java: 1.7.0; Java HotSpot(TM) 64-Bit Server VM 21.0-b17 Runtime: Java(TM) SE Runtime Environment 1.7.0-b147 System: Linux version 3.5.0-18-generic running on amd64; UTF-8; en_US (nb)
Also it happens only if CSS Styles window is opened. Once I close it, the focus is where it supposed to be.
Created attachment 128023 [details] test project
I can reproduce it now. Thanks Vlada. It looks to me like a Window System issue. Few observations: * when focus is lost it is not in Browser Log output window - I actually do not know where it is because no keyboard action has any visual impact * the problem happens only when "Browser Log" and "CSS Styles" are opened at the same time * rearranging CSS Styles and Browser Log windows make problem go away; and by rearranging I mean dragging Browser Log somewhere else (when non-HTML file is selected in editor) and then drag it back and everything is OK from now on I'm attaching simple test project. Open it in IDE and: * open both html and js file from the Site Root * run project (will open Browser Log) * focus editor and use Ctrl-Tab to switch between js and html -> focus get lots when you switch yo HTML and CSS Styles window becomes visible.
It's not a window system issue. You can press Ctrl+Shift+Pause/Break keys to print currently focused component into IDE log. When I tried the steps to reproduced provided above the focus was either in CSS Styles window's toolbar or in its property sheet (SheetTable) even though it's empty.
>the focus was either in CSS Styles window's toolbar can anyone with good knowledge of the steps to reproduce check if web-main#fafd9eb49a50 helps please? Thanks. >or in its property sheet (SheetTable) >even though it's empty. I don't know what (if) can I do about that. Lets first check if the fix above helps.
I'll try it tomorrow
I'm sorry, not fixed. If you try David's steps from comment #6, you can press Ctrl+W to close the focused window and CSS Styles are closed. The reason I thought Browser log steals it, is that it has blinking "|" (cursor) inside and Ctrl+Shift+PauseBreak prints *** ShortcutAndMenuKeyEventProcessor: current focus owner = javax.swing.JEditorPane[,0,-16,1537x276,layout=javax.swing.plaf.basic.BasicTextUI$UpdateHandler,alignmentX=0.0,alignmentY=0.0,border=javax.swing.plaf.synth.SynthBorder@e75f90,flags=296,maximumSize=,minimumSize=,preferredSize=,caretColor=javax.swing.plaf.ColorUIResource[r=0,g=0,b=0],disabledTextColor=javax.swing.plaf.ColorUIResource[r=255,g=255,b=255],editable=false,margin=javax.swing.plaf.InsetsUIResource[top=3,left=3,bottom=3,right=3],selectedTextColor=javax.swing.plaf.ColorUIResource[r=255,g=255,b=255],selectionColor=javax.swing.plaf.ColorUIResource[r=154,g=154,b=154],kit=org.netbeans.core.output2.OutputEditorKit@c6a2c1,typeHandlers=] but Ctrl+W closes CSS Styles and not Browser log... If I close CSS Styles window, open it again and repeat the steps again (so run html again and start switching tabs using Ctrl+Tab), the shortcut gives me *** ShortcutAndMenuKeyEventProcessor: current focus owner = org.netbeans.modules.navigator.NavigatorTC[Navigator,1,0,334x448,layout=java.awt.BorderLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=320,maximumSize=,minimumSize=,preferredSize=] I still can't write anywhere visible, but Ctrl+W closes editor window as expected. So editor "doesn't seem to have cursor" Product Version: NetBeans IDE Dev (Build web-main-9264-on-20121120) Java: 1.7.0_10-ea; Java HotSpot(TM) Client VM 23.6-b04 Runtime: Java(TM) SE Runtime Environment 1.7.0_10-ea-b16 System: Linux version 3.2.0-33-generic-pae running on i386; UTF-8; en_US (nb)
(In reply to comment #10) > The reason I thought Browser log steals it, is that it has blinking "|" > (cursor) inside That never happened to me. Dumping focus I'm getting: *** ShortcutAndMenuKeyEventProcessor: current focus owner = null but CTRL-W does close the source editor. I'm running with Marek's fix as well.
Integrated into 'main-golden', will be available in build *201211211016* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/fafd9eb49a50 User: Marek Fukala <mfukala@netbeans.org> Log: #221692 - do not request focus for filter field in the DocumentViewPanel constructor