Windows should remember its position after restart!

Not only windows if they cannot remember its lastest position will pop up at the top-left corner!
Same to mounted volumes, screenshots!
So there should be a way to save the position of windows as default, or turn them off.
What do you think?

https://dev.haiku-os.org/ticket/18839#comment:9

I for myself arrange my windows all at the top, and move the tabs with “shift-drag” them. So, yes I personally dislike floating windows all over the desktop!

This is an enhancement! Just for discussion here!

Not too hard in an individual app. On closing down you save the x and y origin points in a dotfile. The next time it runs, it checks if the dotfile exists, reads x and y back into variables and opens its window in the same spot. Saving x and y in extended attributes would be more Haiku-ish, but it amounts to the same thing, really.

But it sounds as if you are asking for a system-wide override that will reposition windows even if the app itself has no provision for it. That comes down to session management. A big job.

Most Haiku apps (at least the ones where I`ve looked at the source) save the window position as a BRect in a flattened BMessage under ~/config/settings, along with other settings data.

> save the x and y origin points in a dotfile.
Using .dot files is depreciated in Haiku and BeOs!?
We should use the config folder and settings folder for this!
How to do it in the “settings” folder?

> save the window position as a BRect in a flattened BMessage under ~/config/settings, along with other settings data.
Sounds good, and what I mean! The app developer can make use of this!

The Terminal is a special thing and should be excluded!
The sessions can be saved by the user/developer!

> for a system-wide override that will reposition windows even if the app itself has no provision for it
No that might not a good idea!
But maybe? Discussion needed

EDIT: Opening Folders with their last position works, not the tabs!

There are a few stragglers. There is a plaintext setting for Becasso on my system, for example.

Deprecate all you want. There are 47 dotfiles and dotdirectories in the home folder of my main Haiku system. There are even 3 dotdirectories in my /config/settings (a bit of overkill, perhaps :grinning:), and lots more plaintext settings.

Flattened BMessages are great for native C++ apps written in the haiku API. And these days, those are a minority of the apps we have. All my GTK, QT and Java ports, all Terminal character-mode apps, and all yab apps, store their settings in plain text, with or without a dot. Plaintext settings aren’t going anywhere.

And it makes no difference. The principle is the same: store the location somewhere, then read it back the next time. It’s a per-app thing. Some apps’s developers think this is important enough to include in their code, others don’t.

Some of my yab apps (mostly the ones with just a single window) have this setting, others don’t. So if there is now some system-wide override that ignores where I told the app to put itself, I am not going to be happy about it.

2 Likes

There are none for me. How do you have that many apps that are neither native nor respective of the XDG base dir spec? :g

Plaintext is fine, depending on your application. Aslong as it’s stored in the settings dir : D

1 Like

Java is the main offender :smiley:, but note Abook

~> ls -d ~/.*
/boot/home/.abook            /boot/home/.cache             /boot/home/.gem          /boot/home/.npm
/boot/home/.acein            /boot/home/.cargo             /boot/home/.gervill      /boot/home/.pki
/boot/home/.aqemu            /boot/home/.config            /boot/home/.gngr         /boot/home/.projectlibre
/boot/home/.Arachnophilia    /boot/home/.de.elmar_baumann  /boot/home/.grip         /boot/home/.qwinff
/boot/home/.bacon            /boot/home/.Decoration        /boot/home/.HaikuFull    /boot/home/.ragnasc
/boot/home/.bastetscores     /boot/home/.dirtel            /boot/home/.java         /boot/home/.rtext
/boot/home/.besly            /boot/home/.drjava            /boot/home/.jca          /boot/home/.todo
/boot/home/.bluefish         /boot/home/.EdCalc            /boot/home/.jedit        /boot/home/.vstmDB
/boot/home/.borg_db          /boot/home/.efte-history      /boot/home/.local        /boot/home/.wordgrinder
/boot/home/.borg.log         /boot/home/.freemind          /boot/home/.makagiga     /boot/home/.xdman
/boot/home/.borg.out         /boot/home/.freeplane         /boot/home/.mucommander  /boot/home/.xtrememp
/boot/home/.borgaudit.log.0  /boot/home/.friends           /boot/home/.nanorc

~> ls -d ~/config/settings/.*
/boot/home/config/settings/.besly     /boot/home/config/settings/.lesshst
/boot/home/config/settings/.FBReader

Doesn´t yab have a possibility to save flattened BMessages? Since it uses the Haiku API it has BMessages, right? And therefore access to the Flatten() and Unflatten() functions. Lot´s of questions, I have no idea about yab :wink:
But I agree with @nephele, the format of a config file isn´t really that important as long as it´s in the right directory. And non-native apps should at least be patched to save their config files in the settings directory and don´t clutter the root of the home directory .

2 Likes