{"record":{"id":"edd5dc42966975e1","repo":"LGUG2Z/komorebi","slug":"cannot-move-native-maximized-window-to-another-mon-edd5dc","errorCode":null,"errorMessage":"cannot move native maximized window to another monitor or workspace","messagePattern":"cannot move native maximized window to another monitor or workspace","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"komorebi/src/window_manager.rs","lineNumber":1635,"sourceCode":"        {\n            return self.move_container_to_workspace(workspace_idx, follow, None);\n        }\n\n        let offset = self.work_area_offset;\n        let mouse_follows_focus = self.mouse_follows_focus;\n\n        let monitor = self\n            .focused_monitor_mut()\n            .ok_or_eyre(\"there is no monitor\")?;\n\n        let current_area = monitor.work_area_size;\n\n        let workspace = monitor\n            .focused_workspace_mut()\n            .ok_or_eyre(\"there is no workspace\")?;\n\n        if workspace.maximized_window.is_some() {\n            bail!(\"cannot move native maximized window to another monitor or workspace\");\n        }\n\n        let foreground_hwnd = WindowsApi::foreground_window()?;\n        let floating_window_index = workspace\n            .floating_windows()\n            .iter()\n            .position(|w| w.hwnd == foreground_hwnd);\n\n        let floating_window =\n            floating_window_index.and_then(|idx| workspace.floating_windows_mut().remove(idx));\n        let container = if floating_window_index.is_none() {\n            Some(\n                workspace\n                    .remove_focused_container()\n                    .ok_or_eyre(\"there is no container\")?,\n            )\n        } else {\n            None","sourceCodeStart":1617,"sourceCodeEnd":1653,"githubUrl":"https://github.com/LGUG2Z/komorebi/blob/e0709f02bfae4e503bf4640f58ee75ecbbfdbb97/komorebi/src/window_manager.rs#L1617-L1653","documentation":"komorebi refuses to move a container to another monitor or workspace when the workspace's focused/registered window is a native (Windows-managed) maximized window. Native maximization hands the window's geometry to the OS, so komorebi cannot safely re-target its area on a different monitor's work area. The check happens before any monitor-to-monitor transfer is attempted in move_container_to_monitor.","triggerScenarios":"Calling move_container_to_monitor (directly or via process_command for the cycle-monitor/monitor-swap keybinds) while the source workspace has workspace.maximized_window set to Some — i.e. the user native-maximized a window (komorebi native maximization mode) and then attempts a monitor/workspace move.","commonSituations":"Users with komorebi.bar or native maximize behaviour pressing monitor-cycle hotkeys (e.g. komorebic cycle-monitor or move-window-to-monitor) while a browser/IDE is maximized via the OS; configs using 'komorebic maximize' with native management enabled.","solutions":["Restore the window from native maximization (unmaximize) before issuing the move command","Use komorebi's own maximize/monocle toggle instead of native OS maximization so windows stay in komorebi's layout model","Wrap the command in a pre-check or catch the error and no-op instead of surfacing it to the user","Update komorebi — newer versions handle maximized-window monitor moves more gracefully"],"exampleFix":"// before\nkomorebic focus-monitor 1 // fails if focused window is natively maximized\n// after\nkomorebic toggle-maximize  // unmaximize first\nkomorebic focus-monitor 1","handlingStrategy":"validation","validationCode":"// komorebi.json (v0.1.26+) dynamic function guard:\n{\n  \"type\": \"komorebic\",\n  \"args\": [\"cycle-monitor\"],\n  \"until\": \"handle-unmanaged-windows\"\n}\n// or in a script: check the focused workspace's maximized_window before moving","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Prefer komorebi's own maximize (not OS-native maximize) for windows you move across monitors","Unmaximize before monitor/workspace moves","Ignore this expected error in hotkey dispatchers instead of surfacing a toast"],"tags":["windows","window-manager","maximized-window","wm-command"],"backgroundTag":"invalid-state-transition","analyzedSha":"e0709f02bfae4e503bf4640f58ee75ecbbfdbb97","analyzedAt":"2026-09-06T07:08:05.107Z","contentChangedAt":"2026-09-06T07:08:05.107Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}