vintagedave / firemonkey-container

Automatically exported from code.google.com/p/firemonkey-container
92 stars 34 forks source link

Application freezes #8

Closed djjd47130 closed 8 years ago

djjd47130 commented 8 years ago

I had been working on a small simple Firemonkey application where everything works just fine. It does consist of multiple threads, but everything is thread-safe with synchronized events, and while running under Firemonkey, all runs perfect.

Now I create a new empty VCL forms application and drop this container only, then add the FMX form as auto-create. I assign the FMX form to the container. The application starts up, I can see that it successfully created the FMX form inside the container, and that the threads did indeed start and showed status. However, I cannot interact with this application at all. In the first few seconds, I can move the form slightly across the screen, then everything locks up. I can't even click on the title bar. I have to terminate the process from the IDE or from Task Manager.

djjd47130 commented 8 years ago

I should have mentioned I'm using Delphi 10 Seattle Update 1.

djjd47130 commented 8 years ago

To add, the UI responds just fine at first if I do nothing. But the moment I click on it, that's when it freezes up and stops responding. Windows never even gives me the notice that it's not responding.

djjd47130 commented 8 years ago

I've tracked it down a bit. Everything works fine until I do something which triggers a TChangeTabAction on the FMX form. That's when it freezes up. I use this action to make a TTabControl smoothly slide back and forth between pages of data.

djjd47130 commented 8 years ago

Submitted question related to this on Stack Overflow: http://stackoverflow.com/questions/36585316/fmx-form-in-vcl-app-via-tfiremonkeycontainer-application-freezing

djjd47130 commented 8 years ago

MCVE Attached. FMXContainerBug.zip

vintagedave commented 8 years ago

Solved in the latest revision. It was due to the tab control calling FMX's Application.ProcessMessages method, and the FMX Container's assumption that since it prevented the FMX message loop running (it uses the VCL loop) the Windows app service HandleMessage and related methods would never be called. They are called when ProcessMessages is called manually.