From a975e3b25abf984201ddf9dfdeb0afabfdf50a5c Mon Sep 17 00:00:00 2001 From: khyperia <953151+khyperia@users.noreply.github.com> Date: Tue, 23 Dec 2025 14:57:02 +0100 Subject: [PATCH] seat: rename get_output to get_cursor_output --- jay-config/src/_private/client.rs | 6 +++--- jay-config/src/_private/ipc.rs | 4 ++-- jay-config/src/input.rs | 2 +- src/config/handler.rs | 17 +++++++++-------- src/ifs/wl_seat.rs | 2 +- src/ifs/wl_seat/event_handling.rs | 2 +- src/ifs/wl_surface/xdg_surface/xdg_toplevel.rs | 2 +- src/ifs/xdg_toplevel_drag_v1.rs | 2 +- src/ifs/zwlr_layer_shell_v1.rs | 2 +- src/state.rs | 6 +++--- 10 files changed, 23 insertions(+), 22 deletions(-) diff --git a/jay-config/src/_private/client.rs b/jay-config/src/_private/client.rs index 31172667..a604cf02 100644 --- a/jay-config/src/_private/client.rs +++ b/jay-config/src/_private/client.rs @@ -551,9 +551,9 @@ impl ConfigClient { connector } - pub fn get_seat_workspace(&self, seat: Seat) -> Workspace { - let res = self.send_with_response(&ClientMessage::GetSeatWorkspace { seat }); - get_response!(res, Workspace(0), GetSeatWorkspace { workspace }); + pub fn get_seat_cursor_workspace(&self, seat: Seat) -> Workspace { + let res = self.send_with_response(&ClientMessage::GetSeatCursorWorkspace { seat }); + get_response!(res, Workspace(0), GetSeatCursorWorkspace { workspace }); workspace } diff --git a/jay-config/src/_private/ipc.rs b/jay-config/src/_private/ipc.rs index 1b89c8b9..842ff141 100644 --- a/jay-config/src/_private/ipc.rs +++ b/jay-config/src/_private/ipc.rs @@ -372,7 +372,7 @@ pub enum ClientMessage<'a> { MakeRenderDevice { device: DrmDevice, }, - GetSeatWorkspace { + GetSeatCursorWorkspace { seat: Seat, }, SetDefaultWorkspaceCapture { @@ -925,7 +925,7 @@ pub enum Response { width: i32, height: i32, }, - GetSeatWorkspace { + GetSeatCursorWorkspace { workspace: Workspace, }, GetDefaultWorkspaceCapture { diff --git a/jay-config/src/input.rs b/jay-config/src/input.rs index 4672663c..ab5de258 100644 --- a/jay-config/src/input.rs +++ b/jay-config/src/input.rs @@ -420,7 +420,7 @@ impl Seat { /// /// If no such workspace exists, `exists` returns `false` for the returned workspace. pub fn get_workspace(self) -> Workspace { - get!(Workspace(0)).get_seat_workspace(self) + get!(Workspace(0)).get_seat_cursor_workspace(self) } /// Returns the workspace that is currently active on the output that contains the seat's diff --git a/src/config/handler.rs b/src/config/handler.rs index cc5f1eb5..877e3f38 100644 --- a/src/config/handler.rs +++ b/src/config/handler.rs @@ -1012,16 +1012,16 @@ impl ConfigProxyHandler { self.state.double_click_distance.set(dist); } - fn handle_get_seat_workspace(&self, seat: Seat) -> Result<(), CphError> { + fn handle_get_seat_cursor_workspace(&self, seat: Seat) -> Result<(), CphError> { let seat = self.get_seat(seat)?; - let output = seat.get_output(); + let output = seat.get_cursor_output(); let mut workspace = Workspace(0); if !output.is_dummy && let Some(ws) = output.workspace.get() { workspace = self.get_workspace_by_name(&ws.name); } - self.respond(Response::GetSeatWorkspace { workspace }); + self.respond(Response::GetSeatCursorWorkspace { workspace }); Ok(()) } @@ -1056,7 +1056,7 @@ impl ConfigProxyHandler { let name = self.get_workspace(ws)?; let workspace = match self.state.workspaces.get(name.deref()) { Some(ws) => ws, - _ => seat.get_output().create_workspace(name.deref()), + _ => seat.get_cursor_output().create_workspace(name.deref()), }; seat.set_workspace(&workspace); Ok(()) @@ -1112,7 +1112,8 @@ impl ConfigProxyHandler { Some(ws) => ws, _ => return Ok(()), }, - WorkspaceSource::Seat(s) => match self.get_seat(s)?.get_output().workspace.get() { + WorkspaceSource::Seat(s) => match self.get_seat(s)?.get_cursor_output().workspace.get() + { Some(ws) => ws, _ => return Ok(()), }, @@ -2935,9 +2936,9 @@ impl ConfigProxyHandler { ClientMessage::MakeRenderDevice { device } => self .handle_make_render_device(device) .wrn("make_render_device")?, - ClientMessage::GetSeatWorkspace { seat } => self - .handle_get_seat_workspace(seat) - .wrn("get_seat_workspace")?, + ClientMessage::GetSeatCursorWorkspace { seat } => self + .handle_get_seat_cursor_workspace(seat) + .wrn("get_seat_cursor_workspace")?, ClientMessage::GetSeatKeyboardWorkspace { seat } => self .handle_get_seat_keyboard_workspace(seat) .wrn("get_seat_keyboard_workspace")?, diff --git a/src/ifs/wl_seat.rs b/src/ifs/wl_seat.rs index b746e3dc..866754d9 100644 --- a/src/ifs/wl_seat.rs +++ b/src/ifs/wl_seat.rs @@ -457,7 +457,7 @@ impl WlSeatGlobal { self.data_control_devices.remove(&device.id()); } - pub fn get_output(&self) -> Rc { + pub fn get_cursor_output(&self) -> Rc { self.cursor_user_group.latest_output() } diff --git a/src/ifs/wl_seat/event_handling.rs b/src/ifs/wl_seat/event_handling.rs index ddec3ad8..fd0aee29 100644 --- a/src/ifs/wl_seat/event_handling.rs +++ b/src/ifs/wl_seat/event_handling.rs @@ -217,7 +217,7 @@ impl NodeSeatState { .set_kb_node(&seat, seat.state.root.clone(), seat.state.next_serial(None)); // log::info!("keyboard_node = root"); if focus_last { - seat.get_output() + seat.get_cursor_output() .node_do_focus(&seat, Direction::Unspecified); } } diff --git a/src/ifs/wl_surface/xdg_surface/xdg_toplevel.rs b/src/ifs/wl_surface/xdg_surface/xdg_toplevel.rs index 8a2808e7..8a74a8c2 100644 --- a/src/ifs/wl_surface/xdg_surface/xdg_toplevel.rs +++ b/src/ifs/wl_surface/xdg_surface/xdg_toplevel.rs @@ -486,7 +486,7 @@ impl XdgToplevel { if should_be_mapped { if !self.is_mapped.replace(true) { if let Some(seat) = drag.source.data.seat.get() { - self.xdg.set_output(&seat.get_output()); + self.xdg.set_output(&seat.get_cursor_output()); } self.toplevel_data.broadcast(self.clone()); self.tl_set_visible(self.state.root_visible()); diff --git a/src/ifs/xdg_toplevel_drag_v1.rs b/src/ifs/xdg_toplevel_drag_v1.rs index 61d4590c..3234be47 100644 --- a/src/ifs/xdg_toplevel_drag_v1.rs +++ b/src/ifs/xdg_toplevel_drag_v1.rs @@ -136,7 +136,7 @@ impl XdgToplevelDragV1 { if self.source.data.was_used() && let Some(tl) = self.toplevel.get() { - let output = seat.get_output(); + let output = seat.get_cursor_output(); let (x, y) = seat.pointer_cursor().position(); tl.drag.take(); tl.after_toplevel_drag( diff --git a/src/ifs/zwlr_layer_shell_v1.rs b/src/ifs/zwlr_layer_shell_v1.rs index 53e63178..0c9f3fa7 100644 --- a/src/ifs/zwlr_layer_shell_v1.rs +++ b/src/ifs/zwlr_layer_shell_v1.rs @@ -60,7 +60,7 @@ impl ZwlrLayerShellV1RequestHandler for ZwlrLayerShellV1 { self.client.lookup(req.output)?.global.clone() } else { for seat in self.client.state.seat_queue.rev_iter() { - let output = seat.get_output(); + let output = seat.get_cursor_output(); if !output.is_dummy { break 'get_output output.global.opt.clone(); } diff --git a/src/state.rs b/src/state.rs index 94f5f8d7..cd3e0058 100644 --- a/src/state.rs +++ b/src/state.rs @@ -780,7 +780,7 @@ impl State { pub fn ensure_map_workspace(&self, seat: Option<&Rc>) -> Rc { seat.cloned() .or_else(|| self.seat_queue.last().map(|s| s.deref().clone())) - .map(|s| s.get_output()) + .map(|s| s.get_cursor_output()) .or_else(|| self.root.outputs.lock().values().next().cloned()) .or_else(|| self.dummy_output.get()) .unwrap() @@ -916,7 +916,7 @@ impl State { let ws = match self.workspaces.get(name) { Some(ws) => ws, _ => { - let output = output.unwrap_or_else(|| seat.get_output()); + let output = output.unwrap_or_else(|| seat.get_cursor_output()); if output.is_dummy { log::warn!("Not showing workspace because seat is on dummy output"); return; @@ -929,7 +929,7 @@ impl State { pub fn float_map_ws(&self) -> Rc { if let Some(seat) = self.seat_queue.last() { - let output = seat.get_output(); + let output = seat.get_cursor_output(); if !output.is_dummy { return output.ensure_workspace(); }