Skip to content

Conversation

@errael
Copy link
Contributor

@errael errael commented Oct 1, 2022

I've been running with this patch for over 6 months (since I started using multiple screens). It allows the user to specify a "preferred screen", this is the screen that NetBeans starts up in. First looks for an environment variable NETBEANS_PREFERRED_SCREEN, if found use the numeric value as index into ScreenDevices; if not found then try for a SystemProperty by that name.

Originally I was considering a PR with this and other fixes for dialogs that open up on the wrong screen, typically that would be screen 0 when NetBeans' main window is on screen 1. I'm opening this as a draft PR, though it could be merged as is, or maybe extended with related changes. It provides some context/reference for stuff I'm looking at. Looking for some opinions/comments about this whole issue.

I've experienced a situation related to what's described in [platform] DialogDescriptor/NotifyDescriptor and multiple screens, last message April 22, 2022. But I've never seen anything reproducible. I'm beginning to think that KeyboardFocusManager.getActiveWindow() return null and NetBeans decides to display dialog on default screen. But I can't get it to reproduce.

There also dialogs scattered throughout NetBeans that don't specify a parent, they consistently end up on the wrong screen. They could easily be changed to parent off of the NB main window, or with more effort parent from an appropriate screen.

@mbien mbien added Platform [ci] enable platform tests (platform/*) UI User Interface labels Oct 2, 2022
@errael errael marked this pull request as ready for review October 10, 2022 15:37
@errael
Copy link
Contributor Author

errael commented Oct 10, 2022

Updated to ready for review. Though it's a simple patch, the idea of giving the user a way to specify which screen to start up in is new (AFAIK).

@neilcsmith-net
Copy link
Member

My inclination would be to try and use the display that NetBeans was on when last used rather than adding additional configuration options if at all possible.

@errael
Copy link
Contributor Author

errael commented Oct 17, 2022

My inclination would be to try and use the display that NetBeans was on when last used rather than adding additional configuration options if at all possible.

I don't disagree, especially considering how to document/expose it so it's actually useful.

@errael
Copy link
Contributor Author

errael commented Jan 9, 2023

Forget the Env var. Focus on mis-use of null parent for dialog placement through NB APIs in a future PR.

@errael errael closed this Jan 9, 2023
@errael errael deleted the HandleUserSpecifiedPreferredScreen branch January 9, 2023 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Platform [ci] enable platform tests (platform/*) UI User Interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants