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.

Bug 170976 - [68cat]IDE does not go to front when stopped on breakpoint
Summary: [68cat]IDE does not go to front when stopped on breakpoint
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Window System (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: mslama
URL:
Keywords:
: 171044 175498 175519 226239 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-08-27 09:58 UTC by Tomas Pavek
Modified: 2013-02-18 12:41 UTC (History)
5 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Simple test app (14.14 KB, application/octet-stream)
2009-11-10 09:28 UTC, mslama
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tomas Pavek 2009-08-27 09:58:01 UTC
There is no indication when a breakpoint is reached when debugging an application with remote attach (seen when
debugging NetBeans from NetBeans). This used to bring the debugging IDE to front. It actually works when debugging a
simple app which is run directly from the IDE. Happens both on JDK 1.5 and 1.6, this is on Vista.
Comment 1 alied 2009-09-10 13:47:13 UTC
and JDK 1.7 too. Has been reported both with Vista and XP
Comment 2 Martin Entlicher 2009-09-17 09:53:50 UTC
*** Issue 171044 has been marked as a duplicate of this issue. ***
Comment 3 Daniel Prusa 2009-09-30 16:26:12 UTC
This seems like a regression in org.openide.text.Line.show(). If a breakpoint is hit when running on Windows Vista, the
debugger calls

line.show(ShowOpenType.REUSE, ShowVisibilityType.FOCUS);
line.show(ShowOpenType.OPEN, ShowVisibilityType.FRONT);

but nothing happens - IDE does not go to front, neither the task bar blinks.
In nb 6.5 it works partially, the task bar blinks, but IDE is not brought to front.

Reassigning for evaluation.
Comment 4 Martin Entlicher 2009-10-27 11:15:44 UTC
*** Issue 175498 has been marked as a duplicate of this issue. ***
Comment 5 Martin Entlicher 2009-10-27 15:07:21 UTC
*** Issue 175519 has been marked as a duplicate of this issue. ***
Comment 6 stefan79 2009-11-10 01:42:15 UTC
???

The problem is still alive. Also on WinXp.
Comment 7 mslama 2009-11-10 09:27:11 UTC
Does it happen also with simple Java app? I attach simple Java app with JFrame. Put breakpoint to line 66. It will be met on pressing button. What happens? I tested with dev build, 6.7.1, 6.5.1, JDK 6u17, Linux/Gnome. With dev build:
1.Put BP on line 66. Debug file from IDE. Test app window is active.
2.Press button inside frame.
3.IDE main window is activated and cursor is blinking inside editor as expected. Only IDE main window is not fronted but it is feature of OS WM.

The same with 6.7.1. It does NOT work with 6.5.1 though. Please can you test the same on Windows and let me know? I will try the same at home with Vista.
Comment 8 mslama 2009-11-10 09:28:18 UTC
Created attachment 90726 [details]
Simple test app
Comment 9 stefan79 2009-11-10 09:44:22 UTC
In my Case it´s a simple JavaApplication on WindowsXp.
I can´t start your Sample-Project:
java.lang.NullPointerException
        at org.netbeans.modules.debugger.jpda.ant.JPDAStart.execute(JPDAStart.java:222)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
        at sun.reflect.GeneratedMethodAccessor446.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)

I think this is Bug 176042.
Comment 10 Tomas Pavek 2009-11-10 11:39:05 UTC
Spent some time playing with it and it seems that if during the IDE session I do *not* focus the windows console (command prompt window), then it works - i.e. IDE goes to front on breakpoint. If some console win gets active (selected in task bar), then it's not working since then. It's kind of strange, but I see this behavior pretty consistently.

Also when the console window is selected (switched to) during IDE start then the IDE does not go to front on breakpoint. In this case the IDE even does not come to front after the startup (which it otherwise does) - just blinks in the task bar.

If this is some kind of OS or JDK issue, I'd try to investigate if we can't get at least the same behavior as with the startup - i.e. blink in task bar if not coming to front (on breakpoint). That would be way better than do nothing.
Comment 11 mslama 2009-11-11 00:36:42 UTC
Yes build 200911091156 (last available for download yesterday) still fails to debug with NPE. Alternatively you can get latest dev build from continuous builder eg. from http://deadlock.netbeans.org/hudson/job/NB-Core-Build/ws/nbbuild/ There is latest dev build zip from core-main repo.
Comment 12 mslama 2009-11-11 01:33:21 UTC
When focus change happens between 2 separate native windows then winsys calls TopComponent.requestFocus. Then it is up to OS WM what will happen. Unfortunately on Vista, JDK 6u17 it does not work. Still test app window is active ie. selected on task bar. I am afraid there is nothing more we can do. I can ask Swing team what we can expect.

Here is call stack when TopComponent.requestFocus is called by winsys as result of Line.show call:
++
++ ESLS.show tc: INVOKE requestActive
++ TC.requestFocus tc:NewJFrame.java
java.lang.Exception
        at org.openide.windows.TopComponent.requestFocus(TopComponent.java:760)
        at org.openide.text.CloneableEditor.requestFocus(CloneableEditor.java:912)
        at org.netbeans.core.multiview.MultiViewPeer.requestFocus(MultiViewPeer.java:249)
        at org.netbeans.core.multiview.MultiViewCloneableTopComponent.requestFocus(MultiViewCloneableTopComponent.java:153)
        at org.netbeans.core.windows.view.ui.AbstractModeContainer.focusSelectedTopComponent(AbstractModeContainer.java:198)
        at org.netbeans.core.windows.view.ModeView.focusSelectedTopComponent(ModeView.java:161)
        at org.netbeans.core.windows.view.ViewHierarchy.activateModeView(ViewHierarchy.java:395)
        at org.netbeans.core.windows.view.ViewHierarchy.activateMode(ViewHierarchy.java:389)
        at org.netbeans.core.windows.view.DefaultView.changeGUI(DefaultView.java:416)
        at org.netbeans.core.windows.ViewRequestor.dispatchRequest(ViewRequestor.java:269)
        at org.netbeans.core.windows.ViewRequestor.processRequest(ViewRequestor.java:245)
        at org.netbeans.core.windows.ViewRequestor.postRequest(ViewRequestor.java:183)
        at org.netbeans.core.windows.ViewRequestor.scheduleRequest(ViewRequestor.java:123)
        at org.netbeans.core.windows.Central.activateModeTopComponent(Central.java:1761)
        at org.netbeans.core.windows.WindowManagerImpl.topComponentRequestActive(WindowManagerImpl.java:1145)
        at org.openide.windows.TopComponent.requestActive(TopComponent.java:798)
        at org.openide.text.EditorSupportLineSet$SupportLine.show(EditorSupportLineSet.java:143)
        at org.openide.text.Line.show(Line.java:324)
        at org.netbeans.modules.debugger.jpda.projects.EditorContextImpl.showSourceLine(EditorContextImpl.java:185)
        at org.netbeans.modules.debugger.jpda.projects.EditorContextImpl.showSource(EditorContextImpl.java:170)
        at org.netbeans.modules.debugger.jpda.ui.SourcePath$2.run(SourcePath.java:367)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
        at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:125)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Comment 13 mslama 2009-11-11 01:38:17 UTC
Weird with 6.7.1 the same test case works. I will investigate further.
Comment 14 mslama 2009-11-11 01:40:40 UTC
It looks like some timing issue. Sometimes IDE window is fronted, sometimes it just blinks on taskbar.
Comment 15 alied 2009-11-16 10:22:33 UTC
Debugging a standard Java application on Vista, I never know when the debugger stops (Nor NB gets focus, nor the task button blinks). I must guess it when the application stops.

Product Version: NetBeans IDE Dev (Build 200911160201)
Java: 1.7.0-ea; Java HotSpot(TM) Client VM 16.0-b06
System: Windows Vista version 6.0 running on x86; Cp1252; es_ES (nb)
Comment 16 stefan79 2009-11-17 05:26:22 UTC
At WindowsXP, Java-Application it doesn´t works.

Product Version: NetBeans IDE Dev (Build 200911161401)
Java: 1.6.0_17; Java HotSpot(TM) Client VM 14.3-b01
System: Windows XP version 5.1 running on x86; Cp1252; de_AT (nb)
Comment 17 Tomas Pavek 2009-11-19 10:34:49 UTC
Marek Slama has a fix (or workaround) for this, but it does not seem safe for 6.8 to be integrated so late. Probably a candidate for patch.
Comment 18 mslama 2009-11-20 02:04:54 UTC
I will commit fix to trunk once 68 is cloned. Calling toFront on top level window before requestFocus is called on TopComponent improves situation. As mentioned above we do not want to risk any regression for another use case so we will not put fix into 68 so late.
Comment 19 mslama 2009-11-23 06:36:31 UTC
core-main #d810f42fca9f

Please test on all platforms. toFront is called on top level window. It should improve situation.
Comment 20 Stanislav Aubrecht 2009-11-24 01:16:24 UTC
on mac os x 10.6.2, jdk 1.6.0_15 the debugger window isn't fronted when a breakpoint is hit - it's the same behavior as without this fix
Comment 21 stefan79 2009-11-24 02:04:14 UTC
is this fix at 200911230200 available?
Comment 22 mslama 2009-11-24 05:50:56 UTC
Changeset is not yet in main-golden so no. Once it gets into build it should be noted here as usual.
Comment 23 Quality Engineering 2009-11-24 19:07:23 UTC
Integrated into 'main-golden', will be available in build *200911241400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/d810f42fca9f
User: Marek Slama <mslama@netbeans.org>
Log: #170976: Try to front newly focused window when focus is transferred between windows.
Comment 24 stefan79 2009-11-26 03:05:34 UTC
At WinXp the window doesn´t go to front but it blinks in the taskbar (1.6u17).

That´s better then before.
Comment 25 alied 2009-11-26 08:20:13 UTC
Likewise in Vista:
The NetBeans window blink. That's something
Comment 26 Jiri Kovalsky 2013-02-18 12:41:58 UTC
*** Bug 226239 has been marked as a duplicate of this bug. ***