Repository navigation
[linux] Startup fixes for the Vulkan GTK backend - #1
Conversation
|
Reviewed properly, the code holds up:
One thing is in the way. There is no wayland third party dir in the engine at all, so I do not think either of us should guess where these files belong. Two ways out:
I lean towards 2, so the startup fixes are not held hostage to the licensing question. Your work, your call. A few smaller things:
I would rather merge this when everything is right than merge early and patch afterwards, so take the time you need. Once it is clean I will rebase onto the branch so your commits keep their authorship. Thanks for putting real hardware behind this. Without your testing the backend would have gone into review crashing on startup and never showing a window. |
The runner shows the window on the "first-frame" signal, which the Vulkan renderer only emitted from its draw handler - and the draw handler cannot run before the window is shown, so the window never appeared. Announce it from FlutterEngineSetNextFrameCallback instead: it fires on the raster thread once the first frame is actually in the swapchain, regardless of window visibility. Routed to the view through a new FlRenderable.notify_first_frame so backends that present outside the GTK draw cycle can signal it. Tested on an unrealized view, matching how the runner receives it.
wl_subsurface.set_position is double-buffered state of the parent surface - "the scheduled coordinates will take effect whenever the state of the parent surface is applied" - so committing the child was a no-op for it. The position only applied when the tick-callback redraw happened to commit the parent.
Mode change only; the engine's pre-push formatting hook trips on it.
02c60a6 to
a53607e
Compare
|
Done, at the end I went with the second one. I really appreciate all the work on this and I'm happy to help any time =) |
|
@ales-drnz LGTM, thanks again! :) |
Fixes 1, 2, 4 and 5 from the discussion on flutter/flutter#189584, as requested on top of
d45d937be61:fl_opengl_manager_clear_currentcall inrealize_cb; there is noFlOpenGLManagerwhen the renderer is Vulkan.FlutterEngineSetNextFrameCallbackfires once the first frame is in the swapchain, regardless of window visibility, which breaks the show-window cycle. Routed through a newFlRenderable.notify_first_frame.set_positionis double-buffered state of the parent, so committing the child was a no-op.wp_viewport— declares the widget allocation as the viewport destination, from bothsize_allocateandrealize(GTK allocates before it realizes, so the initialsize_allocateruns before the manager exists). Includes the hand-written pre-1.20 viewporter client header discussed in the thread; happy to adjust its licensing treatment however you prefer.vulkan_native_surface_linux— mode change only; the engine's pre-push formatting hook trips on it.Thank you!