[lazarus] Modal / On Top forms

Mattias Gaertner nc-gaertnma at netcologne.de
Sat Mar 15 13:28:43 EST 2003

On Sat, 15 Mar 2003 10:57:21 +0100
Mattias Gaertner <nc-gaertnma at netcologne.de> wrote:

> On 14 Mar 2003 18:43:15 -0600
> Tony Maro <tony at maro.net> wrote:
> > Have I missed something or is there still no progress on making modal or
> > always on top forms always stay on top?
> There is a little progress:
> Forms created with fsStayOnTop and bsNone are created as GTK_WINDOW_POPUP,
> so that they stay always on top. The IDE splash screen uses this.
> I just fixed and activated the transient relationship for modal forms.
> That means a modal form always stays on top of the last focused form. It
> does not stay on top of not focused forms. The best solution would be:
> When a form is shown modal, all other forms should be transient connected
> in the current z order. And as soon as the modal form is closed, the
> artificial transients connections must be dissolved.

Ok, this was crap. Sometimes modal forms were created behind existing ones.
Therefore I implemented a hopefully better approach. Everytime a form is
shown or hidden, all transient relationships are updated. If there is a non
modal form, there is no transient relationship. If there are modal forms,
the modal forms are transient in the right order and non modal forms are
transient due to the gtk window top level list. This is not neccessarily the
current z order. But it seems that to find out the correct z order is up to
the gtk2 interface. (Although gtk2 also contains functions to disorder the
gtk toplevel window list). 

I hope there is no windowmanager, that does not like resetting the transient
window relationsship. And I have not tested, what happens, if non top forms
are hidden, but it should work ... .


More information about the Lazarus mailing list