[Lazarus] Just curious: Source Editor's caption changes at runtime (Linux/GTK2/KDE)

Martin lazarus at mfriebe.de
Mon Oct 24 01:35:41 CEST 2011


On 24/10/2011 00:11, Bart wrote:
> Hi,
>
> Some time ago I noticed that my source editor's caption changed form
> "Source Editor" to "Source Editor<2>", and then it would change back
> again.
angel brackets <> ? Not round ones () ?

> (I think it is a feature of my WM to add<2>  to the caption of the
> window, if another window with the same caption already exists. I use
> KDE and have Lazarus built for GTK2)
>
> However, I never saw 2 instances of the source editor.
>
> Then some time later, Lazarus caused some floating point error, and I
> was offered the choice to exit or continue. I chose continue, and to
> my surprise I now really had 2 source editors!
That is odd. Because the new one is only created, after the first one is 
hidden. So you should not have 2 at that time.

Maybe you have a project, or project default or something that wants 2 
Source-Editors? So that would cause it to be named "SourceEditor (2)" 
round brackets.

Lazarus supports multiply open editor windows.

> I noticed that every time I open (or create) another project, the
> caption of the source editor is changed.
> So it seems that for each project a new instance of a source editor is
> created, and then the old one is destroyed?
old.hide
new.create / new.show
old.destroy

see below

> I don't remember seeing the caption of the source editor change some months ago.
> IMHO it doesn't look very "professional" (please do not feel offended!).
>
> Can this behaviour be prevented/fixed in any way?
>

If you close a project, then all files are closed, so all tabs are 
removed from the editor, and the window is closed. Then a new one is 
created.

The only thing is, this may have been triggered by a key or mouse click 
that is handled by the source-editor window. For example, if you pressed 
a key combo to open another project, while the source editor was 
focused, then the windows onKey handler is called, and the entire 
close/opening is called from within that key-handler.

So the window (LCL class) can not yet be destroyed, it may still be 
executed. Therefore when all tabs are closed the first source editor 
window is Closed (as in hide) but not destroyed. It will be scheduled 
for destruction and released as soon as it is safe.

I am not sure how the GTK or QT widgetset handle hidden windows. So I 
can't comment on the rest.
Seems that your window manager detects




More information about the Lazarus mailing list