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

Windows 11 Snap Layouts don't work with FlatLaf #407

Closed
amberream opened this issue Oct 29, 2021 · 4 comments
Closed

Windows 11 Snap Layouts don't work with FlatLaf #407

amberream opened this issue Oct 29, 2021 · 4 comments
Milestone

Comments

@amberream
Copy link

When I create a new JFrame and set the FlatLaf as the look & feel the Windows 11 Snap layouts don't work.
When I hover over the maximize button, a menu with snap layouts should pop up. With this look & feel set, I don't get that menu.

import javax.swing.JFrame;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
import com.formdev.flatlaf.FlatLightLaf;

public class FlatLafTest {
	public static void main(String [] args) throws UnsupportedLookAndFeelException
	{
		// With this line snap layouts don't work.  
		// Comment it out and hover over the maximize button to see the snap layout options.
		UIManager.setLookAndFeel(new FlatLightLaf());
		
		JFrame frame = new JFrame();
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.setVisible(true);
	}
}
@DevCharly
Copy link
Collaborator

Thanks for reporting.

This is because FlatLaf paints the window title bar itself to support dark window titles and embedded menu bar.
See PR #267.

Don't yet have Windows 11 here, but will upgrade soon. Then I can fix it...

@DevCharly
Copy link
Collaborator

BTW is this the same as #397 ?

@amberream
Copy link
Author

Ah, yes it does look like the same issue as #397. Didn't see if because of terminology!

DevCharly added a commit that referenced this issue Nov 9, 2021
…ering the mouse over the maximize button (issues #397 and #407)
DevCharly added a commit that referenced this issue Nov 9, 2021
…ze/close buttons on Windows 10 and for minimize/close buttons on Windows 11 (issues #397 and #407)
@DevCharly
Copy link
Collaborator

Fixed in main branch (for FlatLaf v2).

BTW you can use keys Windows+Z to show the Windows 11 snap menu even with FlatLaf v1 😉

@DevCharly DevCharly added this to the 2.0 milestone Nov 9, 2021
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