In Windows our users have seen our whole application window become non responsive after restoring from sleep. I managed to narrow this down on one system and it appears to be more tied to the number of displays changing (since I believe most laptops with an external monitor will switch back to just their primary display when sleeping).
I have managed to duplicate this behavior with a simple stage test class and the following procedure:
1. Configure your Windows system to use 2 displays in an extended desktop. (On my laptop this means with an external display set as the primary display)
2. Run the provided test class so it displays on the primary display.
3. Use the menu Test -> New Progress Bar to create a progress bar and observe the stage is responding to input properly and rendering properly.
4. Switch your display config to not use the second display. (On my laptop this is easiest by using the Windows Key + P shortcut to pick "Projector Only").
5. Observe that the progress bar animation has stopped and the menu is not responding to the mouse. Resizing the window does not cause it to update or re-render.
6. Switch back to the original dual display config (Windows Key + P and choose "Extend")
7. Usually the progress bar animation resumes.
Hopefully you can reproduce this issue. I saw it very intermittently until I stumbled upon this exact procedure. It seems to help to always go back to dual screen before closing the window and trying again.
Below is also the prism.verbose output for my system:
Prism pipeline init order: d3d sw
Using platform text rasterizer
Using native-based Pisces rasterizer
Using dirty region optimizations
Not using texture mask for primitives
Not forcing power of 2 sizes for textures
Using hardware CLAMP_TO_ZERO mode
Opting in for HiDPI pixel scaling
Prism pipeline name = com.sun.prism.d3d.D3DPipeline
Loading D3D native library ...
succeeded.
D3DPipelineManager: Created D3D9 device
Direct3D initialization succeeded
(X) Got class = class com.sun.prism.d3d.D3DPipeline
Initialized prism pipeline: com.sun.prism.d3d.D3DPipeline
Maximum supported texture size: 8192
Maximum texture size clamped to 4096
OS Information:
Windows 7 build 7601
D3D Driver Information:
Intel(R) HD Graphics 4000
\\.\DISPLAY2
Driver igdumdim64.dll, version 9.18.10.3359
Pixel Shader version 3.0
Device : ven_8086, dev_0166, subsys_21F317AA
Max Multisamples supported: 4
vsync: true vpipe: true
With our actual application encountering this bug I have also seen the following output to the console as the stage stops responding:
Outstanding resource locks detected:
D3D Vram Pool: 43,835,334 used (16.3%), 43,835,334 managed (16.3%), 268,435,456 total
98 total resources being managed
average resource age is 122.8 frames
0 resources at maximum supported age (0.0%)
6 resources marked permanent (6.1%)
1 resources have had mismatched locks (1.0%)
1 resources locked (1.0%)
50 resources contain interesting data (51.0%)
0 resources disappeared (0.0%)
************************************************* Test Class *************************************************
import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Scene;
import javafx.scene.control.Menu;
import javafx.scene.control.MenuBar;
import javafx.scene.control.MenuItem;
import javafx.scene.control.ProgressBar;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.Region;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
public class ScreenSwitchTest extends Application {
@Override public void start(final Stage primaryStage) throws Exception {
primaryStage.centerOnScreen();
primaryStage.setHeight(200);
primaryStage.setWidth(360);
final VBox box = new VBox(20);
box.setMaxSize( Region.USE_PREF_SIZE, Region.USE_PREF_SIZE );
MenuItem item = new MenuItem("New Progress Bar");
item.setOnAction(new EventHandler<ActionEvent>() {
@Override public void handle(ActionEvent event) {
box.getChildren().add(new ProgressBar(-1));
}
});
Menu menu = new Menu("Test");
menu.getItems().add(item);
MenuBar menuBar = new MenuBar();
menuBar.getMenus().add(menu);
BorderPane borderPane = new BorderPane();
borderPane.setTop(menuBar);
borderPane.setCenter(box);
primaryStage.setScene(new Scene(borderPane));
primaryStage.show();
}
public static void main(String[] args) throws Exception {
launch(args);
}
}
I have managed to duplicate this behavior with a simple stage test class and the following procedure:
1. Configure your Windows system to use 2 displays in an extended desktop. (On my laptop this means with an external display set as the primary display)
2. Run the provided test class so it displays on the primary display.
3. Use the menu Test -> New Progress Bar to create a progress bar and observe the stage is responding to input properly and rendering properly.
4. Switch your display config to not use the second display. (On my laptop this is easiest by using the Windows Key + P shortcut to pick "Projector Only").
5. Observe that the progress bar animation has stopped and the menu is not responding to the mouse. Resizing the window does not cause it to update or re-render.
6. Switch back to the original dual display config (Windows Key + P and choose "Extend")
7. Usually the progress bar animation resumes.
Hopefully you can reproduce this issue. I saw it very intermittently until I stumbled upon this exact procedure. It seems to help to always go back to dual screen before closing the window and trying again.
Below is also the prism.verbose output for my system:
Prism pipeline init order: d3d sw
Using platform text rasterizer
Using native-based Pisces rasterizer
Using dirty region optimizations
Not using texture mask for primitives
Not forcing power of 2 sizes for textures
Using hardware CLAMP_TO_ZERO mode
Opting in for HiDPI pixel scaling
Prism pipeline name = com.sun.prism.d3d.D3DPipeline
Loading D3D native library ...
succeeded.
D3DPipelineManager: Created D3D9 device
Direct3D initialization succeeded
(X) Got class = class com.sun.prism.d3d.D3DPipeline
Initialized prism pipeline: com.sun.prism.d3d.D3DPipeline
Maximum supported texture size: 8192
Maximum texture size clamped to 4096
OS Information:
Windows 7 build 7601
D3D Driver Information:
Intel(R) HD Graphics 4000
\\.\DISPLAY2
Driver igdumdim64.dll, version 9.18.10.3359
Pixel Shader version 3.0
Device : ven_8086, dev_0166, subsys_21F317AA
Max Multisamples supported: 4
vsync: true vpipe: true
With our actual application encountering this bug I have also seen the following output to the console as the stage stops responding:
Outstanding resource locks detected:
D3D Vram Pool: 43,835,334 used (16.3%), 43,835,334 managed (16.3%), 268,435,456 total
98 total resources being managed
average resource age is 122.8 frames
0 resources at maximum supported age (0.0%)
6 resources marked permanent (6.1%)
1 resources have had mismatched locks (1.0%)
1 resources locked (1.0%)
50 resources contain interesting data (51.0%)
0 resources disappeared (0.0%)
************************************************* Test Class *************************************************
import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Scene;
import javafx.scene.control.Menu;
import javafx.scene.control.MenuBar;
import javafx.scene.control.MenuItem;
import javafx.scene.control.ProgressBar;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.Region;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
public class ScreenSwitchTest extends Application {
@Override public void start(final Stage primaryStage) throws Exception {
primaryStage.centerOnScreen();
primaryStage.setHeight(200);
primaryStage.setWidth(360);
final VBox box = new VBox(20);
box.setMaxSize( Region.USE_PREF_SIZE, Region.USE_PREF_SIZE );
MenuItem item = new MenuItem("New Progress Bar");
item.setOnAction(new EventHandler<ActionEvent>() {
@Override public void handle(ActionEvent event) {
box.getChildren().add(new ProgressBar(-1));
}
});
Menu menu = new Menu("Test");
menu.getItems().add(item);
MenuBar menuBar = new MenuBar();
menuBar.getMenus().add(menu);
BorderPane borderPane = new BorderPane();
borderPane.setTop(menuBar);
borderPane.setCenter(box);
primaryStage.setScene(new Scene(borderPane));
primaryStage.show();
}
public static void main(String[] args) throws Exception {
launch(args);
}
}
- duplicates
-
JDK-8093209 NPE in PPSRenderer (when display disconnected?)
- Resolved