{"record":{"id":"c1e4d141e36f3467","repo":"FyroxEngine/Fyrox","slug":"window-name-is-empty-wrong-widget-will-be-used-as","errorCode":null,"errorMessage":"Window name is empty, wrong widget will be used as a tile content. Assign a unique name to the window used in a docking manager!","messagePattern":"Window name is empty, wrong widget will be used as a tile content\\. Assign a unique name to the window used in a docking manager!","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"fyrox-ui/src/dock/config.rs","lineNumber":142,"sourceCode":"            TileContentDescriptor::SplitTiles(tiles) => {\n                for tile in tiles.children.iter() {\n                    if tile.content.has_window(window) {\n                        return true;\n                    }\n                }\n                false\n            }\n        }\n    }\n}\n\nfn find_window(\n    window_name: &ImmutableString,\n    ui: &mut UserInterface,\n    windows: &[Handle<Window>],\n) -> Handle<Window> {\n    if window_name.is_empty() {\n        Log::warn(\n            \"Window name is empty, wrong widget will be used as a \\\n        tile content. Assign a unique name to the window used in a docking \\\n        manager!\",\n        );\n    }\n\n    let window_handle = ui\n        .find_handle(ui.root(), &mut |n| {\n            n.is_or_has_field::<Window>() && n.name == *window_name\n        })\n        .to_variant();\n\n    if window_handle.is_none() {\n        for other_window_handle in windows.iter().cloned() {\n            if let Ok(window_node) = ui.try_get(other_window_handle) {\n                if &window_node.name == window_name {\n                    return other_window_handle;\n                }","sourceCodeStart":124,"sourceCodeEnd":160,"githubUrl":"https://github.com/FyroxEngine/Fyrox/blob/76c91aad8eca488ce527b1af707be8b3b24ad72d/fyrox-ui/src/dock/config.rs#L124-L160","documentation":"The docking manager's find_window resolves a serialized tile's content by looking up a Window widget by its unique name. If the stored window name is empty it cannot resolve the correct window, emits this warning, and falls back to using whatever handle the lookup yields — the wrong widget may appear as tile content. It signals a docking layout config missing window names.","triggerScenarios":"Deserializing/creating a docking tile layout whose TileDefinition or DockingManagerLayout references windows with an empty name string; create_tile calls find_window with an empty ImmutableString window_name.","commonSituations":"A docking layout was serialized before windows were named, layout JSON was hand-edited and the name field cleared, or windows created programmatically were never given unique .name values before being registered with the docking manager.","solutions":["Assign a unique name to every Window used with the docking manager before saving/serializing its layout.","Inspect the layout/config file (docking manager layout JSON) and fill in the empty window name entries.","Re-serialize the layout after windows are named so tiles reference the correct windows.","Guard programmatic window creation with builder .name(\"unique-id\") calls to prevent empty names."],"exampleFix":"// before\nlet window = WindowBuilder::new(widget_builder)\n    // no name set\n    .build(&mut ui.build_ctx());\n// after\nlet window = WindowBuilder::new(widget_builder)\n    .with_name(\"MyToolWindow\") // unique per docking-managed window\n    .build(&mut ui.build_ctx());","handlingStrategy":"validation","validationCode":"// Before creating/serializing docking tiles\nassert!(!window.widget().name.is_empty(), \"docking-managed window must have a unique name\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always call .with_name(\"unique-id\") on WindowBuilder for docking-managed windows.","Never hand-edit layout files to remove name fields.","Re-serialize layouts only after all windows are named.","Log/validate layout JSON on load to catch empty names early."],"tags":["gui","docking","config"],"backgroundTag":"empty-required-field","analyzedSha":"76c91aad8eca488ce527b1af707be8b3b24ad72d","analyzedAt":"2026-09-10T16:04:01.633Z","contentChangedAt":"2026-09-10T16:04:01.633Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}