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

Multi-monitor maximize or non native covers the taskbar #222

Open
RobertBColton opened this Issue Sep 5, 2015 · 2 comments

Comments

Projects
None yet
1 participant
@RobertBColton
Collaborator

RobertBColton commented Sep 5, 2015

The fix I added to stop undecorated and non native windows from the covering the task bar broke multi-monitor maximizing.
https://github.com/IsmAvatar/LateralGM/blob/master/org/lateralgm/components/impl/FramePrefsHandler.java#L30

It is a known issue that the non-native look and feel's in Swing will cover the task bar and so will an undecorated window when it is maximized. When the native window manager is used this does not occur. So my fix was to set the maximized window bounds for the current screen in the frame preferences handler. When the window is moved to a new monitor with a different resolution the bounds are wrong and maximizing the window does nothing.

A possible work around is to listen for the window to be moved and when it is update the maximized bounds. The other alternative is to just leave non-native and undecorated windows cover the task bar when maximized since this seems to be a problem in JavaFX and the look and feel's, including the default one. Because fixing the bug in Swing means using our own JFrame class everywhere my vote goes towards just removing the code and continue using the native look and feels and just hope that they fix this bug. I wouldn't so much as argue that this is a bug in the frame itself, undecorated covering the taskbar is ok, but the fact that the look and feels do it in my opinion is broken, they should at least act like a normal window with the maximize button.

I filed a similar report about this on the JavaFX tracker where the new RIA platform has the same issue:
https://bugs.openjdk.java.net/browse/JDK-8133330

@RobertBColton RobertBColton changed the title from Multi-monitor maximize to Multi-monitor maximize/non native covers the taskbar Sep 5, 2015

@RobertBColton RobertBColton changed the title from Multi-monitor maximize/non native covers the taskbar to Multi-monitor maximize or non native covers the taskbar Sep 5, 2015

@RobertBColton

This comment has been minimized.

Show comment
Hide comment
@RobertBColton

RobertBColton Jan 29, 2016

Collaborator

I've decided to remove the code for the time being in #245 and fix multi-monitor support as it is more important.

Collaborator

RobertBColton commented Jan 29, 2016

I've decided to remove the code for the time being in #245 and fix multi-monitor support as it is more important.

@RobertBColton

This comment has been minimized.

Show comment
Hide comment
@RobertBColton

RobertBColton Oct 1, 2016

Collaborator

I found another way that you could do it for all frames including those not even created by LGM. This would probably be the better way to go. The only problem I have is trying to figure out whether the window event is a maximized event and not a minimized/iconified event.

        Toolkit.getDefaultToolkit().addAWTEventListener( new AWTEventListener()
        {
            public void eventDispatched(AWTEvent e)
            {
                if (e.getSource() instanceof JFrame)
                {
                    Frame frame = (Frame) e.getSource();
                    frame.setMaximizedBounds(GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds());
                }
            }
        }, AWTEvent.WINDOW_STATE_EVENT_MASK);
Collaborator

RobertBColton commented Oct 1, 2016

I found another way that you could do it for all frames including those not even created by LGM. This would probably be the better way to go. The only problem I have is trying to figure out whether the window event is a maximized event and not a minimized/iconified event.

        Toolkit.getDefaultToolkit().addAWTEventListener( new AWTEventListener()
        {
            public void eventDispatched(AWTEvent e)
            {
                if (e.getSource() instanceof JFrame)
                {
                    Frame frame = (Frame) e.getSource();
                    frame.setMaximizedBounds(GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds());
                }
            }
        }, AWTEvent.WINDOW_STATE_EVENT_MASK);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment