JabRef / jabref

Graphical Java application for managing BibTeX and biblatex (.bib) databases
https://devdocs.jabref.org
MIT License
3.61k stars 2.57k forks source link

JabRef window expands to full screen on app start #4939

Closed kbarros closed 1 year ago

kbarros commented 5 years ago

When starting the JabRef app, the JabRef window will expand to full screen. I would expect it to remember and reuse the window size from the last time JabRef was open. If such history is not available, I would expect JabRef to have a "reasonable" default (maybe 2/3 the screen size?)

JabRef 5.0-dev--snapshot--2019-05-01--master--f1b4b5be3 Mac OS X 10.14.4 x86_64 Java 1.8.0_212

Siedlerchr commented 5 years ago

Hi, this is odd. JabRef stores the main window size in the preferences and also if if the window is maximed or not. on Windows 10 this works fine. So it might be a mac thing.

@LinusDietz Can you confirm this?

LinusDietz commented 5 years ago

Nope, when running JabRef with the current master it remembers the screen size as it should.

Mac OS X 10.14.4 x86_64 Java 1.8.0_202

kbarros commented 5 years ago

That is strange, I tried again with today's snapshot and it still does not remember the window size.

JabRef 5.0-dev--snapshot--2019-05-11--master--3baa6bd22 Mac OS X 10.14.4 x86_64 Java 1.8.0_212

Where should it be storing the window size? I can check if this preferences file is being properly written on my machine.

Siedlerchr commented 5 years ago

@kbarros JabRef uses the java-prefs feature to store the values. Here are some hints where it is stored: https://stackoverflow.com/a/675880

You could also check in Options -> Preferences -> Show all preferences JabRef uses the following keys:

mainWindowSizeY
mainWindowSizeX
mainWindowPosY
mainWindowPosX
stefan-kolb commented 5 years ago

Closing this issue due to inactivity :zzz: Please reopen the issue with additional information if the problem persists.

kschmid commented 1 year ago

I am seeing this issue with Jabref 5.9 on MacBook running Ventura 13.5. Checked advanced preferences: they show 0,0,768,1024 for the respective key values. There is a preference in the personal library org.jabref.gui.plist (which I assumed would contain the relevant values), but last modification date is from early July. Other files under org.jabref. are even older (except for cli, which was modified only 2 days ago). When opening preferences or advanced preferenced and hitting save, I get confirmation (library saved, resp. preferences saved), but these plists do not change. And next time I start again it is as large as the screen again (but not in full-screen mode). Any idea, what could be the problem?

Siedlerchr commented 1 year ago

Hi, I think I found the issue, apparently mac differs between maximized and full screen modus. I will create a PR to tix this

kschmid commented 1 year ago

thanks for taking this up again, only to clarify. The main problem is not the full screen. The main problem is: I open it, it takes up the whole screen space (but not in full screen mode, which is fine). I resize it adequately. The layout apparently does not get stored and next time it will open up with taking the whole screen again.

Siedlerchr commented 1 year ago

Okay, this is weird. And not the behaviour I encounter. When I resize JabRef and quit with cmd + q on the next start, JabRef is in the same size. Do you have any external monitors connected?

kschmid commented 1 year ago

Ok, good to know, then it must a more local issue. So far, I had done all this with (and on) local monitor. Prompted by your question. I closed, disconnected the external monitor. Reopened, Resized, quit and reopened. The same behavior: resizes to full laptop screen (macbook pro). If I than connect to the external monitor (primary), the window is moved to there and does keep roughly the laptop screen size.

I also checked whether there are issues with files and folders or full disk access, but Jabref has the rights for both. (I thought, might be an influence on the storing of preferences.)

Siedlerchr commented 1 year ago

Can you test the latest development version if it makes a difference? https://builds.jabref.org/main/ You only need to execute xattr -d com.apple.quarantine /Applications/JabRef.app after extracting the dmg.

kschmid commented 1 year ago

Did it, no difference (neither the standalone from 1.7 nor the dmg from yesterday). The dmg first asked for new access rights to files and folders, which I granted.

One thing I noticed (in general): when I double click the title bar, the window goes to a smaller size, but the size seems independent of prior scaling.

Siedlerchr commented 1 year ago

Ah now I can reproduce it as well and I found a solution

Siedlerchr commented 1 year ago

@kschmid Can you test this version? https://builds.jabref.org/pull/10128/merge That should fix the issue

kschmid commented 1 year ago

Sorry for the delay, but traveling and there seems to be a bit more complex result, which I first had to test a bit more thoroughly. a) It seems everything works now, if I close the application with the red x on the window. b) if I close using cmd-q, it seems the window dimensions are not stored, the last layout that was initial while starting up is still used any resizing is forgotten. In addition there is some behavior that I could not systematize (and never saw earlier). Sometimes on startup all columns are squished. see picture. my-collection bib – JabRef 2023-08-03 09-42-58 In this case I did not find a way of realigning the columns to the way they should look (second picture) my-collection bib – JabRef 2023-08-03 09-44-38 However, randomly after some restarts the layout looks again like it should. Here, I could not find a systematic dependency to the way I closed the app (appears to happen both ways).

Siedlerchr commented 1 year ago

Thanks for the feedback! Yeah, I noticed that with CMD + Q as well. There maybe a solution using binding directly to the stage properties so that we don't rely on some close listener.

Regarding the column layout: Do you have the option Fit table horizontically (or similar, don't have JabRef at hand right now) on screen enabled in the preferences? If yes try to disable this.

Do you see anything in the log?

kschmid commented 1 year ago

The culprit was indeed the Fit table. After deselecting it, the layout stays. (I never changed this. Apparently this is a default.) It implies that every once in a while the layout is fitted to a much smaller window size than the actual window size. The log seems to conserve only current run? (Library/Logs/jabref/5.9.. (also menu entry). Thus, I cannot see anything that may happen during close. In the available logs, I do not see anything that looks remotely strange.

kschmid commented 1 year ago

I am not familiar with FX and the details of the JabRef architecture. But after taking some time to poke around, I am wondering whether the close button vs. cmd-Q issue is related to the fact that: JabRefGUI.java, line 158 calls saveWindowState
and then goes on to quit, while JabRefFrame.java quit method (l. 456) does a lot of teardown work, but apparently does not save the window state. (but perhaps this is completely off.. )

Siedlerchr commented 1 year ago

Thanks for the hint, I will take a look, maybe this works! PS: Getting started with coding in JabRef is not that hard https://devdocs.jabref.org/, and we are also part of some Software Engineering courses and, of course, open for collabs ;)

Siedlerchr commented 1 year ago

@kschmid Your hint was correct, it works now for cmd + q as well. You can test the version here: https://builds.jabref.org/pull/10143/merge

kschmid commented 1 year ago

Thanks, just tested it; works like a charm. Just looked at the commits. It was more difficult than expected. - Probably typical in an unknown code base. Regarding collab. - Certainly interested. Seeing from code base and docu, it is much better than many other OS projects..