JDK-6384461 : REGRESSION: The title bar and task bar icons differ for SWT applications
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 6
  • Priority: P3
  • Status: Closed
  • Resolution: Not an Issue
  • OS: generic
  • CPU: generic
  • Submitted: 2006-02-10
  • Updated: 2010-08-20
  • Resolved: 2006-02-28
Related Reports
Relates :  
Relates :  
Description
A DESCRIPTION OF THE REGRESSION :
When the icon of SWT application is not set, its icons are not consistent:
	title bar icon:	SWT default icon
	task bar icon:	new Java icon

When the icon of SWT application is set, its title bar icon and task
bar icon are consistent.

The related Eclipse bug is at https://bugs.eclipse.org/bugs/show_bug.cgi?id=127352.

Perhaps the change results from the rewrite of AwtFrame::OwnedSetIcon() function in j2se\src\windows\native\sun\windows\awt_Frame.cpp.

  http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6292933
  http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6280303

REPRODUCIBLE TESTCASE OR STEPS TO REPRODUCE:
-----
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

public class Test {
	public static void main(String[] args) {
		Display display = new Display();
		Shell shell = new Shell(display);
        // Uncommenting the line below fixes the problem.                
        // shell.setImage(new Image(display, "duke.gif"));
        shell.open();
		while (!shell.isDisposed ()) {
			if (!display.readAndDispatch())
				display.sleep();
		}
		display.dispose();
	}

}
-----
>javac -cp swt.jar Test.java
>java -cp swt.jar;. Test
-----
condition:
	Windows XP
	JDK 6rcb70
	SWT 3.1.2

RELEASE LAST WORKED:
5.0 Update 6

RELEASE TEST FAILS:
mustang-b70

Comments
EVALUATION The change of behaviour is related to the fix of 5106536: Windows XP taskbar icons for grouped Java apps not correct In JDK 1.5.x java.exe executable doesn't have java cup icon as a bundled resource so XP shows default icon in the window's decoration and on the task bar. When the resizable window without icon is shown (SetIcon() was not invoked for that window and NULL was specified in the hIcon/hIconSm member of WNDCLASS(EX) for RegisterClass(Ex) call), XP use Windows default icon (small frame) for window decorations but application default icon (the same that is shown in explorer) for task bar. The same (application default) icon is used when the 'group similar icons' option is turned on. This behaviour can be easily verified for the native applications, for example using MS Visual Studio.NET: 1. Create new 'MFC Applicaion' project 2. Choose 'Dialog based' as an applicaion type. 3. Check 'Think frame' option under 'User interface features' tab 4. Comment out two 'SetIcon' calls in <Your Dialog Name>::OnInitDialog() method 5. Complile and run. Note that windows default icon is shown in the window's decorations and applicaion default icon (MFC cube) is shown in the task bar. Note also that if dialog is not resizable (change 'Border' to 'Dialog Frame' in resource editor) and 'Windows XP' theme is active (behaviour can be different for other themes) *no* icon is shown in the decorations but the same application default icon is shown on task bar. The java cup icon was bundled with java executable to be shown on task bar for group of java windows. And starting from mustang b46 it is shown also for SWT application instead of default (small frame) icon. If this behaviour is not appropriate it can be changed in SWT specifying some swt-default icon when calling RegisterClassEx() function but the java cup icon will be showing for group of SWT windows anyway. Closing this as 'not a defect' because this is an intentional change and is not related to AWT in any way (AWT is not even initialized in sample test). It's possible that Microsoft will provide some API to change icon for group of windows in the future and we will provide access to this feature in AWT. This issue is tracked in the CR 4805690 so we don't close it.
28-02-2006

EVALUATION this is an intentional change and we would probably close this as a not a bug.
15-02-2006