Gnats 4667: Dialog windows no longer open where they last closed.
Phil Weinstein -- 12-11-2008 -- Gnats record.

All RiverWare Qt dialogs (other than temporary non-custom popups) -- 131 dialogs (SEE LIST) -- now use a new mechanism for preserving their size and position during the RiverWare session. This information is preserved across dialog box deletions and re-creations. The size and position information is preserved in a map indexed with a two-field key:

  1. The name of the dialog box class (a string).
  2. Optional: Reference Object -- An arbitrary scalar value (a void*) used to distinguish distinct instances corresponding to distinct objects in the RiverWare model, or distinct uses of the dialog box. For example, a distinct geometry record is retained for the Open Slot Dialog for each Slot ever displayed in that dialog within the session. EXAMPLES: See the showEvent() and hideEvent() implementations in Q3GUI/OpenObjectDlg.cpp and Q3GUI/SlotQtDlg.cpp.

This works well on Windows. On Solaris, there are some sequences involving minimizing and restoring the dialog which result in the dialog box being moved up, and a little to the left.

Detail: On Solaris (using X11, the X Window System), the Window Manager (which draws and services the window title bar and border) runs as a distinct process. And the X11 specification substantially "policy-less", so different Window Manager implementations are free to do things however they want. (Sort of like the "freedom" to drive on either side of the road).  See some notes from Trolltech.

In an attempt to address some of the problems on Solaris, the size of the window title bar and border is measured by momentarily showing a test dialog (on Solaris only). On Solaris, you'll see a small dialog pop up for one second when the Workspace is initially shown (only once withing the RiverWare session).

Things that can go wrong:

  1. Some dialogs for which multiple instances are simultaneously used (for distinct RiverWare objects) may not have been coded with the optional Reference Object value. If this happens, the different dialogs will generally all open on top of each other. (Though this is NOT the cause of Gnats 4605 on Solaris for Open Slot Dialogs).
     
  2. The mechanism depends on the hideEvent() being called, which apparently does not happen if the dialog box object is just deleted. It is important to first call QWidget::hide() on the dialog box before deleting it. (We don't normally just delete dialog boxes, but it's now looking like that's actually the best way to close and delete a dialog box so that the effect of the destructor occurs immediately rather than occurring on a subsequent Qt event).

Implementation Class:

---