-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Bugfix for Multiscreen #5738
Bugfix for Multiscreen #5738
Conversation
…osition Variables in JabRefPreferences to support bugfix
Thanks for the contribution. Please remove the Travis integration as we recently switched to Github Actions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Welcome to JabRef!
I've two suggestions to improve the code a little bit. Other than that, the code looks really good. It's also really helpful that you clearly outline your changes in the PR description. Thanks!
* returns the number of Monitors connected to the Computer | ||
* @return numberOfmonitors | ||
*/ | ||
private int numberOfMonitors() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the pure JavaFX version would be Screen.getScreens().size()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
integrated with newest commit
*/ | ||
private boolean testExternalCoordinates() { | ||
boolean outbounds = false; | ||
if (Globals.prefs.getDouble(JabRefPreferences.POS_X) > Globals.prefs.getDouble(JabRefPreferences.SIZE_X)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be slightly better to test against the actual dimensions of the screen, which you can get via Screen.getPrimary().getBounds()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
integrated with newest commit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! The code looks good and I've only a few minor remarks before we can merge.
private void printWindowState(Stage mainStage) { | ||
StringBuilder bob = new StringBuilder(); | ||
bob.append("SCREEN DATA:"); | ||
bob.append("JabRefPreferences.WINDOW_MAXIMISED: " + mainStage.isMaximized() + "\n"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't JabRefPreferences
be replaced by MainStage
? (As this does not print the values stored in the preferences)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes it should, I think I had it wrong in because of earlier tries, were I also printed the preferences 😅 it'll be changed at the next commit
* Tests if the window coordinates are out of the mainscreen | ||
* @return outbounds | ||
*/ | ||
private boolean testExternalCoordinates() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test
is a bit vague, what about storedWindowPositionIsOutOfBounds
(or maybe something a bit shorter).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
renamed it with isWindowPositionOutOfBounds()
@@ -172,6 +172,10 @@ | |||
public static final String SIZE_X = "mainWindowSizeX"; | |||
public static final String POS_Y = "mainWindowPosY"; | |||
public static final String POS_X = "mainWindowPosX"; | |||
public static final String SIZE_Y_CORE = "mainWindowSizeYCore"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As the user can never configure these values, there is no need to add them as preferences. Please convert them to static fields in JabRefGUI
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will try to set the Numbers right in at the method openWindow(), not sure if that works, but if it do I can delete all variables I made up..
…med method testExternalCoordinates with isWindowPositionOutOfBounds(), Deleted unused Variables at JabrefPreferences due to a correction in openWindow (at JabRefGUI)
Thanks for the quick follow-up! |
* upstream/master: (21 commits) New Crowdin translations (#5729) Update license of Oracle JDBC Changes string representation when detecting custom entry types. (#5741) Try to fix GitVersion Also run workflow on tag creation Add README.md with an initial help to work on command line para… (#5720) Bugfix for Multiscreen (#5738) Fix #2868 - keep source groups selected after drag and drop retrigger build Squashed 'src/main/resources/csl-styles/' changes from f71cd32..49a1841 try to fix pull of csl styles try to fix csl update Fixed untranslated Strings issue #5701 Fix #5603 - account for file extension in file name length (#5726) New translations JabRef_en.properties (French) Bump unirest-java from 3.2.00 to 3.3.00 Bump postgresql from 42.2.8 to 42.2.9 Bump tika-core from 1.22 to 1.23 Fix upload to GitHub artifacts (#5712) Try to fix csl update (#5718) ...
60bf7d5 Add encyclopedia type to wikipedia-templates.csl (#5778) 031afe1 Update and rename dependent/organization-studies.csl to organization-… (#5779) 7ed71e7 Update harvard-newcastle-university.csl (#5765) 46bab91 Update annals-of-oncology.csl (#5760) 6158ae6 Create research-in-plant-disease.csl (#5738) 04422a8 Create chemmedchem.csl (#5753) 7c11521 Create clinical-kidney-journal.csl (#5749) e7ee983 Create kit-karlsruher-institut-fur-technologie-germanistik-ndl-neuere… (#5729) 96a1106 Update article format for STM journal (#5755) a4ca057 Update historia-scribere.csl (#5748) git-subtree-dir: buildres/csl/csl-styles git-subtree-split: 60bf7d5
Made following Changes to solve Multiscreen issue fixes #5037:
At JabRefGUI:
( |-> numberOfMonitors() finally replaced by Screen.getScreens().size())
At JabRefPreferences:
(made in accordance with an Project on Software Engineering at University Basel in cooperation with @unibas-marcelluethi)