summaryrefslogtreecommitdiff
path: root/D145541.diff
blob: 7ca3a2e1b76b5f321e91e49bc7cc5695abb37d27 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
diff --git a/widget/gtk/MozContainerWayland.cpp b/widget/gtk/MozContainerWayland.cpp
--- a/widget/gtk/MozContainerWayland.cpp
+++ b/widget/gtk/MozContainerWayland.cpp
@@ -527,10 +527,16 @@
       return;
     }
 
     LOGWAYLAND("%s [%p] scale %d\n", __FUNCTION__,
                (void*)moz_container_get_nsWindow(container), scale);
+    // There is a chance that the attached wl_buffer has not yet been doubled
+    // on the main thread when scale factor changed to 2. This leads to
+    // crash with the following message:
+    // Buffer size (AxB) must be an integer multiple of the buffer_scale (2)
+    // Removing the possibly wrong wl_buffer to prevent that crash:
+    wl_surface_attach(wl_container->surface, nullptr, 0, 0);
     wl_surface_set_buffer_scale(wl_container->surface, scale);
     wl_container->buffer_scale = scale;
   }
 }
 

bgstack15