[haiku-development] Re: Stack & Tile update

Hi,

On 2009-01-25 at 11:44:54 [+0100], Christof Lutteroth 
<lutteroth@xxxxxxxxxxxxxxxxx> wrote:
> Following some of the suggestions on this list, I have changed the 
> modifier key for stacking and snapping to B_OPTION_KEY, which is the 
> Windows key on a PC and Option+Apple on a Mac. The current patch supports 
> switching between the different windows in a stack with 
> Windows+left/right (or Option+Apple+left/right on a Mac).

Nice work!

> I would like to make the Stack & Tile configuration permanent, i.e. store 
> it like the window positions. Could someone please indicate how and where 
> data about windows are stored at the moment so that I can extend the 
> existing mechanism?

This will be a hard one to solve. The app_server does not store any window 
persistency information, this is up to the applications when they save 
their settings. To store the window tab location in Tracker on Haiku, I 
extended the BWindow API to retrieve and set an opaque BMessage archive 
with the decorator settings, but this affects only single BWindows. In your 
case, you have multiple windows, which may stem from various applications. 
So the only place where I see the persistency should be is in session 
management. But of course, there is no such thing in Haiku at the moment. I 
don't know where else this should go. For the window configurations to be 
restored, all the involved applications would need to be run again, so it's 
really a matter of session management. I have no previous experience with 
it and never researched the topic. My uneducated guess would be that on 
shutdown, there would be a broadcast to every running application (not 
background apps resp. servers, I guess), to store state information 
(probably the registrars job). Then on next boot, the registrar would 
launch all the previous applications with a special launch protocol, which 
gives the previously stored state BMessage archives to each app. Then a 
special protocol could be made between registrar and application server 
which could restore such things as the window stack configurations. As a 
first step into this direction, the registrar could be extended to simply 
store what apps are running and relaunch them on next startup. The 
app_server could be extended to receive a message from the registrar, so 
that it knows at which point in time the previously running apps have all 
been restored, then it could try to restore the stacking information. This 
would probably have to do some fuzzy matching of the windows. One problem 
could be that most applications do not tie their windows to a specific 
workspace when they store persistency. There may be ways to restore the 
window workspaces anyways.

Best regards,
-Stephan

Other related posts: