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 66359 - No feedback that licence agreement dialog waits for user input
Summary: No feedback that licence agreement dialog waits for user input
Status: CLOSED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 5.x
Hardware: PC Windows XP
: P3 blocker (vote)
Assignee: mslama
URL:
Keywords: JDK_SPECIFIC, USABILITY
: 145917 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-10-10 10:20 UTC by _ lcincura
Modified: 2011-06-09 09:51 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Possible patch with 'hidden'frame (2.58 KB, text/plain)
2005-10-20 10:01 UTC, mslama
Details
Modal dialog test without owner with item at window task bar using JDK 1.6 API (5.21 KB, text/plain)
2006-05-17 13:02 UTC, mslama
Details
The same as above using reflection ie. it is compilable also by JDK 1.5.0 and JDK 1.4.2 (7.18 KB, text/plain)
2006-05-17 13:03 UTC, mslama
Details

Note You need to log in before you can comment on or make changes to this bug.
Description _ lcincura 2005-10-10 10:20:52 UTC
This applies to any 5.0 build on any JDK version

When NB are started for first time, the licence agreement dialog is open and
waits for user input. But if menawhile user switches to other window, the dialog
does not come to foreground and does not have item in taskbar. This leads to
situations, when NB does not start and user does not know why.
Proper behaviour of the dialog should be blinking item displayed in taskbar.
Comment 1 _ rkubacki 2005-10-10 12:14:57 UTC
I do not agree that this is P2 bug. It should be unusal because most of users
ougth to use installer. It happens only once and there is no other impact.

To add some useful comment: system tray notification can be supported with
project that can be found on jdic.java.net. I am no sure about highlighting of
app - at least it is unlikely to work on Linux / GNOME.
Comment 2 Marian Mirilovic 2005-10-10 13:28:47 UTC
Marek, 
please look at this. I guess, you've implemented the current version, haven't you?
Comment 3 mslama 2005-10-10 14:44:42 UTC
Yes I did. License Agreement dialog is modal dialog without parent. The same
applies on Import settings dialog. I tested on Linux/Gnome: It works on JDK
1.4.2_09, JDK 6.0 build 55. It does not work (ie. not shown in Window List) on
JDK 5.0 u4,5,6 (for update 6 there is build 03). I have now idea why it happens.
Trick is to add Frame with size 0 not resizable and use it as owner of modal
dialog. It makes sure it is always displayed in Window List. Such solution is
not ideal as some actions from Window Manager - like Move - work for original
frame not for dialog. Another solution would be to use frame and emulate modal
dialog behavior somehow. It could be fragile solution as we would duplicate
modality behavior in non modal window. Let me know if solution with zero size
frame is acceptable.

I will have to test this on more platforms/window managers/JDKs. Looks like
regression in JDK (even if I did not find any description of this in javadoc but
it works in JDK 1.4.2_09 and JDK 6.0 build 55 but not in JDK 5.0 u4,5,6. I will
try to file issue against JDK with simple test case. So this can be viewed as
workaround.

Any other possible solution/idea is welcome. :)
Comment 4 Jan Chalupa 2005-10-11 08:37:11 UTC
Downgrading to P3.

Justification: Most users will never see the License Agreement dialog during the
first start, because they already agreed to it in the installer. The dialog is
shown only when NetBeans was installed from a zip archive and started for the
first time with a clean userdir. This is not supposed to be a typical scenario.

As pointed out by Marek, the Settings Import dialog behaves the same way. This
dialog has been around since NB 3.6 and based on the feedback (or lack thereof),
it has never seem to cause any problems.
Comment 5 _ lcincura 2005-10-11 09:49:35 UTC
It opens also when NB are started with clean userdir. I can imagine following
inexperienced user scenario: "I deleted .netbeans directory and is does not
start any more."
Comment 6 Jan Chalupa 2005-10-11 09:56:54 UTC
Re: "It opens also when NB are started with clean userdir."

No, it does not. If the user installs the IDE using the installer and accepts
the license there, she will never see the license dialog again no matter how
many times she starts with a clean userdir.

Please test it. If it didn't work, *that* would be a P2 bug.
Comment 7 mslama 2005-10-18 10:18:41 UTC
On Windows XP it works only with JDK 6.0 (I tested build 54). For JDK 1.4.2_09
and 5.0u4, 5.0u5 dialog is not displayed in Window List. But still you can use
Alt-TAB (or any other shortcut used for switching among windows) to see presence
of dialog or to activate it. So user is not lots completely. On Mac OSX it works
fine (10.4.2 both JDK 1.4.2 and JDK 1.5.0). I filed issue #6338130 to Bugtraq
against JDK/Swing.

We have 2 possibilities:
1.Close this issue as WONTFIX.
2.Implement workaround with hidden frame as owner for specific JDKs/OS. (It is
not appropriate implement it for working combinations as in such cases it makes
things worse - some actions from popup menu in Window List do not work correctly.)

As this could influence only minority of users (who do not install IDE using
installer), there si still possible to switch among windows using Alt-TAB and it
works fine in JDK 6.0 I prefer 1.
Comment 8 mslama 2005-10-20 09:29:42 UTC
I tried to improve situation when user starts IDE and selects another app.
Unfortunately there is no way how to front dialog when it is opened/displayed
and another app is active. requestFocus() and/or toFront() work only among
windows from one JVM. It does not have any effect when another app window is
activated/in front. (At least on Windows with JDK 5.0u5.) And as there is no
item in Window List there is no way how to indicate that dialog is displayed and
waits for user input.

Closing as WONTFIX. It is JDK/Swing problem. Hopefully it will be fixed in some
next update. It works correctly for JDK 6.0 builds. I will give update if I will
get any info from Swing team.
Comment 9 mslama 2005-10-20 10:01:04 UTC
Created attachment 26154 [details]
Possible patch with 'hidden'frame
Comment 10 mslama 2005-11-08 08:53:33 UTC
I got response form Swing team. JDialog without owner should NOT have item in
Window list. It is fixed in JDK 1.6.0-b59. Reopening this. We need to decide how
to fix this:
1.Use our own 'hidden' JFrame as owner. Simple but not ideal solution. (Popup
menu on Window list item does not work correctly - Move action.)
2.Use JFrame and worker thread to emulate blocking as with modal JDialog. It
means also change in core/startup as all methods to show dialog must not be
called in AWT thread using invokeAndWait. They will be called from original
thread and code will create worker thread. Worker thread will create and show
JFrame in AWT thread and finish when user provides input. By this way caller
will be blocked till user provides input so it will work in the same way as with
modal dialog.
Comment 11 mslama 2005-11-08 11:05:25 UTC
Solution 3: Another possible solution is to use JDK 1.6.0 code:
JDialog d = new JDialog((Window)null, "Title",
Dialog.ModalityType.APPLICATION_MODAL); 

It will work only on JDK 1.6.0. We must use reflection so that code can be
compiled with older JDK. Let me know if this solution is acceptable. If there
will be no objections I will implement this solution.
Comment 12 Marian Mirilovic 2006-01-03 10:53:47 UTC
Too late for NB5.0, please reevaluate.
Comment 13 mslama 2006-05-17 13:02:16 UTC
Created attachment 30439 [details]
Modal dialog test without owner with item at window task bar using JDK 1.6 API
Comment 14 mslama 2006-05-17 13:03:49 UTC
Created attachment 30440 [details]
The same as above using reflection ie. it is compilable also by JDK 1.5.0 and JDK 1.4.2
Comment 15 Lukas Hasik 2008-04-10 21:23:12 UTC
moving opened issues from TM <= 6.1 to TM=Dev
Comment 16 Lukas Hasik 2008-09-09 16:11:35 UTC
*** Issue 145917 has been marked as a duplicate of this issue. ***
Comment 17 Ondrej Langr 2008-09-10 13:16:08 UTC
Can we do this for 6.5? It seems that the solution is done, it just needs to be agreed upon and committed.
Comment 18 Ondrej Langr 2008-09-10 15:56:45 UTC
Since the fix is done, Marek, can you please commit it? I agree the solution is not ideal, but it is better to have it
fixed for JDK1.6 only than not to have it fixed at all. 
Comment 19 mslama 2008-09-22 13:57:53 UTC
Fixed core-main #9d2c3f31796f

JDK 6 API is used so it does not work on JDK 5. Variant 3 is used.
Comment 20 Quality Engineering 2008-09-23 18:08:21 UTC
Integrated into 'main-golden', will be available in build *200809231435* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/9d2c3f31796f
User: Marek Slama <mslama@netbeans.org>
Log: #66359: Set APPLICATION modality type for dialog so that it has item in OS WM task list on Windows on JDK 6
Comment 21 Marian Mirilovic 2011-06-09 09:51:40 UTC
v/c