Add Window at the end of SurfaceDescriptorFromXlib.

Bug: dawn:1246
Change-Id: I1917056e9bb2bde0997c072ab76963e9dd079bb3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/75420
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
diff --git a/dawn.json b/dawn.json
index 6e9882b..5af8d25 100644
--- a/dawn.json
+++ b/dawn.json
@@ -2296,7 +2296,7 @@
             {"name": "hwnd", "type": "void", "annotation": "*"}
         ]
     },
-    "surface descriptor from xlib": {
+    "surface descriptor from xlib window": {
         "category": "structure",
         "chained": "in",
         "tags": ["native"],
@@ -2358,7 +2358,7 @@
             {"value": 0, "name": "invalid", "valid": false},
             {"value": 1, "name": "surface descriptor from metal layer", "tags": ["native"]},
             {"value": 2, "name": "surface descriptor from windows HWND", "tags": ["native"]},
-            {"value": 3, "name": "surface descriptor from xlib", "tags": ["native"]},
+            {"value": 3, "name": "surface descriptor from xlib window", "tags": ["native"]},
             {"value": 4, "name": "surface descriptor from canvas HTML selector"},
             {"value": 5, "name": "shader module SPIRV descriptor"},
             {"value": 6, "name": "shader module WGSL descriptor"},
diff --git a/docs/codegen.md b/docs/codegen.md
index d4054ea..7f70e59 100644
--- a/docs/codegen.md
+++ b/docs/codegen.md
@@ -49,7 +49,7 @@
 **`"native"`**, doesn't have any other key. This is used to define native types that can be referenced by name in other things.
 
 **`"typedef"`** (usually only used for gradual deprecations):
- - `"name"`: the name of the things this is a typedef for.
+ - `"type"`: the name of the things this is a typedef for.
 
 **`"enum"`** an `uint32_t`-based enum value.
  - `"values"` an array of enum values. Each value is a dictionary containing:
diff --git a/src/dawn_native/Surface.cpp b/src/dawn_native/Surface.cpp
index 505fc60..5ec5ffd 100644
--- a/src/dawn_native/Surface.cpp
+++ b/src/dawn_native/Surface.cpp
@@ -69,7 +69,7 @@
                                      wgpu::SType::SurfaceDescriptorFromWindowsHWND,
                                      wgpu::SType::SurfaceDescriptorFromWindowsCoreWindow,
                                      wgpu::SType::SurfaceDescriptorFromWindowsSwapChainPanel,
-                                     wgpu::SType::SurfaceDescriptorFromXlib));
+                                     wgpu::SType::SurfaceDescriptorFromXlibWindow));
 
 #if defined(DAWN_ENABLE_BACKEND_METAL)
         const SurfaceDescriptorFromMetalLayer* metalDesc = nullptr;
@@ -116,7 +116,7 @@
 #endif  // defined(DAWN_PLATFORM_WINDOWS)
 
 #if defined(DAWN_USE_X11)
-        const SurfaceDescriptorFromXlib* xDesc = nullptr;
+        const SurfaceDescriptorFromXlibWindow* xDesc = nullptr;
         FindInChain(descriptor->nextInChain, &xDesc);
         if (xDesc) {
             // Check the validity of the window by calling a getter function on the window that
@@ -146,7 +146,7 @@
         const SurfaceDescriptorFromWindowsHWND* hwndDesc = nullptr;
         const SurfaceDescriptorFromWindowsCoreWindow* coreWindowDesc = nullptr;
         const SurfaceDescriptorFromWindowsSwapChainPanel* swapChainPanelDesc = nullptr;
-        const SurfaceDescriptorFromXlib* xDesc = nullptr;
+        const SurfaceDescriptorFromXlibWindow* xDesc = nullptr;
         FindInChain(descriptor->nextInChain, &metalDesc);
         FindInChain(descriptor->nextInChain, &hwndDesc);
         FindInChain(descriptor->nextInChain, &coreWindowDesc);
diff --git a/src/tests/end2end/WindowSurfaceTests.cpp b/src/tests/end2end/WindowSurfaceTests.cpp
index 1b9b7b9..c6b5481 100644
--- a/src/tests/end2end/WindowSurfaceTests.cpp
+++ b/src/tests/end2end/WindowSurfaceTests.cpp
@@ -181,12 +181,12 @@
     GLFWwindow* window = CreateWindow();
     std::unique_ptr<wgpu::ChainedStruct> chainedDescriptor =
         utils::SetupWindowAndGetSurfaceDescriptorForTesting(window);
-    ASSERT_EQ(chainedDescriptor->sType, wgpu::SType::SurfaceDescriptorFromXlib);
+    ASSERT_EQ(chainedDescriptor->sType, wgpu::SType::SurfaceDescriptorFromXlibWindow);
 }
 
 // Test with setting an invalid window
 TEST_F(WindowSurfaceInstanceTests, InvalidXWindow) {
-    wgpu::SurfaceDescriptorFromXlib chainedDescriptor;
+    wgpu::SurfaceDescriptorFromXlibWindow chainedDescriptor;
     chainedDescriptor.display = XOpenDisplay(nullptr);
     // From the "X Window System Protocol" "X Version 11, Release 6.8" page 2 at
     // https://www.x.org/releases/X11R7.5/doc/x11proto/proto.pdf
@@ -203,7 +203,7 @@
 
 // Test using Xlib when it is not supported
 TEST_F(WindowSurfaceInstanceTests, XlibSurfacesAreInvalid) {
-    wgpu::SurfaceDescriptorFromXlib chainedDescriptor;
+    wgpu::SurfaceDescriptorFromXlibWindow chainedDescriptor;
     chainedDescriptor.display = nullptr;
     chainedDescriptor.window = 0;
 
diff --git a/src/utils/GLFWUtils.cpp b/src/utils/GLFWUtils.cpp
index 3572ce8..9efbfb6d 100644
--- a/src/utils/GLFWUtils.cpp
+++ b/src/utils/GLFWUtils.cpp
@@ -71,8 +71,8 @@
 #elif defined(DAWN_USE_X11)
     std::unique_ptr<wgpu::ChainedStruct> SetupWindowAndGetSurfaceDescriptorForTesting(
         GLFWwindow* window) {
-        std::unique_ptr<wgpu::SurfaceDescriptorFromXlib> desc =
-            std::make_unique<wgpu::SurfaceDescriptorFromXlib>();
+        std::unique_ptr<wgpu::SurfaceDescriptorFromXlibWindow> desc =
+            std::make_unique<wgpu::SurfaceDescriptorFromXlibWindow>();
         desc->display = glfwGetX11Display();
         desc->window = glfwGetX11Window(window);
         return std::move(desc);