Skip to content

Window resizing not possible after javafx alert

Submitted by spawn

Assigned to Eric Koegel

Link to original bug (#14371)

Description

Hi,
after an alert of a javafx application, instead of resizing the window is moved. Maximizing/ unmaximizing it is still possible though. I have tested this on debian stretch (only default packages), however, looking at

https://stackoverflow.com/questions/33134791/javafx-stage-cant-be-resized-after-showing-a-dialog

the bug seems to be around some time. It might well be possible, that this is primarily a bug in javafx, however, I have tested the windowmanagers compiz, mutter, marco, openbox, kwin and muffin; xfwm4 is currently the only one where that happens. In above stackoverflow question there is also a minimal example to reproduce, which i copy here for completeness:

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Alert;
import javafx.scene.control.Button;
import javafx.scene.control.ButtonType;
import javafx.scene.control.Alert.AlertType;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;

public class StageTest extends Application {

    @Override
    public void start(Stage primaryStage) throws Exception {
        primaryStage.setTitle("Hello World!");
        Button btn = new Button();
        btn.setText("Show Alert");
        btn.setOnAction(e -> {
            Alert alert = new Alert(AlertType.WARNING, "This is an alert", ButtonType.YES);
            alert.showAndWait();
        });
        StackPane root = new StackPane();
        root.getChildren().add(btn);
        primaryStage.setScene(new Scene(root, 1000, 850));
        primaryStage.show();
    }

    public static void main(String[] args) {
        launch(args);
    }
}

Thanks in advance for taking the time to fix this.
Best regards
spawn

Version: 4.12.0

Edited by Yousuf Philips