Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2011-10

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

7 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Bart

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.
(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!

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?

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?

Bart

Reply by email

Martin
to Bart
Bart wrote 5 lines
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 () ?

Show quoted text 9 lines
(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

Show quoted text 5 lines
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

Reply by email

Unknown author
to Martin
Martin wrote 25 lines
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 have noticed the same behaviour at times, but can assure you that I never open multiple editor windows.

It's not a real problem, just a freakish feature :-)

Michael.

Reply by email

Bart
to Martin: angel brackets ? Not round ones () ? That is odd. Because the new one is only created,…
Martin wrote
angel brackets ? Not round ones () ?

Yes, angle brackets indeed.

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.

I don't think that is the case.
It happens on newly created projects too.

old.hide new.create / new.show old.destroy

I think my WM still detects the hidden window.

If I am the only one "suffering" from this then: never mind. Otherwise we could do:

old.hide
old.caption := ''
new.create
new.show
old.free

Bart

Reply by email

Martin
to Bart
Bart wrote 11 lines
I think my WM still detects the hidden window. If I am the only one "suffering" from this then: never mind. Otherwise we could do: old.hide old.caption := '' new.create new.show old.free

That needs to be carefully tested.

the IDE's layout storage reads the forms caption, and uses this. So if it gets modified, it may cause trouble....

Reply by email

Mattias Gaertner
to Martin
Show quoted text 18 lines
On 24/10/2011 14:51, Bart wrote: > I think my WM still detects the hidden window. > > If I am the only one "suffering" from this then: never mind. > Otherwise we could do: > > old.hide > old.caption := '' > new.create > new.show > old.free > That needs to be carefully tested. the IDE's layout storage reads the forms caption, and uses this. So if it gets modified, it may cause trouble....

It uses the name.
Where does it use the caption?

Mattias

Reply by email

Martin
to Mattias Gaertner
Mattias Gaertner wrote 23 lines
On Sat, 12 Nov 2011 21:25:11 +0000 Martin wrote: > On 24/10/2011 14:51, Bart wrote: >> I think my WM still detects the hidden window. >> >> If I am the only one "suffering" from this then: never mind. >> Otherwise we could do: >> >> old.hide >> old.caption := '' >> new.create >> new.show >> old.free >> > > That needs to be carefully tested. > > the IDE's layout storage reads the forms caption, and uses this. So if > it gets modified, it may cause trouble.... It uses the name. Where does it use the caption?

Maybe I was wrong, I wrote that from memory... Will need to check

Reply by email