View Issue Details

IDProjectCategoryView StatusLast Update
0016165LazarusIDEpublic2011-12-01 11:25
ReporterGraeme Geldenhuys Assigned ToMartin Friebe  
Status closedResolutionfixed 
Platformx86OSUbuntu Linux 
Product Version0.9.29 (SVN) 
Target Version0.9.30Fixed in Version0.9.29 (SVN) 
Summary0016165: All editor tabs close unexpectedly except for one I clicked on
DescriptionThis bug occurs in, and latest

I cannot find a consistent way to reproduce this error - it happens randomly, but very annoying.

Say I have ten files open - seeing ten tabs in the editor window. I click the x button of a specific tab to close that file. Lazarus IDE then closes ALL other tabs except for the one I clicked on! :-/

As far as I remember, this bug has been around since 0.9.27. I often work with a lot of files open, so you should understand how annoying it is when all files are close and you have to reopen them all to continue working. This happens at least 3-5 per day.

Lazarus 0.9.29 rUnknown FPC 2.4.1 x86_64-linux-gtk 2 (beta)

I don't know if this is a GTK2 specific issue or not. I only develop using Lazarus compiled with GTK2.
TagsNo tags attached.
Fixed in Revision28788
WidgetsetGTK 2
Attached Files


related to 0014102 closedMarc Weustink Alt key gets stuck 
related to 0018033 closedMartin Friebe Suddenly editor closes all tabs 


Martin Friebe

2010-03-31 13:18

manager   ~0036319

Never happened on Windows, but if it is related to the close-X-buttons => they don't exist on Win.

The behaviour you describe is expected if you hold the CRTL key down while clicking a close button.

If you have not hold the CTRL key down, then check if lazarus thinks you do (e.g. if you keep typing do keys react as control sequence?)

Graeme Geldenhuys

2010-03-31 13:41

reporter   ~0036321

I'm definitely not holding down the Ctrl key (never actually new about that feature). When it happens again, I'll type other standard a..z keys and see if IDE thinks Ctrl key is stuck.

Graeme Geldenhuys

2010-03-31 13:47

reporter   ~0036322

OK, playing around a bit and going on a hunch I can now reproduce the bug every time.

I have the fpGUI Forms Designer setup as an external tool with keyboard shortcut Ctrl+Shift+F12. The fpGUI UI Designer loads the current focused source editor file.

After I close fpGUI UI Designer (even if I made no changes to the form), and then click on any x button on a tab, all tabs except for that one closes. This happens every time. Finally able to reproduce it on demand. :-)

And I tested the "Ctrl key being stuck" theory. That doesn't seem to be the cause. Typing the letter 'g' after the tabs are unexpectedly closed doesn't bring up the Procedure List (Ctrl+g shortcut), it correctly inserts the letter 'g' into the remaining source file.

Graeme Geldenhuys

2010-03-31 13:54

reporter   ~0036323

Last edited: 2010-03-31 14:02

Further testing reveals that it has nothing to do with fpGUI UI Designer either. I setup a new external tool using Ctrl+Shift+F12 which simply opens the Gnome Terminal.

After launching the external tool, closing it, and then clicking any x button on any tab, closes all other tabs.

Even more testing reveals the bug is reproducible with any keyboard shortcut used for external tools that use the Ctrl key. Ctrl+F3, Ctrl+F2, Ctrl+Numpad_1 etc.. So maybe you theory about the Ctrl key has some truth after all.

Martin Friebe

2010-03-31 14:19

manager   ~0036324

reproduced on ubuntu

Martin Friebe

2010-03-31 14:30

manager   ~0036325

It is a problem with a cached CTRL key.

It seems the CTRL key is correctly determined for key-press, but not for mouse-events.

Focus Lazarus (SourceEditor), and hold down CTRL. While holding CTRL select any none-Lazarus Window. Let the CTRL key go.

Move the mouse over the Lazarus SourceEditor => you will see CRTL-mouse links are shown (Lazarus still thinks CTRL is down).

Same applies if you click the close-button of a tab

Zeljan Rikalo

2010-03-31 17:24

developer   ~0036331

Yes, qt shows same behaviour, but when I click on close tab it doesn't close all another tabs except that one. So, gtk2 is missing something.
Who and why is caching ctrl ? ws or lcl ?

Zeljan Rikalo

2010-03-31 18:15

developer   ~0036332

Qt is fixed, now it delivers correct ctrl , alt & shift state with mousemove event.

Zeljan Rikalo

2010-03-31 19:01

developer   ~0036334

gtk2 mousemove event is ok, If I press ctrl, select another application window, release ctrl, and move mouse back over source editor, it clearly shows mousemove event without ctrl.

Martin Friebe

2010-11-24 00:12

manager   ~0043448

I added an option ( in the editor options / "multi windows and pages" section, which has all the notebook related stuff). You can now disable the ctrl-middle click (it will then become a normal middle click).
This does not fix the underlying ctrl-key-state issue.

Martin Friebe

2010-12-20 13:00

manager   ~0044423

Please close if ok

Issue History

Date Modified Username Field Change
2010-03-31 12:10 Graeme Geldenhuys New Issue
2010-03-31 13:18 Martin Friebe Note Added: 0036319
2010-03-31 13:41 Graeme Geldenhuys Note Added: 0036321
2010-03-31 13:47 Graeme Geldenhuys Note Added: 0036322
2010-03-31 13:54 Graeme Geldenhuys Note Added: 0036323
2010-03-31 14:02 Graeme Geldenhuys Note Edited: 0036323
2010-03-31 14:19 Martin Friebe LazTarget => 1.0
2010-03-31 14:19 Martin Friebe Note Added: 0036324
2010-03-31 14:19 Martin Friebe Status new => confirmed
2010-03-31 14:30 Martin Friebe Note Added: 0036325
2010-03-31 14:31 Martin Friebe Relationship added related to 0014102
2010-03-31 17:24 Zeljan Rikalo Note Added: 0036331
2010-03-31 18:15 Zeljan Rikalo Note Added: 0036332
2010-03-31 19:01 Zeljan Rikalo Note Added: 0036334
2010-11-24 00:03 Martin Friebe Relationship added related to 0018033
2010-11-24 00:12 Martin Friebe Note Added: 0043448
2010-12-20 13:00 Martin Friebe Fixed in Revision => 28788
2010-12-20 13:00 Martin Friebe Widgetset => GTK 2
2010-12-20 13:00 Martin Friebe Status confirmed => resolved
2010-12-20 13:00 Martin Friebe Fixed in Version => 0.9.29 (SVN)
2010-12-20 13:00 Martin Friebe Resolution open => fixed
2010-12-20 13:00 Martin Friebe Assigned To => Martin Friebe
2010-12-20 13:00 Martin Friebe Note Added: 0044423
2010-12-20 13:00 Martin Friebe Target Version => 0.9.30
2011-12-01 11:25 Marc Weustink Status resolved => closed