Skip to content

Commit

Permalink
JBR-6316 Wayland: WLSMSurfaceData.getReplacement() throws UOE
Browse files Browse the repository at this point in the history
Also fixed the keyboard repeat manager so that it does not prevent
application from shutting down.
Also improved fullscreen support.
  • Loading branch information
mkartashev authored and jbrbot committed Nov 8, 2024
1 parent b8b08a3 commit a36c960
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,15 @@ public void setFullScreenWindow(Window w) {
return;
}

boolean fsSupported = isFullScreenSupported();
if (fsSupported && old != null) {
// enter windowed mode and restore original display mode
exitFullScreenExclusive(old);
}

super.setFullScreenWindow(w);

if (isFullScreenSupported()) {
if (fsSupported) {
if (w != null) {
enterFullScreenExclusive(w);
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/java.desktop/unix/classes/sun/awt/wl/WLKeyboard.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class WLKeyboard {
}

private class KeyRepeatManager {
private final Timer timer = new Timer();
private final Timer timer = new Timer("WLKeyboard.KeyRepeatManager", true);
private TimerTask currentRepeatTask;
private int delayBeforeRepeatMillis = 500;
private int delayBetweenRepeatMillis = 50;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,12 @@ public static WLSMSurfaceData createData(WLComponentPeer peer, WLSMGraphicsConfi

@Override
public SurfaceData getReplacement() {
throw new UnsupportedOperationException("Not implemented yet");
// It does not seem possible in Wayland to get your window's surface
// change mid-flight such that it needs a replacement.
// The only scenario when a surface gets forcibly invalidated is
// after WLComponentPeer.dispose(), at which point the surface
// is no longer needed anyway.
return null;
}

@Override
Expand Down

0 comments on commit a36c960

Please sign in to comment.