{"record":{"id":"80d25d846d7b3fce","repo":"zed-industries/zed","slug":"window-is-focused-by-pointer","errorCode":null,"errorMessage":"window is focused by pointer","messagePattern":"window is focused by pointer","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/gpui_linux/src/linux/wayland/client.rs","lineNumber":1082,"sourceCode":"                    let serial = state\n                        .serial_tracker\n                        .get(SerialKind::MousePress)\n                        .as_raw()\n                        .max(state.serial_tracker.get(SerialKind::KeyPress).as_raw());\n                    (serial != 0).then(|| (serial, state.wl_seat.clone()))\n                });\n                (Some(parent), popup_grab.flatten())\n            }\n            _ => (state.keyboard_focused_window.clone(), None),\n        };\n\n        let target_output = params.display_id.and_then(|display_id| {\n            let target_protocol_id: u64 = display_id.into();\n            state\n                .wl_outputs\n                .iter()\n                .find(|(id, _)| id.protocol_id() as u64 == target_protocol_id)\n                .map(|(_, output)| output.clone())\n        });\n\n        let appearance = state.common.appearance;\n        let compositor_gpu = state.compositor_gpu.take();\n\n        let (window, surface_id) = WaylandWindow::new(\n            handle,\n            state.globals.clone(),\n            state.gpu_context.clone(),\n            compositor_gpu,\n            WaylandClientStatePtr(Rc::downgrade(&self.0)),\n            params,\n            appearance,\n            parent,\n            popup_grab,\n            target_output,\n        )?;\n","sourceCodeStart":1064,"sourceCodeEnd":1100,"githubUrl":"https://github.com/zed-industries/zed/blob/9d272b036335401f339d024ea94968fd51016c40/crates/gpui_linux/src/linux/wayland/client.rs#L1064-L1100","documentation":"When applying a cursor style on Wayland, the code expects a focused window under the pointer when the cursor-shape protocol is unavailable and the legacy cursor path runs; the expect fires if mouse_focused_window is None at that point, meaning cursor updates were requested without a pointer-entered window — a serial/state tracking bug.","triggerScenarios":"Thrown at crates/gpui_linux/src/linux/wayland/client.rs:1076 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify SerialKind::MouseEnter is tracked and cleared correctly on pointer leave","Guard cursor style application on the existence of a pointer-focused window","Check that set_cursor requests only come from pointer-entered surfaces"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9d272b036335401f339d024ea94968fd51016c40","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}