Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ authors = ["Victoria Brekenfeld"]
edition = "2024"
license = "GPL-3.0-only"
name = "cosmic-comp"
version = "0.1.0"
rust-version = "1.85"
version = "1.0.0"
rust-version = "1.90"

[workspace]
members = ["cosmic-comp-config"]
Expand Down
2 changes: 1 addition & 1 deletion cosmic-comp-config/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cosmic-comp-config"
version = "0.1.0"
version = "1.0.0"
edition = "2024"

[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "1.85"
channel = "1.90"
components = [ "rust-src" ]
23 changes: 11 additions & 12 deletions src/input/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use crate::{
},
zoom::ZoomState,
},
utils::{float::NextDown, prelude::*, quirks::workspace_overview_is_open},
utils::{prelude::*, quirks::workspace_overview_is_open},
wayland::{
handlers::{screencopy::SessionHolder, xwayland_keyboard_grab::XWaylandGrabSeat},
protocols::screencopy::{BufferConstraints, CursorSessionRef},
Expand Down Expand Up @@ -356,6 +356,16 @@ impl State {
.cloned()
.unwrap_or(current_output.clone());

let output_geometry = output.geometry();
position.x = position.x.clamp(
output_geometry.loc.x as f64,
(output_geometry.loc.x + output_geometry.size.w - 1) as f64,
);
position.y = position.y.clamp(
output_geometry.loc.y as f64,
(output_geometry.loc.y + output_geometry.size.h - 1) as f64,
);

let new_under = State::surface_under(position, &output, &shell)
.map(|(target, pos)| (target, pos.as_logical()));

Expand Down Expand Up @@ -482,17 +492,6 @@ impl State {
}
}

let output_geometry = output.geometry();

position.x = position.x.clamp(
output_geometry.loc.x as f64,
((output_geometry.loc.x + output_geometry.size.w) as f64).next_lower(), // FIXME: Replace with f64::next_down when stable
);
position.y = position.y.clamp(
output_geometry.loc.y as f64,
((output_geometry.loc.y + output_geometry.size.h) as f64).next_lower(), // FIXME: Replace with f64::next_down when stable
);

// If confined, don't move pointer if it would go outside surface or region
if pointer_confined {
if let Some((surface, surface_loc)) = &under {
Expand Down
9 changes: 4 additions & 5 deletions src/shell/zoom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ use tracing::error;
use crate::{
state::State,
utils::{
float::NextDown,
iced::{IcedElement, Program},
prelude::*,
tween::EasePoint,
Expand Down Expand Up @@ -93,11 +92,11 @@ impl OutputZoomState {
.to_global(output);
focal_point.x = focal_point.x.clamp(
output_geometry.loc.x,
(output_geometry.loc.x + output_geometry.size.w).next_lower(), // FIXME: Replace with f64::next_down when stable
(output_geometry.loc.x + output_geometry.size.w).next_down(),
);
focal_point.y = focal_point.y.clamp(
output_geometry.loc.y,
(output_geometry.loc.y + output_geometry.size.h).next_lower(), // FIXME: Replace with f64::next_down when stable
(output_geometry.loc.y + output_geometry.size.h).next_down(),
);
focal_point.to_local(output)
}
Expand Down Expand Up @@ -309,11 +308,11 @@ impl ZoomState {
.upscale(output_state_ref.level);
diff.x = diff.x.clamp(
output_geometry.loc.x as f64,
((output_geometry.loc.x + output_geometry.size.w) as f64).next_lower(), // FIXME: Replace with f64::next_down when stable
((output_geometry.loc.x + output_geometry.size.w) as f64).next_down(),
);
diff.y = diff.y.clamp(
output_geometry.loc.y as f64,
((output_geometry.loc.y + output_geometry.size.h) as f64).next_lower(), // FIXME: Replace with f64::next_down when stable
((output_geometry.loc.y + output_geometry.size.h) as f64).next_down(),
);
diff -= output_state_ref.focal_point.to_global(output);

Expand Down
28 changes: 0 additions & 28 deletions src/utils/float.rs

This file was deleted.

1 change: 0 additions & 1 deletion src/utils/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
pub mod env;
mod ids;
pub(crate) use self::ids::id_gen;
pub mod float;
pub mod geometry;
pub mod iced;
pub mod prelude;
Expand Down