In the preferences, there are check boxes labeled "Save window size" and "Save window position". They set `prefs.save_wingeom` and `prefs.save_winpos`, which are used in [libmain.c](https://github.com/geany/geany/blob/04566236d3f9811d55d6c7bcc492b3a60369fd20...) to control whether the window size and position are *restored*.
These settings should control *only* whether (new) sizes and positions are *saved*. Whatever is *already* saved should be restored.
Possibly related #1401.
You need to search closed issues and PRs and find what the use-case was and what was intended.
@elextr Is there a particular issue/PR you have in mind? I don't see any particularly relevant closed issues/PRs.
This restore behavior appears to have been present from when the "save" position (d33758da926ca124db674240c431b8b07bb0e683) and geometry (38147b2590f6d4e695c3637dd360631a1b7cc7f5) features were added.
I guess save position is much older... but don't know where it was located prior to the creation of `libmain.c`.
Based on discussion in #1401, it appears to be the belief of some Geany devs that Geany already functions the way I describe it *should* function.
Search "issues and PRs" I said :-) not commits, the discussion is what will tell us the use-cases.
There should be a more recent one that split the option into position and size, I hope its new enough it was github and not ML.
Also behaviour back in GTK2 days may have been different, GTK3 changed its internal sizing algorithms significantly.
Search "issues and PRs" I said :-) not commits, the discussion is what will tell us the use-cases.
I did search issues and PRs and didn't see anything relevant. So then I searched the commits to see what changes might have been made. Then I looked on SF and still don't see anything relevant. If you have something particular in mind, I'm not finding it.
What I'm looking for is any discussion around https://github.com/geany/geany/commit/38147b2590f6d4e695c3637dd360631a1b7cc7... but it seems to be disconnected from anything I can find. Better googlers/githubbers needed.
Just looking at the code of the commit, it looks like geometry previously just wasn't saved at all. Restoring window geometry based on `prefs.save_wingeom` seems to be carried over from behavior of `prefs.save_winpos`.
No before this _both_ position and size were saved with one option, this splits them to each have its own option. What I'm hoping is that any discussion here explains use-cases, because as you say any original discussion is lost in the mysts of time. You may be right it just continued original behaviour without thinking, but maybe reason why is mentioned.
Possible reasons I can think of for not loading at all include letting tiling or other self organising window managers do their thing without being upset by Geany requests.
Just to complete the picture, the use case for loading without saving is to set Geany window size and position the same for each restart, irrespective of changes you made in the previous session, thats your use-case so why do you would want to do that?
And finally the use case to save and restore so Geany continues where it left off so you can continue your previous session.
Perhaps the save and restore need to be decoupled, but there is a default size thats set if none is loaded IIUC. The whole sizing thing probably needs reconsideration for GTK3, and also the heap of plugin manager sizing error messages when its first opened.
No before this both position and size were saved with one option
Sorry. I didn't look carefully earlier.
The (current) restore behavior *might* be related to the save behavior. In [keyfile.c](https://github.com/geany/geany/blob/04566236d3f9811d55d6c7bcc492b3a60369fd20...), both position and geometry are saved when either `prefs.save_winpos` or `prefs.save_wingeom` is set. Expected behavior would be to *not* save position or geometry when the respective setting is *not* set.
letting tiling or other self organising window managers do their thing without being upset by Geany requests
Why would a "self organising" window manager be "upset by Geany requests"?
... there is a default size thats set if none is loaded IIUC.
It's in [libmain.c](https://github.com/geany/geany/blob/04566236d3f9811d55d6c7bcc492b3a60369fd20...). Since Geany sets (requests) the window size anyway, disrupting some window managers is probably not the reason for the current restore behavior.
... the use case for loading without saving is to set Geany window size and position the same for each restart, irrespective of changes you made in the previous session, thats your use-case so why do you would want to do that?
* When the settings are disabled, the default sizes may not make sense. But if positions and sizes were previously saved, they're likely to be reasonable. * When one setting is disabled, and the other enabled, the result may not make sense. (More later.) * A user may prefer Geany to start maximized, but need to occasionally unmaximize (eg, drag and drop files). If Geany is closed in an unmaximized state, the user might want it to restart maximized as usual.
* Starting maximized is currently only possible with `save_winpos=1` or `save_wingeom=1`. (There is `fullscreen` in preferences, but it is different from maximized. I don't know where it is in the preferences window.)
* This is the behavior implied by the option label and setting name. *Save* window position/size. (Not, *Restore* window position/size. So this issue could be resolved by changing the name.)
And finally the use case to save and restore so Geany continues where it left off so you can continue your previous session.
That use case would be unaffected.
Perhaps the save and restore need to be decoupled... The whole sizing thing probably needs reconsideration for GTK3...
And also sidebar/msgwin save/restore behavior. In [keyfile.c](https://github.com/geany/geany/blob/04566236d3f9811d55d6c7bcc492b3a60369fd20...), `save_winpos` controls restoring sidebar and message window positions. If `save_winpos=1` and `save_wingeom=0`, the sidebar and message windows are set to sizes that don't necessarily fit the default window size. (If sidebar/msgwin position is coupled to either setting, it should be `save_wingeom`, not `save_winpos`.)
... and also the heap of plugin manager sizing error messages when its first opened.
So that's where all those error messages are coming from...
disrupting some window managers is probably not the reason for the current restore behavior.
As I said, it was all I could think of, thats why the search for previous discussions before removing the ability to not load geometry.
Since Geany sets (requests) the window size anyway,
Yes, thats one of the things I mean by the whole sizing thing needs rethinking. A new app with no content may need to set it or the status bar will be jammed under the toolbar, but Gnome HIG recommends if content is restored then size should be restored (but not position, why?).
And also sidebar/msgwin save/restore behavior.
As above.
So this issue could be resolved by changing the name
Agree name is misleading.
The whole thing needs a step back and rethink by someone who understands the GTK3 sizing approach, and thats not me.
I'm also getting... strange... behavior when I set both sidebar and msgwin to appear on the right side of the window.
Probably hasn't been tested for years.
Related: #576.
Ok, make that decades :smile:
Add updating the manual to the list of issues... It mentions the option from before the split, along with the confusing description.
**Save window position and geometry**
Save the current position and size of the main window so next time you open Geany it's in the same location.
Use case for not restoring saved config: Testing default geometries. But, apparently hasn't been used much for this purpose.
github-comments@lists.geany.org