Skip to content

Commit f773b5e

Browse files
authored
Linux: Add fl_engine_poll_task_runner. (#7) (#8)
Exposes polling functionality from Linux task runner. Required to implement resize synchronization.
1 parent 5563d95 commit f773b5e

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

engine/src/flutter/shell/platform/linux/fl_engine.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -583,3 +583,9 @@ void fl_engine_execute_task(FlEngine* self, FlutterTask* task) {
583583
g_warning("Failed to run task");
584584
}
585585
}
586+
587+
G_MODULE_EXPORT void fl_engine_poll_task_runner(FlEngine* self) {
588+
g_return_if_fail(FL_IS_ENGINE(self));
589+
590+
fl_task_runner_wait(self->task_runner);
591+
}

engine/src/flutter/shell/platform/linux/public/flutter_linux/fl_engine.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,13 @@ gboolean fl_engine_start(FlEngine* engine, GError** error);
7070
*/
7171
FlBinaryMessenger* fl_engine_get_binary_messenger(FlEngine* engine);
7272

73+
/*
74+
* Blocks until a Flutter message is posted on task runner and then processes
75+
* it. Must be called on platform thread. During polling no other system
76+
* messages are processed.
77+
*/
78+
void fl_engine_poll_task_runner(FlEngine* self);
79+
7380
G_END_DECLS
7481

7582
#endif // FLUTTER_SHELL_PLATFORM_LINUX_PUBLIC_FLUTTER_LINUX_FL_ENGINE_H_

0 commit comments

Comments
 (0)