Forum > GTK

Problem with Alt + Tab between Forms



Since version 0.9.30 of Lazarus I find problems at run-time deplacing from the forms of a project with Alt + Tab, if there are data-aware controls.

If I move from one form to another and then back on the form of departure:
-If I was on a DBEdit, the latest changes are lost (but here I could solve with a Post in the Deactivate event);
-If I go on a DBGrid there are big problems to enter the data in the cells, usually I can insert data the first time in a cell, but when I leave the cell, the cell no longer has the red border and each character replaces the previous one, so it is difficult to write text.

Initially I thought it was a bug in the DBGrid, because with version 0.9.30 there were some problems with the DBGrid, and I segnaled the bug along with the other problems of the DBGrid:

Now I noticed that the problem concerns the fact of moving with Alt + Tab and affects all data-aware components, even if the problem is major with the DBGrid, and I opened the problem in a specific way:

Unfortunately I have not yet received a response and I do not know if and when the problem will be corrected.

The problem seems to occur on the Activate event, that means when I go on a form with Alt + Tab:

-If I move between the forms/windows with the mouse on the TaskBar there are no problems;
-If I move between the forms/windows by code it works well;
-If I move from one form to another with the TaskBar and back with Alt + Tab the problem occurs;
-If I move from one form to another with Alt + Tab and return the TaskBar with the problem does not occur.

I use Linux (Debian, Squeeze) with GTK2.

All the versions 0.9.30,,, and the new 1.0 of Lazarus have the same problem, which forces me to stay still at version which works very well, but now is old.

I do not know what to do to solve, I would try to bypass the problem in order to be able to use Lazarus 1.0. Unfortunately, this problem is too serious, I have a complex project with dozens of forms in which the user moves continuously.

Has anyone else encountered the same problem?

Do you have any advice in order to bypass the problem and make use of the latest versions of Lazarus?

Thanks very much for any help.

Sorry for my bad English.


Hi Stefano,

Could you post a sample project that demonstrates the above behavior?   IT would make it easier for others to test and seeing the code is always a good thing.



Hallo Knipfty,

I join a sample project. The project uses a Firebird database. I've made a unit that uses SQLDb, another unit that uses UIB and FBDataset. You can choose the unit you prefer.

You need to set your path to the Firebird DB. The Firebird database is attached also in FBK (Backup) Format, and also as FDB file.

In the begin of the main form I've explained better the problem.

Thank you very much for any Help.

Best regards,


Hello Stefano,

I'm doing a little traveling right now and probably won't get a chance to look at this until the weekend.


Thank you Knipfty, don't worry, I can wait the week-end.

Meanwhile I've uploaded the Test Project auch in the Bugtracker:
and added the bug of the DbGrid that lost focus:

Thank you very much if you can help me.

Best regards,



[0] Message Index

Go to full version