United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: 4845341 REG: Focus problem with "Desktop Integration" Webstart prompt and Webstart app
4845341 : REG: Focus problem with "Desktop Integration" Webstart prompt and Webstart app

Details
Type:
Bug
Submit Date:
2003-04-09
Status:
Resolved
Updated Date:
2003-08-19
Project Name:
JDK
Resolved Date:
2003-08-19
Component:
deploy
OS:
windows_xp,windows_2000
Sub-Component:
webstart
CPU:
x86
Priority:
P3
Resolution:
Fixed
Affected Versions:
1.4.2
Fixed Versions:
5.0

Related Reports
Duplicate:

Sub Tasks

Description

Name: nt126004			Date: 04/08/2003


FULL PRODUCT VERSION :
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2-beta-b19)
Java HotSpot(TM) Client VM (build 1.4.2-beta-b19, mixed mode)

FULL OS VERSION :
Microsoft Windows XP [Version 5.1.2600]

A DESCRIPTION OF THE PROBLEM :
My Webstart application has an initial popup (a JDialog) which asks the user for login information, and this JDialog is created before any JFrame.

When launched via Webstart, Webstart's "Desktop Integration" prompt (which asks the user "Would you like to have 'appname' integrated into your desktop environment?" fights for focus with my app's initial JDialog.  The Webstart prompt seems to put itself on "top" of my dialog, it is impossible to select any of the Webstart choices because actual focus remains on the JDialog.

Once my app's login dialog has been filled in and is gone, the user can then make a choice on the Webstart "Desktop Integration" prompt.


STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
I have the testcase below available via Webstart at http://www.classgrabber.com/webstart/focus.jnlp

The "real application" (non-testcase app) is available at http://www.classgrabber.com/webstart/agent.jnlp
When Webstart's "Desktop Integration" comes up, select "Ask later" so you can repeat the problem (If you select "Yes" or "No", web start won't prompt anymore).


EXPECTED VERSUS ACTUAL BEHAVIOR :
As in previous versions, Webstart doesn't actually run the application until the user has answered Webstart's prompt "do you want to add this item to your desktop".  This avoids focus problems.
Since Webstart now runs the application while the Webstart "Desktop Integration" prompt is still up, there is a "fight for focus" and it is confusing to the user.

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
import java.awt.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.*;

/**
 * AVAILABLE AT: http://www.classgrabber.com/webstart/focus.jnlp
 * Focus test case for webstart problem.
 * PLEASE NOTE that even though this JDialog doesn't have any input fields,
 * in my real app, there are input fields, and it is confusing to the
 * user where the focus is.
 */

public class FocusProblem {
	public static void main(String args[]) {
		JFrame frame = new JFrame() {
			public Dimension getPreferredSize() {
				return new Dimension(200, 100);
			}
		};
		frame.setTitle("Debugging frame");
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.pack();
		frame.setVisible(false);

		JDialog dialog = new JDialog(frame, true);
		dialog.getContentPane().add(new JLabel("foo"));
		dialog.addWindowListener(new WindowAdapter() {
			public void windowClosing(WindowEvent event) {
				System.exit(0);
			}
			public void windowClosed(WindowEvent event) {
				System.exit(0);
			}
		});
		dialog.pack();
		dialog.setVisible(true);
	}
}

---------- END SOURCE ----------

Release Regression From : 1.2
The above release value was the last known release where this 
bug was known to work. Since then there has been a regression.

(Review ID: 183475) 
======================================================================

                                    

Comments
SUGGESTED FIX

We eventually went to an all synchronous desktop integration in tiger, and we should backport this to mantis too.
see: http://dtsw.eng.sun.com/cgi-bin/bugtraq_showbug?bugid=4825415
                                     
2004-08-31
WORK AROUND

configure desktop integration as "allways" or Never"
                                     
2004-08-31
CONVERTED DATA

BugTraq+ Release Management Values

COMMIT TO FIX:
tiger

FIXED IN:
tiger

INTEGRATED IN:
tiger
tiger-b16


                                     
2004-08-31
EVALUATION

This is a regression, in that previous versions synchronously asked user for desktop integration.  Problem only occurs for application that start with modal dialog that comes up 2 - 8 seconds after launch. (before 2 seconds, the desktop integration dialog will be last modal dialog, after 8, desktop integration dialog dosn't try to put itself on top).
Problem is easy to work around (after 8 seconds, bring applications modal dialog to the top, and answer it.) but still annoying.
Java Web Start should not bring the Desktop Integration Dialog to the top over
another modal dialog.
should fix for tiger.

###@###.### 2003-04-10
                                     
2003-04-10



Hardware and Software, Engineered to Work Together