summaryrefslogtreecommitdiff
path: root/mozilla-1609732-pause-renderer.patch
blob: 6f159e1056dc9754ceb46bc21de7976c86e8b5b7 (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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
diff --git a/widget/gtk/nsWindow.h b/widget/gtk/nsWindow.h
--- a/widget/gtk/nsWindow.h
+++ b/widget/gtk/nsWindow.h
@@ -681,6 +681,7 @@
 
   bool IsMainMenuWindow();
   GtkWidget* ConfigureWaylandPopupWindows();
+  void PauseRemoteRenderer();
   void HideWaylandWindow();
   void HideWaylandTooltips();
   void HideWaylandPopupAndAllChildren();
diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp
--- a/widget/gtk/nsWindow.cpp
+++ b/widget/gtk/nsWindow.cpp
@@ -1386,10 +1386,10 @@
   }
 
   if (needsPositionUpdate && needsSizeUpdate) {
-    Resize(newBounds.x, newBounds.y, newBounds.width, newBounds.height, true);
+    mBounds = newBounds;
     NotifyWindowMoved(newBounds.x, newBounds.y);
   } else if (needsPositionUpdate) {
-    Move(newBounds.x, newBounds.y);
+    mBounds = newBounds;
     NotifyWindowMoved(newBounds.x, newBounds.y);
   } else {
     Resize(newBounds.width, newBounds.height, true);
@@ -1476,6 +1476,7 @@
   bool isWidgetVisible =
       (sGtkWidgetIsVisible != nullptr) && sGtkWidgetIsVisible(mShell);
   if (isWidgetVisible) {
+    PauseRemoteRenderer();
     gtk_widget_hide(mShell);
   }
 
@@ -4497,16 +4498,8 @@
   }
 }
 
-void nsWindow::HideWaylandWindow() {
+void nsWindow::PauseRemoteRenderer() {
 #ifdef MOZ_WAYLAND
-  if (mWindowType == eWindowType_popup) {
-    LOG(("nsWindow::HideWaylandWindow: popup [%p]\n", this));
-    GList* foundWindow = g_list_find(gVisibleWaylandPopupWindows, this);
-    if (foundWindow) {
-      gVisibleWaylandPopupWindows =
-          g_list_delete_link(gVisibleWaylandPopupWindows, foundWindow);
-    }
-  }
   if (!mIsDestroyed) {
     if (mContainer && moz_container_has_wl_egl_window(mContainer)) {
       // Because wl_egl_window is destroyed on moz_container_unmap(),
@@ -4529,6 +4522,18 @@
     }
   }
 #endif
+}
+
+void nsWindow::HideWaylandWindow() {
+  if (mWindowType == eWindowType_popup) {
+    LOG(("nsWindow::HideWaylandWindow: popup [%p]\n", this));
+    GList* foundWindow = g_list_find(gVisibleWaylandPopupWindows, this);
+    if (foundWindow) {
+      gVisibleWaylandPopupWindows =
+          g_list_delete_link(gVisibleWaylandPopupWindows, foundWindow);
+    }
+  }
+  PauseRemoteRenderer();
   gtk_widget_hide(mShell);
 }
 

bgstack15