[haiku-development] Remembering window positions

  • From: John Scipione <jscipione@xxxxxxxxx>
  • To: "haiku-development@xxxxxxxxxxxxx" <haiku-development@xxxxxxxxxxxxx>
  • Date: Mon, 18 Mar 2013 12:11:47 -0400

Hi Haiku developers,

Something that irks me about Haiku is that, excluding a few instances
such as Tracker windows, when you close a window and reopen it, Haiku
doesn't remember the previous window position and so the application
centers the window on screen or puts it in the upper left hand corner
of the screen somewhere.

For Deskbar prefs I have gotten around this by stuffing the window
position into a BMessage and saving it to a file in the home/config
dir with BMessage::Flatten() on close and then restoring it in the
constructor with BMessage::Unflatten(). My implementation is smart
enough to detect if the window's top-left corner is off-screen
(because you put it there and then closed with CMD+W or changed
resolution since closing the window).

For the rest of the windows in the system should I go through each
one-by-one and solve the problem this way, or is there a better way
that we could handle this in a common place like app_server?

If I do one by one this way I'll create a bunch of settings files in
home/config just for storing window positions... this seems less than
elegant to me. I'm hoping for a more thoughtful solution to this
problem.

Thanks for listening,
John Scipione

Other related posts: