Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Linux] Main window size changes when the update popup shows up #373

Open
abhinayagarwal opened this issue Jul 13, 2021 · 5 comments
Open
Labels
bug Something isn't working

Comments

@abhinayagarwal
Copy link
Collaborator

abhinayagarwal commented Jul 13, 2021

The issue was forked out of #352

Scene Builder window is maximed initially, but gets shrunk when the update dialog appears.

Expected Behavior

main window size is not changed.

Current Behavior

main window size is reduced.

Steps to Reproduce

  • Start SceneBuilder with mvn javafx:run -f app.
  • Close the window with the recent FXML files opened (title "Gluon Scene Builder").
  • Navigate to "Help -> Check for Update..."
  • Error popup should appear. Size of the main window is changed.

Your Environment

Linux build from master

Screenshots

scenebuilder-update-check

@abhinayagarwal abhinayagarwal added the bug Something isn't working label Jul 13, 2021
@Oliver-Loeffler
Copy link
Collaborator

I cannot reproduce this on Linux Mint 19. On which platform was this observed?

@abhinayagarwal
Copy link
Collaborator Author

I can reproduce this on Ubuntu 20.04.2 LTS

@Oliver-Loeffler
Copy link
Collaborator

I was now able to also reproduce this.
Ubuntu 20.04.2 LTS, 64bit
GNOME: 3.36.8 with X11

@Oliver-Loeffler
Copy link
Collaborator

With PR #406 the behavior is now as follows:
unknown_2021 09 08-11 30_1_noResize_cropped

In the VM where I tested that, the resize process was sometimes visible as kind of flicker.

Before PR #406 its kind of weird, never observed this in Windows.

unknown_2021 09 08-11 31_1_withResize_cropped

@abhinayagarwal
Copy link
Collaborator Author

This issue can only be replicated under the following circumstance in Scene Builder:

  1. A Stage with Modality as APPLICATION is shown
  2. This Stage is hidden, and followed by showing another Stage with Modality as APPLICATION

I tried replacing Scene Builder's Alert with a temp stage: if(showWelcomeDialog){ } block inside SceneBuilderApp#handleLaunch method. But, the issue can still be replicated:

Stage tempStage = new Stage();
tempStage.initModality(Modality.APPLICATION_MODAL);
tempStage.initOwner(null);

tempStage.setOnHidden(event -> {
    Platform.runLater(() -> {
        final Alert alert = new Alert(Alert.AlertType.INFORMATION);
        alert.showAndWait();
    });
});

tempStage.show();

While debugging Scene Builder, I couldn’t find any calls made to setWidth which might be playing with the width. Alert#showAndWait calls the native method GTKApplication#enterNestedEventLoopImpl which in turn calls Window#notifyReszie with the smaller width.

In the native code, WindowContextTop::process_configure makes a call to gdk_window_get_frame_extents(gdk_window, &frame); which gives the updated frame width. In my case the primary screen has a width of 1366 and after the alert is shown, it returns the width as 1240.

JDK-8269429 seemed to be related to this issue, so I also applied the patch from openjdk/jfx#551 to my local jfx build and tried SB with it. It doesn’t have any effect on the issue.

As this issue feels like it has more to do with JavaFX and less with Scene Builder, I created a Vanilla JavaFX sample but failed to reproduce the issue. Sample attached.

TestCase.java

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants