JDK-8095779 : Invalid focus behavior when minimizing application using its taskbar icon (Windows)
  • Type: Bug
  • Component: javafx
  • Sub-Component: window-toolkit
  • Affected Version: 8u20
  • Priority: P4
  • Status: Resolved
  • Resolution: Duplicate
  • Submitted: 2014-04-04
  • Updated: 2015-06-12
  • Resolved: 2014-04-11
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8
8u20Resolved
Related Reports
Duplicate :  
Relates :  
Description
Code to reproduce the issue:

import javafx.application.Application;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.scene.Scene;
import javafx.scene.control.TextField;
import javafx.stage.Stage;

public class Test7 extends Application
{
	public static void main(final String[] args)
	{
		launch(args);
	}

	@Override
	public void start(final Stage primaryStage) throws Exception
	{
		final TextField field = new TextField();
		field.setPrefColumnCount(30);
		field.setEditable(true);
		field.focusedProperty().addListener(new ChangeListener<Boolean>()
		{
			@Override
			public void changed(final ObservableValue<? extends Boolean> observable, final Boolean oldValue, final Boolean newValue)
			{
				System.out.println("focus: " + newValue);
			}
		});

		primaryStage.setScene(new Scene(field));
		primaryStage.show();

		field.requestFocus();
	}
}

There's a focused text field in a window. Minimizing the window using its "_" button causes the text field to lose its focus (see "focus: false" in console). Restoring the window makes the text field being focused again (see "focus: true" in console).
Minimizing the window by clicking its icon on the Windows taskbar makes the field lose and instantly regain its focus (the output is "focus: false focus: true").

This is related to RT-36089 and DTL-6679 as these are tickets describing invalid behavior of popup windows depending on correct focus behavior.
Comments
This issue is going to be resolved with a fix for RT-31272 in 8u20. So I'm closing this bug as a duplicate of that one.
11-04-2014