summaryrefslogtreecommitdiff
path: root/mozilla-1566876-webrtc-ind.patch
blob: 598f58f3f245809de763d78d539020ca92d66785 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp
--- a/widget/gtk/nsWindow.cpp
+++ b/widget/gtk/nsWindow.cpp
@@ -3504,12 +3504,6 @@
   mBounds = aRect;
   ConstrainSize(&mBounds.width, &mBounds.height);
 
-  // eWindowType_child is not supported on Wayland. Just switch to toplevel
-  // as a workaround.
-  if (!mIsX11Display && mWindowType == eWindowType_child) {
-    mWindowType = eWindowType_toplevel;
-  }
-
   // figure out our parent window
   GtkWidget* parentMozContainer = nullptr;
   GtkContainer* parentGtkContainer = nullptr;
@@ -3543,6 +3537,18 @@
     topLevelParent = GTK_WINDOW(gtk_widget_get_toplevel(parentMozContainer));
   }
 
+  if (!mIsX11Display) {
+    if (mWindowType == eWindowType_child) {
+      // eWindowType_child is not supported on Wayland. Just switch to toplevel
+      // as a workaround.
+      mWindowType = eWindowType_toplevel;
+    } else if (mWindowType == eWindowType_popup && !topLevelParent) {
+      // Workaround for Wayland where the popup windows always need to have
+      // parent window. For example webrtc ui is a popup window without parent.
+      mWindowType = eWindowType_toplevel;
+    }
+  }
+
   // ok, create our windows
   switch (mWindowType) {
     case eWindowType_dialog:

bgstack15