Bug 1522474 - [Wayland] Commit wl_surface state right after its creation, r=ashie
authorMartin Stransky <stransky@redhat.com>
Fri, 25 Jan 2019 03:37:52 +0000
changeset 515404 e7ca2a8c3611c6a9399a2d0651a16e08f983b93e
parent 515403 686e61adb6281c0a2771cbcbab538a577ebfd14d
child 515405 5ca32ef2d3908f2011804fe2e7f1b377e98c975a
push id1953
push userffxbld-merge
push dateMon, 11 Mar 2019 12:10:20 +0000
treeherdermozilla-release@9c35dcbaa899 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersashie
bugs1522474
milestone66.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1522474 - [Wayland] Commit wl_surface state right after its creation, r=ashie Differential Revision: https://phabricator.services.mozilla.com/D17498
widget/gtk/mozcontainer.cpp
--- a/widget/gtk/mozcontainer.cpp
+++ b/widget/gtk/mozcontainer.cpp
@@ -500,32 +500,35 @@ struct wl_surface *moz_container_get_wl_
     struct wl_compositor *compositor =
         sGdkWaylandDisplayGetWlCompositor(display);
     container->surface = wl_compositor_create_surface(compositor);
 
     nsWaylandDisplay *waylandDisplay = WaylandDisplayGet(display);
     container->subsurface = wl_subcompositor_get_subsurface(
         waylandDisplay->GetSubcompositor(), container->surface,
         moz_container_get_gtk_container_surface(container));
-    WaylandDisplayRelease(waylandDisplay);
 
     GdkWindow *window = gtk_widget_get_window(GTK_WIDGET(container));
     gint x, y;
     gdk_window_get_position(window, &x, &y);
     wl_subsurface_set_position(container->subsurface, x, y);
     wl_subsurface_set_desync(container->subsurface);
 
     // Route input to parent wl_surface owned by Gtk+ so we get input
     // events from Gtk+.
     wl_region *region = wl_compositor_create_region(compositor);
     wl_surface_set_input_region(container->surface, region);
     wl_region_destroy(region);
 
     wl_surface_set_buffer_scale(container->surface,
                                 moz_container_get_scale(container));
+
+    wl_surface_commit(container->surface);
+    wl_display_flush(waylandDisplay->GetDisplay());
+    WaylandDisplayRelease(waylandDisplay);
   }
 
   return container->surface;
 }
 
 struct wl_egl_window *moz_container_get_wl_egl_window(MozContainer *container) {
   if (!container->eglwindow) {
     wl_surface *surface = moz_container_get_wl_surface(container);