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

Remember the editor window position and size across restarts #32056

Closed

Conversation

Calinou
Copy link
Member

@Calinou Calinou commented Sep 9, 2019

Some notes:

  • For the purposes of configuration saving, exiting while the editor is fullscreen will be saved as maximized.
  • The configuration accounts for multiple monitors and will save the window position relative to the current monitor. When reopening the editor, it will open on the monitor that's currently active.
    • TODO: Remove this and just use absolute coordinates, as most other applications seem to use absolute coordinates.
  • If the editor isn't maximized, the window will be resized while the splash screen is displayed. This could be solved by moving the configuration loading code to main.cpp, but I don't know how this could be done since it needs to be done early enough while getting the file path from the EditorSettings singleton.

This closes #5114.

@@ -319,6 +319,8 @@ class EditorNode : public Node {
PopupMenu *editor_layouts;
EditorLayoutsDialog *layout_dialog;

Ref<ConfigFile> window_config;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since saving overrides everything regardless of previous values, I think it might not need to be a member variable, you can just instantiate a ConfigFile when loading, and another one when saving.

@akien-mga akien-mga added this to the 4.0 milestone Sep 26, 2019
@fire
Copy link
Member

fire commented Jul 12, 2021

@Calinou How can this be moved from draft to mergable state?

@Calinou
Copy link
Member Author

Calinou commented Jul 12, 2021

@Calinou How can this be moved from draft to mergable state?

This needs to be redone from scratch for DisplayServer, and ideally made to use a project.godot override for the editor (so that it works before the splash screen is done initializing).

@hhyyrylainen
Copy link

hhyyrylainen commented Sep 17, 2021

Would this PR when done also remember the fullscreen mode of the editor? As this was mentioned in a proposal that got closed that asked for an option to remember the fullscreen mode.

Seeing that this PR is still open, I'll instead mention here (rather than opening an issue) that I just spent 20 minutes fighting my editor getting glitched so that it always opened one specific project in fullscreen mode (when directly told to open that project rather than going through the project manager), which is not what I want.
I tried to delete all the caches and also .import and .mono folders in that project but it didn't help:

~/.local/share/godot
~/.config/godot

In the end I edited my project file to define my game as not fullscreen and also deleted the .import folder again, this time by directly starting the godot editor and maximizing it before the import, and then I did exit to the project list and opening the project again for good measure. That somehow now fixed it so that when I directly load the project in Godot it just maximises the editor window how I want it. In summary, I had a very strange issue...

So I'd very much like to see this PR be completed (and also remember the fullscreen mode) as that would have saved me the 30+ minutes I spent frustrated trying to get my Godot editor working again, and also the time I spent trying to find if this is already reported / there's a proposal.

Edit: and I want to mention one more thing, the editor completely ignored the command line flags --windowed and --maximized so it was entirely refusing to cooperate with me. So I couldn't fix my issue by editing my Godot starting script.

@Calinou
Copy link
Member Author

Calinou commented Sep 17, 2021

Would this PR when done also remember the fullscreen mode of the editor?

This PR doesn't remember fullscreen mode by design. Most other applications like web browsers don't remember their fullscreen mode from previous sessions. Games do, but they are an entirely separate realm 🙂

@hhyyrylainen
Copy link

Would it be worth it then for me to try to report this as a bug? As I said I don't have steps to reproduce this problem, but this was very annoying and strange when it happened to me.

@Calinou
Copy link
Member Author

Calinou commented Sep 17, 2021

Would it be worth it then for me to try to report this as a bug? As I said I don't have steps to reproduce this problem, but this was very annoying and strange when it happened to me.

Feel free to create a separate issue for it, but it sounds very strange to me – I've never seen anything of the sort. It's not guaranteed that anyone else will be able to reproduce it.

@akien-mga
Copy link
Member

We discussed this briefly in PR review meeting, this would be nice to have. Needs redoing for DisplayServer.

Might also be good to support remember the monitor/screen index (and properly handling if the screen is no longer connected, then it should fall back again to what is configured in the editor settings).

@KoBeWi
Copy link
Member

KoBeWi commented Jul 26, 2022

Might also be good to support remember the monitor/screen index (and properly handling if the screen is no longer connected, then it should fall back again to what is configured in the editor settings).

This is already done for some dialogs (somewhat), and is actually a reason for a bug, being fixed here: #61336

@Chaosus Chaosus added this to the 4.0 milestone Aug 13, 2022
@YuriSizov YuriSizov modified the milestones: 4.0, 4.x Aug 16, 2022
@Calinou
Copy link
Member Author

Calinou commented Apr 15, 2023

Superseded by #76085.

@Calinou Calinou closed this Apr 15, 2023
@YuriSizov YuriSizov removed this from the 4.x milestone Dec 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Preserve position and size of godot's editor window between sessions.
8 participants