Recent

Author Topic: Editor Ghost window when exiting Lazarus  (Read 282 times)

Bruce44

  • New Member
  • *
  • Posts: 19
Editor Ghost window when exiting Lazarus
« on: June 03, 2026, 09:06:27 am »
Hello
When exiting Lazarus IDE, most of the time, The main Lazarus Panel stays displayed on screen (see attachement).
There is absolutely no more Lazarus  processes in memory.
When using tools to display all existing Windows, I can't find any window that has 'Lazarus' as a Caption text
Nothing happens when clicking on the different icons of the lazarus bar.
I can't resize the window. I can't move it, close it.
If I click on the location of the top bar (for instance an icon behind it), it acts as if the Lazarus window doesn't exist and execute the action behind it !   
It is really a ghost window that seems to exist nowhere... except on screen.
But this is just annoying when using some software because Lazarus Windows bar can hide some useful info.
Power OFF, then ON the screen doesn't change ! 

After a lot of searchs, the only solution I found is to kill the 'dwm.exe' process in the task manager.
It resets the screen display when restarting automatically.
After reset, the Lazarus ghost window disappears.

I think it has someting to see with HDR monitor.

Did someone already have the same troubles ?
Does someone know why Lazarus IDE generates this ghost window (I never had this behavior with the numerous software I use on the same monitor)
« Last Edit: June 03, 2026, 09:08:27 am by Bruce44 »

Zvoni

  • Hero Member
  • *****
  • Posts: 3397
Re: Editor Ghost window when exiting Lazarus
« Reply #1 on: June 03, 2026, 09:53:42 am »
By any chance: Do you have animations in Win11 activated?

Settings > Accessibility > Visual Effects
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

Thaddy

  • Hero Member
  • *****
  • Posts: 19248
  • Glad to be alive.
Re: Editor Ghost window when exiting Lazarus
« Reply #2 on: June 03, 2026, 10:01:33 am »
Looks like a display driver issue. I have seen that before. Also with other programs.
There's a refresh missing. On windows do right-click|refresh (ctrl-r does not work on all windows versions)
« Last Edit: June 03, 2026, 10:10:59 am by Thaddy »
objects are fine constructs. You can even initialize them with constructors.

Bruce44

  • New Member
  • *
  • Posts: 19
Re: Editor Ghost window when exiting Lazarus
« Reply #3 on: June 03, 2026, 10:20:56 am »
By any chance: Do you have animations in Win11 activated?

Settings > Accessibility > Visual Effects

Yes I have ! So I remove Visual effects to check
After somes tries, I can't reproduce this problem.
But, it didn't appear systematically.
I will revert if it appears again

Thaddy

  • Hero Member
  • *****
  • Posts: 19248
  • Glad to be alive.
Re: Editor Ghost window when exiting Lazarus
« Reply #4 on: June 03, 2026, 10:54:26 am »
If you happen to have the issue with an AMD Radion driver, just update the driver: I did that because of the same issue about 10-12months ago.
objects are fine constructs. You can even initialize them with constructors.

Bruce44

  • New Member
  • *
  • Posts: 19
Re: Editor Ghost window when exiting Lazarus
« Reply #5 on: June 03, 2026, 11:29:43 am »
If you happen to have the issue with an AMD Radion driver, just update the driver: I did that because of the same issue about 10-12months ago.

I have a AMD Radeon 780M Graphics card with 32.0.11021.1011 from June 2024.
I will try to install a more recent driver...



marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12894
  • FPC developer.
Re: Editor Ghost window when exiting Lazarus
« Reply #6 on: June 03, 2026, 11:51:22 am »
I also see this with Lazarus generated GUI apps. I suspect it has something to do with how the "main window" is handled (Win7/win10 changed something there).

I have nvidia, so my guess the graphics driver is out.

Thaddy

  • Hero Member
  • *****
  • Posts: 19248
  • Glad to be alive.
Re: Editor Ghost window when exiting Lazarus
« Reply #7 on: June 03, 2026, 11:57:09 am »
@Marcov
Seems so, but the issue also appeared with Geany - my usual non-visual programming editor - in my case and that is definitely not a Lazarus application. (after edlin was abandoned in all but FreeDos)
« Last Edit: June 03, 2026, 12:02:14 pm by Thaddy »
objects are fine constructs. You can even initialize them with constructors.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12398
  • Debugger - SynEdit - and more
    • wiki
Re: Editor Ghost window when exiting Lazarus
« Reply #8 on: June 03, 2026, 12:16:32 pm »
I don't know if that got fixed (I recall having mentioned it before, but can't find the reference)....

If a component (maybe the main form) is destroyed using "ReleaseComponent" then this may happen to late.
I.e. it may only happen when the WS code is already shutting down (that will call application.destroy, and that will run the pending async-event).

So it might be, that such a form does not properly release its handle.



One way is to trigger the async processing in the project code (after Application.Run returns). At that point the WS code shouldn't have gone into shutdown (that happens in a finalize section).
=> Application.ProcessMessages should do that. Just add to the main project code....

Or add the end of
procedure TApplication.Run;
....
  ProcessAsyncCallQueue;
end;


But then again, I don't know if that is the cause.

Though when I had some errors (in a component, that crashed for that reason), it did happen "sometimes" only. (not sure, timing or other circumstances)

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12398
  • Debugger - SynEdit - and more
    • wiki
Re: Editor Ghost window when exiting Lazarus
« Reply #9 on: June 03, 2026, 12:29:56 pm »
just checked: main form may not be handled by ReleaseComponent...

Thaddy

  • Hero Member
  • *****
  • Posts: 19248
  • Glad to be alive.
Re: Editor Ghost window when exiting Lazarus
« Reply #10 on: June 03, 2026, 01:13:07 pm »
That does not explain the process is not to be seen anywhere. Can that cause a repaint issue?
objects are fine constructs. You can even initialize them with constructors.

Zvoni

  • Hero Member
  • *****
  • Posts: 3397
Re: Editor Ghost window when exiting Lazarus
« Reply #11 on: June 03, 2026, 02:37:00 pm »
Guys: Remember: OP's Issue is when exiting the Lazarus IDE, not one of his Programs written with it
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

Bruce44

  • New Member
  • *
  • Posts: 19
Re: Editor Ghost window when exiting Lazarus
« Reply #12 on: June 03, 2026, 02:37:20 pm »
That does not explain the process is not to be seen anywhere. Can that cause a repaint issue?

1 - I installed the last driver version.
For now, I'm not able to reproduce the problem.

2 - I confirm there is no Lazarus process.
Lazarus closes without error each time. 

You're right, this is certainly a Windows repaint problem, due to possibly a bad Radeon driver or another sort of bug in Windows ?!

 


LeP

  • Sr. Member
  • ****
  • Posts: 318
Re: Editor Ghost window when exiting Lazarus
« Reply #13 on: June 03, 2026, 03:07:12 pm »
Ghost process is not so uncommon in Windows, but it's not a Windows issue per se.

If you want to see if some process is locked around Windows system, use Find menu of "Process Explorer" (from SysInternals: https://www.sysinternals.com). Choose "Find Handle or DLL" and put there your exe name (or DLL or something else).

You will see if the process is in Windows memory somewhere and who lock it.

You must execute Process Explorer with Administrative rights to be usefull.
Un Sistema per domarli, un IDE per trovarli, un codice per ghermirli e nel framework incatenarli.
An operating system to tame them, an IDE to find them, a code to catch them and in the framework chain them.

 

TinyPortal © 2005-2018