{"record":{"id":"773b1c1e69d9713c","repo":"Flow-Launcher/Flow.Launcher","slug":"invalid-corner-type","errorCode":null,"errorMessage":"Invalid corner type","messagePattern":"Invalid corner type","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"warning","filePath":"Flow.Launcher.Infrastructure/Win32Helper.cs","lineNumber":105,"sourceCode":"                &darkMode,\n                (uint)Marshal.SizeOf<int>()).Succeeded;\n        }\n\n        /// <summary>\n        ///\n        /// </summary>\n        /// <param name=\"window\"></param>\n        /// <param name=\"cornerType\">DoNotRound, Round, RoundSmall, Default</param>\n        /// <returns></returns>\n        public static unsafe bool DWMSetCornerPreferenceForWindow(Window window, string cornerType)\n        {\n            var preference = cornerType switch\n            {\n                \"DoNotRound\" => DWM_WINDOW_CORNER_PREFERENCE.DWMWCP_DONOTROUND,\n                \"Round\" => DWM_WINDOW_CORNER_PREFERENCE.DWMWCP_ROUND,\n                \"RoundSmall\" => DWM_WINDOW_CORNER_PREFERENCE.DWMWCP_ROUNDSMALL,\n                \"Default\" => DWM_WINDOW_CORNER_PREFERENCE.DWMWCP_DEFAULT,\n                _ => throw new InvalidOperationException(\"Invalid corner type\")\n            };\n\n            return PInvoke.DwmSetWindowAttribute(\n                GetWindowHandle(window),\n                DWMWINDOWATTRIBUTE.DWMWA_WINDOW_CORNER_PREFERENCE,\n                &preference,\n                (uint)Marshal.SizeOf<int>()).Succeeded;\n        }\n\n        #endregion\n\n        #region Wallpaper\n\n        public static unsafe string GetWallpaperPath()\n        {\n            var wallpaperPtr = stackalloc char[(int)PInvoke.MAX_PATH];\n            PInvoke.SystemParametersInfo(SYSTEM_PARAMETERS_INFO_ACTION.SPI_GETDESKWALLPAPER, PInvoke.MAX_PATH,\n                wallpaperPtr,","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/Flow-Launcher/Flow.Launcher/blob/7fc63b07bbaa10a0f0b2601487913fcba9ed24b0/Flow.Launcher.Infrastructure/Win32Helper.cs#L87-L123","documentation":"Thrown as InvalidOperationException from DWMSetCornerPreferenceForWindow when the supplied cornerType string does not match any of the four accepted literal values: 'DoNotRound', 'Round', 'RoundSmall', 'Default'. The switch expression's default arm throws because the value cannot be mapped to a DWM_WINDOW_CORNER_PREFERENCE enum.","triggerScenarios":"A theme XAML or settings value specifies a WindowCornerType that is misspelled, differently cased (e.g. 'round', 'donotround'), localized, or a legacy value from an older version; a user hand-edited settings.json and typed an invalid corner type; a future version adds a new corner type string that this build doesn't recognize.","commonSituations":"Manual settings.json edit with a typo or wrong case; theme authored against a newer Flow Launcher version using a corner name not yet supported; locale-specific value ('Redondo') accidentally saved; copy-paste of a corner name from docs that don't match the code's literals.","solutions":["Set WindowCornerType to one of the exact literals: 'DoNotRound', 'Round', 'RoundSmall', or 'Default' (case-sensitive).","If loading from a theme/settings file, validate the value against the allowed set before calling this method.","Update Flow Launcher to a version that supports the corner type you intend to use.","Reset the setting to 'Default' and re-apply."],"exampleFix":"// before\nvar preference = cornerType switch\n{\n    \"DoNotRound\" => ..., \"Round\" => ..., \"RoundSmall\" => ..., \"Default\" => ...,\n    _ => throw new InvalidOperationException(\"Invalid corner type\")\n};\n\n// after — case-insensitive match with a safe default + log\nvar preference = cornerType?.Trim() switch\n{\n    \"DoNotRound\" or \"donotround\" => DWM_WINDOW_CORNER_PREFERENCE.DWMWCP_DONOTROUND,\n    \"Round\"      or \"round\"      => DWM_WINDOW_CORNER_PREFERENCE.DWMWCP_ROUND,\n    \"RoundSmall\" or \"roundsmall\" => DWM_WINDOW_CORNER_PREFERENCE.DWMWCP_ROUNDSMALL,\n    _ => DWM_WINDOW_CORNER_PREFERENCE.DWMWCP_DEFAULT\n};","handlingStrategy":"validation","validationCode":"var allowed = new[] { \"DoNotRound\", \"Round\", \"RoundSmall\", \"Default\" };\nif (!allowed.Contains(cornerType))\n{ Log.Warn(...); cornerType = \"Default\"; }","typeGuard":"static bool IsValidCornerType(string s) =>\n    s is \"DoNotRound\" or \"Round\" or \"RoundSmall\" or \"Default\";","tryCatchPattern":"try { Win32Helper.DWMSetCornerPreferenceForWindow(window, cornerType); }\ncatch (InvalidOperationException) { Win32Helper.DWMSetCornerPreferenceForWindow(window, \"Default\"); }","preventionTips":["Restrict theme/settings corner values to the four exact literals.","Validate the value against an allow-list before calling the API.","Avoid hand-editing settings.json for UI prefs; use the Settings UI.","Reset to 'Default' when in doubt."],"tags":["win32","ui","config","validation","dwm"],"backgroundTag":null,"analyzedSha":"7fc63b07bbaa10a0f0b2601487913fcba9ed24b0","analyzedAt":"2026-08-13T14:54:20.914Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}