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.
After upgrading to Ubuntu Oneiric (11.10), using the Unity desktop, the NetBeans main window size and position is not correctly remembered across sessions. For my regular development IDE (JDK 7u1), I always keep the main window maximized. Yet after an IDE restart it is often not maximized. For a test IDE (6u29), I will frequently keep it using near 100% horizontal space, and maybe 75% vertical and shifted toward the top of the screen (so I can see log messages from the development IDE's Output Window below). After a restart, it has usually moved down and to the right, with the right part of the window offscreen. Possibly a JRE or Unity bug, not sure. If you do not have Oneiric to test with I can help investigate if you give me some clues what APIs to look at.
Irritating enough to be worth fixing in a 7.1 patch, I think.
(In reply to comment #0) > Possibly a JRE or Unity bug, not sure. If you do not have Oneiric to test with > I can help investigate if you give me some clues what APIs to look at. that would be great, thanks! the last main window bounds are stored in WindowManager.wswmgr in Windows2Local folder in user dir. when the window system is being loaded, the bounds are checked and possibly updated in org.netbeans.core.windows.PersistenceHandler.computeBounds()
So Utilities.getUsableScreenBounds() returns 1440x900, my LCD resolution, and the main window starts out (on a fresh user dir) maximized. After shutdown, WindowManager.wswmgr says <joined-properties x="72" y="45" width="1296" height="810" .../> <separated-properties x="144" y="90" width="1152" height="72" .../> ... <screen width="1440" height="900"/> After a restart, PersistenceHandler.load calls computeBounds with the values from joined-properties above, and returns the same; ditto for separated-properties. Now the window appears centered (not maximized). I restart and the window reappears in the same place. But if after a restart I maximize the main window and shut down, it nonetheless appears centered after a restart. If I move it to the top of the screen, near-maximum width but only half height, after I restart it again appears centered and mostly full-height; the XML has not changed. But then on one startup, for no clear reason (the XML is still as above), the window is not centered but partially offscreen on both the bottom and right. DefaultView.userResizedMainWindow is called when I resize the window, but does nothing because hierarchy.getMainWindow().getExtendedState() == Frame.MAXIMIZED_BOTH, even though the window is clearly not maximized.
Note that when I run a simple j2seproject displaying a JFrame which records its bounds and extended state on exit, then maximize and close it, I get frame bounds: java.awt.Rectangle[x=-8,y=-5,width=1456,height=913] frame state: 6 on JDK 6u29 and frame bounds: java.awt.Rectangle[x=-1,y=-5,width=1442,height=906] frame state: 6 on 7u1. Similar results if I use a Timer to record bounds & state every second, and if I do not set Nimbus L&F.
Using GNOME 3 Shell rather than Unity/compiz, the results are completely different when maximized: frame bounds: java.awt.Rectangle[x=-9,y=269,width=1460,height=892] frame state: 6 and NB main window state, size, and position is retained across sessions without apparent issue. So this has something to do with the interaction between AWT and the window manager.
Also broken on Unity 2D, i.e. metacity.
Jesse, is this issue still valid?
Not sure, I am running GNOME 3 Shell these days.
This could be a duplicate of #218895 Please reopen if still reproducible in recent builds, thanks.
Not a duplicate; I only ever use one monitor.
Probably WONTFIX rather than WORKSFORME, since it does not sound like you tried to reproduce.
Cannot reproduce in Product Version: NetBeans IDE Dev (Build 20121002-039f809f68c7) Java: 1.7.0_07; Java HotSpot(TM) Client VM 23.3-b01 System: Linux version 3.2.0-23-generic-pae running on i386; UTF-8; en_US (nb)