Yes, thatâs what I do too. But if I want to use just one window, it shouldnât be tiled. But it is, because it automatically restores its position and size. I know thatâs a bit nitpicky
This is also a pet peeve of mine, the guys at kde seem to be integrating all applications and creating an option on settings to enable/disable this behavior. That said, the way kde applications store their configs is different than GNOME, a hack using dbus and changing the .desktop file might be possible (the idea is to run a script to reset windowâs size values to default whenever you launch the requested app).
Maybe create a freedesktop standart for this?
My personal opinion is, that this behavior should be dropped in the long run. As @ebassi said, storing positions doesnât make sense anymore anyways. And window resizing should be handled only by the compositor and not by the application itself. Mutter already has an auto-maximize feature that is enabled by default and handles the cases, where you really donât want to use the default window size.
But because thereâs probably not that much interest in this, I think, that the short term solution would be to have a GSettings option. The only question is, whether that should reside at the application level or globally (e.g. under org.gnome.desktop). However, I donât know how the policies on that would be and whether it is desirable for the steering Gnome developers to have that.
This is really a non-sequitur. An option is never a short term solutionâexcept for the person proposing it, who is likely going to have their itch scratched after it gets merged, whereas the maintainers will have to deal with the setting on the long term. Never, ever propose a setting as a short term solution.
Additionally, as I said above, since itâs up to applications to do this at the moment, you will need a separate setting for every application, because itâs exceedingly unlikely weâll add a key in gsettings-desktop-schemas.
In theory, the compositor should store the data for each application; and each application should receive the previous state from the compositor on startup. In practice, we donât have a protocol for it; until thatâs solved, a setting is not going to do you any good. Might as well ask applications maintainers to never store the window state to begin with.
Thanks for the clarification! Of course you are right about the maintenance burden.
Maybe that would be the best solution. But of course I donât want to take away this feature from everyone, just because I myself happen to dislike it.
With âshort termâ I meant until there is a complete replacement in the form of a compositor-side solution or some other project-wide decision etc.
I think, Iâll decide whether to open a MR for Nautilus tomorrow.
Replying as a developer who saves and restores its applications size.
I could try to explain why saving windows positions could have meant something in the Windows 95 paradigm, but letâs avoid that, we donât care anymore. So Iâm just talking about the sizes and states.
First of all, letâs clarify something: these apps are not multi-windows. Imagining a correct multi-windows behavior for saving and restoring is quite hard, because you never know which one of your window has âthe size usually wanted by the userâ and which one has âa size given on the fly for a specific use.â Multi-windows application should probably drop this function, they cannot just get it right.
Mono-window apps at the opposite usually have a given use, and so âa size wanted by the user.â (Thatâs the case for all the games I maintain for example; a counter-example is the Peek screen-recording application, that wants to restore to a default size every time, because itâll all the time be used for a different thing.) And this size depends notably on the size of the userâs screen. Because if I all the time open my game at 600Ă400, because it allows people on small screens to have the same behavior than other people, that will make people with 4k screens cry, as they will all the time have to set the window to a correct size for them. So yes, it makes sense to save window size and state in that case, in my opinion.
Various thinkings:
- it might be a good idea to switch the default (first-launch) window state to âmaximizedâ in many applications, as long as they render great like that;
- the âhalf-maximizedâ states are quite hard to get right, because you do not want to save the window size then, and cannot at all restore the window state;
- it would be better that Gtk could handle that for us, or even better that the saving of the state and size be done by the compositor; but thatâs not the case;
- adding settings is quite never a good idea; and adding global settings only works if the applications developers have nothing to do to have it working.
Many thanks for the elaborate reply. You have convinced me that mono-window applications should do something with their window states which, at the moment, can only be done by simply saving and restoring it.
Now that I think about it, I probably meant exactly what you mentioned now â i.e. multi-window applications.
I opened a Nautilus issue for now. I think, Nautilus would really benefit from dropping this behavior.
Doing a bit more research here: I usually never launch âviewerâ applications directly, but looks like Evince (the PDF & Co. viewer) has a âdefault view,â where it lists the documents it is suggesting to open. I imagine that a multi-windows application like that could correctly decide to save the size and state of the window for this view, and avoid saving it when a document is displayed, as the user might want then to adapt to the given document. Thereâs of course to decide the behavior of what happens when two windows are opened at different sizes on this default page (disable that if possible, save only in sessions when only one such view is openedâŠ), but thatâs a negligible corner-case IMO, because no sane user would do that.
Edit: We might also discuss the saving of the size and state by document. And to discuss if browsing a folder in Nautilus is like displaying a given document. Human brain is fun, satisfying it is hard.
Evince does that. It doesnât save the collection window size, but somehow manages to restore the document viewers. However, I donât know where it stores thatâŠ
This behavior makes some sense for documents, but I donât think that it applies to folders. There can be lots and lots of folders including remote ones etc. Also, there are different views for the same folder and edge-tiling is a common mechanism for file manager windows (I think so).
I personally canât stand when an application does not open at the same size.
Iâve uninstalled many an application over this.
The defaults are sometimes unusable.
If I have to adjust it everytime I open it thatâs a blocker.
Evince stores those settings in the fileâs metadata. You can try:
$ gio info [some-file.pdf] | grep evince
Users around me love this as default behavior. (Even for Nautilus.) =) So itâs better to deviate from it only when there a reason.
Evince stores those settings in the fileâs metadata.
Interesting. I wouldnât expect my document viewer to change the files Iâm opening without me confirming that. But I guess, this information is not that sensitive anyways. However, it seems like Firefox inserts the URI where you downloaded the file. In my opinion, this could be a concern. I didnât expect that.
Users around me love this as default behavior.
It seems like there really is a big-enough audience for that feature. And I also donât dislike it in general. Just the annoying complications with edge-tiling etc. But as I have learned, there is nothing the applications themselves can do about that. Maybe, in the long run, thereâs a place for some sort of protocol-based solution.
Evince does not change the files. Those attributes are stored in the files metadata using GIO. As a matter of fact, if you do files operations with gio
, such as gio rename
or gio move
the metadata will be ok. If you move the files using mv
, the metadata is gone.
Just the annoying complications with edge-tiling etc. But as I have learned, there is nothing the applications themselves can do about that.
I could see it being an annoyance in that specific situation.
I donât know that anyone would want to add code for that but you could check if the dimensions suggest the window is tiled and not save if thatâs the case.
i.e. does the width match half screen width and is height within 50 pixels of screen height? Then donât save the size. But that seems like kind of a hack that would probably fall on its face at times.
I donât know that anyone would want to add code for that but you could check if the dimensions suggest the window is tiled and not save if thatâs the case.
I do it in every application I maintain. It works great and is not difficult to add, at least in non-verbose languages. Just needs someone to write the code.
I do it in every application I maintain. It works great and is not difficult to add, at least in non-verbose languages. Just needs someone to write the code.
Well, that and someone to agree to merge itâŠ
But more importantly, are you running into any cases where it doesnât work right?
And whatâs the actual logic youâre using to detect these edge cases?