Skip to content

Commit 4072412

Browse files
committed
8298876: Swing applications do not get repainted coming out of sleep on Windows 10
Reviewed-by: angorya, prr
1 parent a503ec2 commit 4072412

File tree

2 files changed

+4
-92
lines changed

2 files changed

+4
-92
lines changed

src/java.desktop/windows/classes/sun/java2d/d3d/D3DScreenUpdateManager.java

+4-6
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ public Graphics2D createGraphics(SurfaceData sd,
258258
{
259259
if (!done && sd instanceof D3DWindowSurfaceData) {
260260
D3DWindowSurfaceData d3dw = (D3DWindowSurfaceData)sd;
261-
if (!d3dw.isSurfaceLost() || validate(d3dw, false)) {
261+
if (!d3dw.isSurfaceLost() || validate(d3dw)) {
262262
trackScreenSurface(d3dw);
263263
return new SunGraphics2D(sd, fgColor, bgColor, font);
264264
}
@@ -452,7 +452,7 @@ public void run() {
452452
} finally {
453453
rq.unlock();
454454
}
455-
} else if (!validate(sd, true)) {
455+
} else if (!validate(sd)) {
456456
// it is possible that the validation may never
457457
// succeed, we need to detect this and replace
458458
// the d3dw surface with gdi; the replacement of
@@ -474,7 +474,7 @@ public void run() {
474474
* @return true if surface wasn't lost or if restoration was successful,
475475
* false otherwise
476476
*/
477-
private boolean validate(D3DWindowSurfaceData sd, boolean postEvent) {
477+
private boolean validate(D3DWindowSurfaceData sd) {
478478
if (sd.isSurfaceLost()) {
479479
try {
480480
sd.restoreSurface();
@@ -491,9 +491,7 @@ private boolean validate(D3DWindowSurfaceData sd, boolean postEvent) {
491491
sd.markClean();
492492
// since the surface was successfully restored we need to
493493
// repaint whole window to repopulate the back-buffer
494-
if (postEvent) {
495-
repaintPeerTarget(sd.getPeer());
496-
}
494+
repaintPeerTarget(sd.getPeer());
497495
} catch (InvalidPipeException ipe) {
498496
return false;
499497
}

test/jdk/sun/java2d/DirectX/MultiPaintEventTest/MultiPaintEventTest.java

-86
This file was deleted.

0 commit comments

Comments
 (0)