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

Tiling window to the left or right incorrectly shows restore button (linux only) #647

Closed
rkeen-siemens opened this issue Feb 6, 2023 · 1 comment
Milestone

Comments

@rkeen-siemens
Copy link

Reproduction Steps

  1. Launch the demo app (or any app using FlatLaf) in normal windowed mode (i.e. not maximized)
  2. Drag the window by the title bar to the left or right edge of the screen
  3. When you get the cue that it will maximize it vertically, let go

The window correctly repositions itself to be the full height and use the left or right half of the screen. On Linux, the restore button is now visible and does nothing when clicked. It should instead continue to maximize button as it does on Windows.

The issue appears to be in FlatTitlePane.frameStateChanged where it calculates the maximized variable. The value of frame.getExtendedState() is Frame.MAXIMIZED_VERT in this case. The check then comes back as true.

The resolution would be to change the check to == Frame.MAXIMIZED_BOTH instead of != 0.

It looks like Windows does not fire a frame state changed event in this case which is why it works as expected.

DevCharly added a commit that referenced this issue Feb 23, 2023
…n when tiling window to left or right half of screen (issue #647)
@DevCharly
Copy link
Collaborator

Thanks for reporting and for the details. 👍

Fixed in latest 3.1-SNAPSHOT: https://github.com/JFormDesigner/FlatLaf#snapshots

@DevCharly DevCharly added this to the 3.1 milestone Feb 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants