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

Dual screen Monitor support with different resolutions #508

Closed
svennissel opened this issue Jun 11, 2018 · 4 comments
Closed

Dual screen Monitor support with different resolutions #508

svennissel opened this issue Jun 11, 2018 · 4 comments

Comments

@svennissel
Copy link
Collaborator

If the main Monitor has a smaller resolution then the second monitor the Window will positioned out of the monitor. I have also problem to maximize the window on the bigger second monitor.

I found on Problem in the class LogViewMainFrame#initPosition()
Toolkit.getDefaultToolkit().getScreenSize() is wrong it store the sum of all Monitor sizes. See https://stackoverflow.com/questions/6322627/java-toolkit-getting-second-screen-size
In this case is better to use

this.getGraphicsConfiguration().getDevice().getDisplayMode().getHeight()
this.getGraphicsConfiguration().getDevice().getDisplayMode().getWidth()

Also GuiUtils#centerOnScreen()
better

target.getGraphicsConfiguration().getDevice().getDisplayMode().getWidth()
target.getGraphicsConfiguration().getDevice().getDisplayMode().getHeight()

Also SuggestionDocumentListener#setSuggestionWindowLocation()
better
suggestionWindow.getGraphicsConfiguration().getDevice().getDisplayMode().getHeight()

@otros-systems
Copy link
Owner

@svennissel Can you prepare merge request ?

@svennissel
Copy link
Collaborator Author

My first pull request: #524
The position of the JFrame is now correct. But on the bigger second monitor the window maximize only to the size of the primary monitor.

@svennissel
Copy link
Collaborator Author

svennissel commented Jul 9, 2018

I found the Problem of "Fullscreen on bigger secondary screen".
This is a example Application can reproduce the bug:

`public class TestFrame extends JFrame {
public TestFrame() {
super();
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
getContentPane().add(new Label("Bug"));
pack();
setVisible(true);
}

public static void main(String[] args) throws Exception {
SwingUtilities.invokeAndWait(() -> {
try {
UIManager.setLookAndFeel("org.pushingpixels.substance.api.skin.SubstanceBusinessLookAndFeel");
} catch (Exception e) {
e.printStackTrace();
}
new TestFrame();
});
}
}`

If you maximize the window, it will be not bigger than the primary screen.

If you commend out "UIManager.setLookAndFeel("org.pushingpixels.substance.api.skin.SubstanceBusinessLookAndFeel");" than the window resize correctly.

Also if you commend out in class LogViewMainFrame the line: LookAndFeelUtil.initLf(c.getString(ConfKeys.APPEARANCE_LOOK_AND_FEEL, SubstanceBusinessBlackSteelLookAndFeel.class.getName()));

otros-systems pushed a commit that referenced this issue Jul 9, 2018
* Dual screen Monitor support with different resolutions #508

The JFrame will displayed on primary monitor. If the second monitor
is bigger the last position can be negative.

* NullPointerException on Multimonitor environment #525

Do not throw Exception only log warning.
@otros-systems
Copy link
Owner

Thanks @svennissel

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