{"record":{"id":"e63998acd8921af4","repo":"LGUG2Z/komorebi","slug":"ignoring-commands-while-active-window-is-not-manag","errorCode":null,"errorMessage":"ignoring commands while active window is not managed by komorebi","messagePattern":"ignoring commands while active window is not managed by komorebi","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"komorebi/src/window_manager.rs","lineNumber":1478,"sourceCode":"                        window.remove_accent()?;\n                    }\n                }\n            }\n        }\n\n        Ok(())\n    }\n\n    #[tracing::instrument(skip(self))]\n    fn handle_unmanaged_window_behaviour(&self) -> eyre::Result<()> {\n        if matches!(\n            self.unmanaged_window_operation_behaviour,\n            OperationBehaviour::NoOp\n        ) {\n            let workspace = self.focused_workspace()?;\n            let focused_hwnd = WindowsApi::foreground_window()?;\n            if !workspace.contains_managed_window(focused_hwnd) {\n                bail!(\"ignoring commands while active window is not managed by komorebi\");\n            }\n        }\n\n        Ok(())\n    }\n\n    /// Check for an existing wallpaper definition on the workspace/monitor index pair and apply it\n    /// if it exists\n    #[tracing::instrument(skip(self))]\n    pub fn apply_wallpaper_for_monitor_workspace(\n        &mut self,\n        monitor_idx: usize,\n        workspace_idx: usize,\n    ) -> eyre::Result<()> {\n        let monitor = self\n            .monitors_mut()\n            .get_mut(monitor_idx)\n            .ok_or_eyre(\"there is no monitor\")?;","sourceCodeStart":1460,"sourceCodeEnd":1496,"githubUrl":"https://github.com/LGUG2Z/komorebi/blob/e0709f02bfae4e503bf4640f58ee75ecbbfdbb97/komorebi/src/window_manager.rs#L1460-L1496","documentation":"handle_unmanaged_window_behaviour checks, when the unmanaged window operation behaviour is not NoOp, that the currently focused (foreground) window is actually managed by komorebi before executing directional/cycle focus and move commands. If the foreground window is unmanaged (e.g. a floating-over app or a non-managed popup), it bails to prevent commands targeting a window komorebi does not control.","triggerScenarios":"Invoking move_container_to_monitor, move_container_to_workspace, focus_container_in_direction/cycle_direction, or move_container_in_direction/cycle_direction (via keybinds) while the foreground window is not in the focused workspace's managed set — e.g. focus is on a topmost/unmanaged app, a UWP flyout, or the desktop.","commonSituations":"Pressing focus/move keybinds while an always-on-top tool, screenshot overlay, or taskbar has focus; focus left on a floating window excluded from management; clicking the desktop then using keybinds.","solutions":["Click into a managed window (or use alt-tab to one) before issuing focus/move keybinds.","Check unmanaged_window_operation_behaviour config — adjust it if you want commands to operate anyway.","Identify the unmanaged window with komorebic query / wininfo and add/manage it appropriately (manage command or rules) if it should be managed.","Close or dismiss overlay windows stealing foreground focus."],"exampleFix":"// before\n# keybind fired while an unmanaged overlay had focus -> error\n// after\n\"unmanaged_window_operation_behaviour\": \"Op\"  // in komorebi.json, to allow operating anyway","handlingStrategy":"validation","validationCode":"// Check the foreground window is managed before issuing commands\nkomorebic focused-window   # errors/empty if the focused window is unmanaged","typeGuard":"fn command_targets_managed_window(ws: &Workspace, hwnd: isize) -> bool {\n    ws.contains_managed_window(hwnd)\n}","tryCatchPattern":"if let Err(e) = wm.handle_unmanaged_window_behaviour() {\n    tracing::debug!(\"command ignored: {e}\"); // focus is on an unmanaged window; skip instead of failing\n}","preventionTips":["Focus a managed window before using directional/move keybinds","Configure unmanaged_window_operation_behaviour deliberately in komorebi.json","Manage or dismiss overlay/topmost apps that steal foreground focus","Use komorebic manage or window rules for apps you want controlled"],"tags":["window-management","focus","unmanaged-window"],"backgroundTag":"invalid-argument-value","analyzedSha":"e0709f02bfae4e503bf4640f58ee75ecbbfdbb97","analyzedAt":"2026-09-06T07:08:05.107Z","contentChangedAt":"2026-09-06T07:08:05.107Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}