summaryrefslogtreecommitdiff
path: root/D133885.diff
blob: 246fc2a83a60f9cb9e01eac171dd8b2818dc5d5a (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
diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp
--- a/widget/gtk/nsWindow.cpp
+++ b/widget/gtk/nsWindow.cpp
@@ -2868,7 +2868,7 @@
   LOGW("nsWindow::RequestFocusWaylandWindow(%p) gFocusWindow %p",
        (void*)aWindow, gFocusWindow);
 
-  if (!gFocusWindow) {
+  if (!gFocusWindow || gFocusWindow->IsDestroyed()) {
     LOGW("  missing gFocusWindow, quit.");
   }
 
@@ -2883,13 +2883,16 @@
   uint32_t focusSerial;
   KeymapWrapper::GetFocusInfo(&focusSurface, &focusSerial);
   if (!focusSurface) {
-    LOGW("  We're missing focused window, quit.");
+    LOGW("  We're missing KeymapWrapper focused window, quit.");
     return;
   }
 
   GdkWindow* gdkWindow = gtk_widget_get_window(gFocusWindow->mShell);
-  wl_surface* surface =
-      gdkWindow ? gdk_wayland_window_get_wl_surface(gdkWindow) : nullptr;
+  if (!gdkWindow) {
+    LOGW("  gFocusWindow is not mapped, quit.");
+    return;
+  }
+  wl_surface* surface = gdk_wayland_window_get_wl_surface(gdkWindow);
   if (focusSurface != surface) {
     LOGW("  focused surface %p and gFocusWindow surface %p don't match, quit.",
          focusSurface, surface);

bgstack15