diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2024-08-31 10:22:57 +0300 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2024-09-01 23:47:19 -0700 |
| commit | 0f522f209b415444fd97ba5ecf30c13c179cede7 (patch) | |
| tree | 94ba8fbeb9b35cf3837bf77f4a6cebffb00f497e | |
| parent | 30b213601a4f71d65a2227fa68ffb1ab2a69f671 (diff) | |
| download | niri-0f522f209b415444fd97ba5ecf30c13c179cede7.tar.gz niri-0f522f209b415444fd97ba5ecf30c13c179cede7.tar.bz2 niri-0f522f209b415444fd97ba5ecf30c13c179cede7.zip | |
Change MappedIt::get() to return u64
| -rw-r--r-- | src/handlers/compositor.rs | 2 | ||||
| -rw-r--r-- | src/handlers/xdg_shell.rs | 2 | ||||
| -rw-r--r-- | src/ipc/server.rs | 8 | ||||
| -rw-r--r-- | src/niri.rs | 14 | ||||
| -rw-r--r-- | src/window/mapped.rs | 4 |
5 files changed, 14 insertions, 16 deletions
diff --git a/src/handlers/compositor.rs b/src/handlers/compositor.rs index ebc4a984..2244da19 100644 --- a/src/handlers/compositor.rs +++ b/src/handlers/compositor.rs @@ -216,7 +216,7 @@ impl CompositorHandler for State { #[cfg(feature = "xdp-gnome-screencast")] self.niri .stop_casts_for_target(crate::pw_utils::CastTarget::Window { - id: u64::from(id.get()), + id: id.get(), }); self.niri.layout.remove_window(&window, transaction.clone()); diff --git a/src/handlers/xdg_shell.rs b/src/handlers/xdg_shell.rs index b7d267dd..2486dd7a 100644 --- a/src/handlers/xdg_shell.rs +++ b/src/handlers/xdg_shell.rs @@ -480,7 +480,7 @@ impl XdgShellHandler for State { #[cfg(feature = "xdp-gnome-screencast")] self.niri .stop_casts_for_target(crate::pw_utils::CastTarget::Window { - id: u64::from(mapped.id().get()), + id: mapped.id().get(), }); self.backend.with_primary_renderer(|renderer| { diff --git a/src/ipc/server.rs b/src/ipc/server.rs index af2c4fa2..5475f5d7 100644 --- a/src/ipc/server.rs +++ b/src/ipc/server.rs @@ -375,7 +375,7 @@ fn make_ipc_window(mapped: &Mapped, workspace_id: Option<WorkspaceId>) -> niri_i .unwrap(); niri_ipc::Window { - id: u64::from(mapped.id().get()), + id: mapped.id().get(), title: role.title.clone(), app_id: role.app_id.clone(), workspace_id: workspace_id.map(|id| u64::from(id.0)), @@ -449,7 +449,7 @@ impl State { break; } - let active_window_id = ws.active_window().map(|win| u64::from(win.id().get())); + let active_window_id = ws.active_window().map(|win| win.id().get()); if ipc_ws.active_window_id != active_window_id { events.push(Event::WorkspaceActiveWindowChanged { workspace_id: id, @@ -490,7 +490,7 @@ impl State { output: mon.map(|mon| mon.output_name().clone()), is_active: mon.map_or(false, |mon| mon.active_workspace_idx == ws_idx), is_focused: Some(id) == focused_ws_id, - active_window_id: ws.active_window().map(|win| u64::from(win.id().get())), + active_window_id: ws.active_window().map(|win| win.id().get()), } }) .collect(); @@ -521,7 +521,7 @@ impl State { let mut seen = HashSet::new(); let mut focused_id = None; layout.with_windows(|mapped, _, ws_id| { - let id = u64::from(mapped.id().get()); + let id = mapped.id().get(); seen.insert(id); if mapped.is_focused() { diff --git a/src/niri.rs b/src/niri.rs index 1a0669f1..ab5049a8 100644 --- a/src/niri.rs +++ b/src/niri.rs @@ -1379,7 +1379,7 @@ impl State { StreamTargetId::Window { id } => { let mut window = None; self.niri.layout.with_windows(|mapped, _, _| { - if u64::from(mapped.id().get()) != id { + if mapped.id().get() != id { return; } @@ -1502,7 +1502,7 @@ impl State { .expect("no X11 support") .wl_surface(); - let id = u64::from(mapped.id().get()); + let id = mapped.id().get(); let props = with_states(wl_surface, |states| { let role = states .data_map @@ -2841,9 +2841,7 @@ impl Niri { let mut to_stop = vec![]; for (id, out) in output_changed { let refresh = out.current_mode().unwrap().refresh as u32; - let target = CastTarget::Window { - id: u64::from(id.get()), - }; + let target = CastTarget::Window { id: id.get() }; for cast in self.casts.iter_mut().filter(|cast| cast.target == target) { if let Err(err) = cast.set_refresh(refresh) { warn!("error changing cast FPS: {err:?}"); @@ -3712,7 +3710,7 @@ impl Niri { }; let mut windows = self.layout.windows_for_output(output); - let Some(mapped) = windows.find(|win| u64::from(win.id().get()) == id) else { + let Some(mapped) = windows.find(|win| win.id().get() == id) else { continue; }; @@ -3759,7 +3757,7 @@ impl Niri { let mut window = None; self.layout.with_windows(|mapped, _, _| { - if u64::from(mapped.id().get()) != window_id { + if mapped.id().get() != window_id { return; } @@ -3778,7 +3776,7 @@ impl Niri { let mut windows = self.layout.windows_for_output(output); let mapped = windows - .find(|mapped| u64::from(mapped.id().get()) == window_id) + .find(|mapped| mapped.id().get() == window_id) .unwrap(); let scale = Scale::from(output.current_scale().fractional_scale()); diff --git a/src/window/mapped.rs b/src/window/mapped.rs index 54c045b3..60cf7cd9 100644 --- a/src/window/mapped.rs +++ b/src/window/mapped.rs @@ -105,8 +105,8 @@ impl MappedId { MappedId(MAPPED_ID_COUNTER.next()) } - pub fn get(self) -> u32 { - self.0 + pub fn get(self) -> u64 { + u64::from(self.0) } } |
