Speed up per-frame layout, hit testing, and stacking paths
Split ScrollingLayout validation so the per-frame geometry solve only checks scalars and keeps the full tree validation behind debug_assert, removing a HashSet build from every frame. Replace the per-region Vec in decode_regions with a stack array via as_chunks, and skip the window hit test in PointerMotion when Overview is not presenting, where visual_scale_for_window returns 1.0 regardless. Guard sync_window_stacking behind a check that the space already matches the target order with uniform z_index, avoiding an O(n^2) raise_element loop on every redraw. Narrow window_under_visual to the space iterator outside Overview, keeping the collected and sorted candidate list for the Overview branch where front-to-back order is load-bearing. Raise rust-version to 1.98 and clear the resulting Clippy findings across the workspace: let-chain collapses, clamp, and while-let loops.
This commit is contained in:
1 parent
391f6b4e37
commit
67192c0c04
25 files changed
+886
-700
No files matched your search
@@ -82,13 +82,14 @@ impl Appearance {
|
||||
} else {
|
||||
ThemeBuilder::dark()
|
||||
};
|
||||
|
||||
let mut corners = cosmic::cosmic_theme::CornerRadii::default();
|
||||
corners.radius_xs = [self.radius.min(4.); 4];
|
||||
corners.radius_s = [self.radius.min(8.); 4];
|
||||
corners.radius_m = [self.radius; 4];
|
||||
corners.radius_l = [self.radius; 4];
|
||||
corners.radius_xl = [self.radius; 4];
|
||||
let corners = cosmic::cosmic_theme::CornerRadii {
|
||||
radius_xs: [self.radius.min(4.); 4],
|
||||
radius_s: [self.radius.min(8.); 4],
|
||||
radius_m: [self.radius; 4],
|
||||
radius_l: [self.radius; 4],
|
||||
radius_xl: [self.radius; 4],
|
||||
radius_0: Default::default(),
|
||||
};
|
||||
|
||||
let mut native = builder
|
||||
.corner_radii(corners)
|
||||
|
||||
@@ -53,6 +53,7 @@ impl Api {
|
||||
let cancel = *agent
|
||||
.get(b"polkit_agent_session_cancel\0")
|
||||
.map_err(|e| e.to_string())?;
|
||||
|
||||
Ok(Self {
|
||||
_agent: agent,
|
||||
_polkit: polkit,
|
||||
@@ -199,7 +200,10 @@ fn run_session(
|
||||
connect(
|
||||
session,
|
||||
c"request",
|
||||
Some(std::mem::transmute(
|
||||
Some(std::mem::transmute::<
|
||||
unsafe extern "C" fn(Object, *const c_char, c_int, *mut c_void),
|
||||
unsafe extern "C" fn(),
|
||||
>(
|
||||
request as unsafe extern "C" fn(Object, *const c_char, c_int, *mut c_void),
|
||||
)),
|
||||
signal_data,
|
||||
@@ -207,7 +211,10 @@ fn run_session(
|
||||
connect(
|
||||
session,
|
||||
c"show-info",
|
||||
Some(std::mem::transmute(
|
||||
Some(std::mem::transmute::<
|
||||
unsafe extern "C" fn(Object, *const c_char, *mut c_void),
|
||||
unsafe extern "C" fn(),
|
||||
>(
|
||||
info as unsafe extern "C" fn(Object, *const c_char, *mut c_void),
|
||||
)),
|
||||
signal_data,
|
||||
@@ -215,7 +222,10 @@ fn run_session(
|
||||
connect(
|
||||
session,
|
||||
c"show-error",
|
||||
Some(std::mem::transmute(
|
||||
Some(std::mem::transmute::<
|
||||
unsafe extern "C" fn(Object, *const c_char, *mut c_void),
|
||||
unsafe extern "C" fn(),
|
||||
>(
|
||||
error as unsafe extern "C" fn(Object, *const c_char, *mut c_void),
|
||||
)),
|
||||
signal_data,
|
||||
@@ -223,11 +233,15 @@ fn run_session(
|
||||
connect(
|
||||
session,
|
||||
c"completed",
|
||||
Some(std::mem::transmute(
|
||||
Some(std::mem::transmute::<
|
||||
unsafe extern "C" fn(Object, c_int, *mut c_void),
|
||||
unsafe extern "C" fn(),
|
||||
>(
|
||||
completed as unsafe extern "C" fn(Object, c_int, *mut c_void),
|
||||
)),
|
||||
signal_data,
|
||||
);
|
||||
|
||||
(api.initiate)(session);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user