Skip to content

Conversation

@robert-ancell
Copy link
Contributor

We can't get this without returning the thread to Flutter, thus breaking the GTK draw update.

We can't get this without returning the thread to Flutter, thus breaking the GTK draw update.
@robert-ancell robert-ancell requested a review from knopp July 28, 2025 03:14
@github-actions github-actions bot added engine flutter/engine related. See also e: labels. platform-linux Building on or for Linux specifically a: desktop Running on desktop labels Jul 28, 2025
@robert-ancell robert-ancell requested a review from mattkae July 28, 2025 03:14
@robert-ancell
Copy link
Contributor Author

@knopp any ideas on how to do smooth resizing with merged threads? Would it be possible for the embedder to call into the engine to do the update in this case?

@knopp
Copy link
Member

knopp commented Jul 28, 2025

This should be possible by pumping (only) flutter event loop messages instead of g_cond_wait, i.e. fl_task_runner_block_main_thread and fl_task_runner_release_main_thread. It might be better to refactor the task runner to work similarly to other platforms, i.e. introduce something like fl_task_runner_poll_flutter_tasks() and call it in loop until the frame is available.

I'm having my laptop serviced this week (hopefully), once it is back I can give it a shot.

Copy link
Contributor

@mattkae mattkae left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have one nit, but I will defer to @knopp on the specifics of the thread merging here

FlCompositorSoftware* fl_compositor_software_new(FlEngine* engine) {
FlCompositorSoftware* self = FL_COMPOSITOR_SOFTWARE(
g_object_new(fl_compositor_software_get_type(), nullptr));
self->smooth_resize = !fl_engine_get_has_ui_on_platform_thread(engine);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Why not pass smooth_resize as a bool to the constructor instead of passing the entire engine?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did this for consistency with the OpenGL compositor mostly. I was also thinking this - are we asking the compositor to do smooth resizing or is the compositor deciding if it is capable? (This is what I ended up with). I think we'll be able to remove this in the future so it's probably not a big issue.

@robert-ancell
Copy link
Contributor Author

Fixed in #172893

@gemini-code-assist
Copy link
Contributor

Warning

There is an error in the Gemini Code Assist config file for this repository at .gemini/config.yaml. The configuration cannot be used until the file is fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: desktop Running on desktop engine flutter/engine related. See also e: labels. platform-linux Building on or for Linux specifically

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants