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 257105 - Window System refresh problem
Summary: Window System refresh problem
Status: NEW
Alias: None
Product: platform
Classification: Unclassified
Component: Window System (show other bugs)
Version: 8.0.2
Hardware: PC Windows 7
: P2 normal with 1 vote (vote)
Assignee: Theofanis Oikonomou
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-10 23:23 UTC by Geertjan Wielenga
Modified: 2016-01-20 10:28 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Geertjan Wielenga 2015-12-10 23:23:12 UTC
https://github.com/GeertjanWielenga/AwesomeApp

Run the above and notice that the editor tab is correctly removed, e.g., open the Web Browser from Windows | Web after running the above and the editor tab is gone.

Then go to the Installer class and remove "sleep(500)". Now the editor tab is not removed, which is incorrect, especially on subsequent runs.

Why is this? This is a problem from 8.0.2 onwards, possibly from 8.0. Why is a sleep needed here when it wasn't needed before?
Comment 1 jla 2015-12-11 00:06:23 UTC
I ran into the same issue trying to follow the NetBeans Platform Tutorial for Geospatial Systems[0] with NB 8.0.2 or NB 8.1. After some help applying the AwesomeApp work-around with an OnStartInstaller and an OnShowingInstaller I had to bump the sleep up to 3250 to get the tabs to disappear on my system. Even 3000ms wasn't enough.

On the other hand just a few moments ago when AwesomeApp ran a few times in a row with the sleep commented out and still suppressed the tab, the Geospatial program needed to be bumped up to 3500ms to get the tabs to stay hidden on subsequent runs.

Windows 10, 64 bit
1.8.0_25; Java HotSpot(TM) 64-Bit Server VM 25.25-b02; Oracle Corporation
Athlon 64 X2 Dual Core 6000+ 3.00 GHz, 8.00 GB RAM

0) https://platform.netbeans.org/tutorials/nbm-geospatial.html
Comment 2 Theofanis Oikonomou 2016-01-18 16:09:10 UTC
AFAICT the @OnStart is invoked on start of your module and the @OnShowing as soon as the window system is shown. Now, the problem is that the @OnStart executes in parallel. This is "fixed" with the artificial sleep. 

The way I could make it work reliably was to add a WindowSystemListener on WindowManager and put the UIManager.put("EditorTabDisplayerUI", "org.aa.core.NoTabsTabDisplayerUI"); in the beforeLoad method. You should remove the listener after load. Would that be acceptable solution for you?
Comment 3 Geertjan Wielenga 2016-01-19 20:17:32 UTC
Why are they running in parallel? That seems to be new in 8.0 or 8.1.
Comment 4 Theofanis Oikonomou 2016-01-20 10:28:13 UTC
(In reply to Geertjan Wielenga from comment #3)
> Why are they running in parallel? That seems to be new in 8.0 or 8.1.

AFAICT @OnStart was implemented this way from the start in order to boost startups. Bug 200636 introduced this.