{"record":{"id":"d44e0b902ee677d6","repo":"JosefNemec/Playnite","slug":"not-supported-in-desktop-mode","errorCode":null,"errorMessage":"Not supported in Desktop mode.","messagePattern":"Not supported in Desktop mode\\.","errorType":"exception","errorClass":"NotSupportedInDesktopException","httpStatus":null,"severity":"error","filePath":"source/Playnite.DesktopApp/Api/MainViewAPI.cs","lineNumber":161,"sourceCode":"            if (!games.HasItems())\r\n                return null;\r\n\r\n            return mainModel.GamesEditor.EditGames(games);\r\n        }\r\n\r\n        public List<FilterPreset> GetSortedFilterPresets()\r\n        {\r\n            return mainModel.SortedFilterPresets.ToList();\r\n        }\r\n\r\n        public List<FilterPreset> GetSortedFilterFullscreenPresets()\r\n        {\r\n            return mainModel.SortedFilterFullscreenPresets.ToList();\r\n        }\r\n\r\n        public void ToggleFullscreenView()\r\n        {\r\n            throw new NotSupportedInDesktopException();\r\n        }\r\n    }\r\n}\r\n","sourceCodeStart":143,"sourceCodeEnd":165,"githubUrl":"https://github.com/JosefNemec/Playnite/blob/5911f4e964e628aa7a69c2030ab35101afa63067/source/Playnite.DesktopApp/Api/MainViewAPI.cs#L143-L165","documentation":"Thrown by the Desktop-mode IMainViewAPI.ToggleFullscreenView implementation. The shared MainViewAPI contract is implemented twice (Desktop and Fullscreen), and this particular method is a no-op stub in Desktop mode that intentionally throws NotSupportedInDesktopException. It signals an operation that only has a meaningful body in the Fullscreen host.","triggerScenarios":"An extension or script calls PlayniteApi.MainView.ToggleFullscreenView() while the application is running in ApplicationMode.Desktop. The Desktop MainViewAPI is the active implementation, so the stub executes.","commonSituations":"A plugin written against the Fullscreen host running under the Desktop host; a generic command wired to a hotkey without checking the active mode; SDK samples copied without adapting to the host.","solutions":["Gate the call on the current application mode before invoking (check PlayniteApi.ApplicationInfo or the host mode).","Move the toggle logic into a mode-aware path that only calls this in Fullscreen mode.","If fullscreen switching is needed from Desktop, use the supported Desktop mechanism (e.g. application restart / mode switch) rather than this API."],"exampleFix":"// before\nPlayniteApi.MainView.ToggleFullscreenView();\n\n// after\nif (PlayniteApi.ApplicationInfo.Mode == ApplicationMode.Fullscreen)\n{\n    PlayniteApi.MainView.ToggleFullscreenView();\n}","handlingStrategy":"validation","validationCode":"if (PlayniteApi.ApplicationInfo.Mode == ApplicationMode.Fullscreen)\n{\n    PlayniteApi.MainView.ToggleFullscreenView();\n}","typeGuard":null,"tryCatchPattern":"try { PlayniteApi.MainView.ToggleFullscreenView(); }\ncatch (NotSupportedInDesktopException) { /* Desktop host: no-op */ }","preventionTips":["Branch behavior on the active application mode before calling mode-specific APIs.","Never assume an IMainViewAPI method is implemented in both hosts.","Wrap mode-specific calls so a host swap does not crash."],"tags":["api-mode","desktop","fullscreen","playnite"],"backgroundTag":null,"analyzedSha":"5911f4e964e628aa7a69c2030ab35101afa63067","analyzedAt":"2026-08-13T17:38:25.713Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}