mirror of
https://github.com/YaLTeR/niri.git
synced 2024-09-11 20:37:25 +03:00
Compare commits
4 Commits
9dbcf9a448
...
e78a916753
Author | SHA1 | Date | |
---|---|---|---|
|
e78a916753 | ||
|
dbd066f91c | ||
|
60143a8236 | ||
|
77dafb819f |
4
Cargo.lock
generated
4
Cargo.lock
generated
@ -3355,7 +3355,7 @@ checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67"
|
||||
[[package]]
|
||||
name = "smithay"
|
||||
version = "0.3.0"
|
||||
source = "git+https://github.com/Smithay/smithay.git?rev=f04e7c22f91b56177cb2c6a2b1e4e71056ce0c2f#f04e7c22f91b56177cb2c6a2b1e4e71056ce0c2f"
|
||||
source = "git+https://github.com/Smithay/smithay.git?branch=fix/multiple_cursor_planes#9d36da3e692f9090c2ddbcf5a94b93bb185f32e1"
|
||||
dependencies = [
|
||||
"appendlist",
|
||||
"bitflags 2.5.0",
|
||||
@ -3429,7 +3429,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "smithay-drm-extras"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/Smithay/smithay.git?rev=f04e7c22f91b56177cb2c6a2b1e4e71056ce0c2f#f04e7c22f91b56177cb2c6a2b1e4e71056ce0c2f"
|
||||
source = "git+https://github.com/Smithay/smithay.git#f208cd758416e4495e9eb8b27a96c523e92817a6"
|
||||
dependencies = [
|
||||
"drm",
|
||||
"edid-rs",
|
||||
|
@ -21,13 +21,12 @@ tracy-client = { version = "0.17.0", default-features = false }
|
||||
|
||||
[workspace.dependencies.smithay]
|
||||
git = "https://github.com/Smithay/smithay.git"
|
||||
rev = "f04e7c22f91b56177cb2c6a2b1e4e71056ce0c2f"
|
||||
branch = "fix/multiple_cursor_planes"
|
||||
# path = "../smithay"
|
||||
default-features = false
|
||||
|
||||
[workspace.dependencies.smithay-drm-extras]
|
||||
git = "https://github.com/Smithay/smithay.git"
|
||||
rev = "f04e7c22f91b56177cb2c6a2b1e4e71056ce0c2f"
|
||||
# path = "../smithay/smithay-drm-extras"
|
||||
|
||||
[package]
|
||||
|
@ -15,7 +15,7 @@ mod imp {
|
||||
use niri::utils::get_monotonic_time;
|
||||
use smithay::backend::egl::ffi::egl;
|
||||
use smithay::backend::egl::EGLContext;
|
||||
use smithay::backend::renderer::gles::{Capability, GlesRenderer};
|
||||
use smithay::backend::renderer::gles::GlesRenderer;
|
||||
use smithay::backend::renderer::{Frame, Renderer, Unbind};
|
||||
use smithay::utils::{Physical, Rectangle, Scale, Transform};
|
||||
|
||||
@ -186,13 +186,8 @@ mod imp {
|
||||
|
||||
let egl_context = EGLContext::from_raw(egl_display, egl_config_id as *const _, egl_context)
|
||||
.context("error creating EGL context")?;
|
||||
let capabilities = GlesRenderer::supported_capabilities(&egl_context)
|
||||
.context("error getting supported renderer capabilities")?
|
||||
.into_iter()
|
||||
.filter(|c| *c != Capability::ColorTransformations);
|
||||
|
||||
let mut renderer = GlesRenderer::with_capabilities(egl_context, capabilities)
|
||||
.context("error creating GlesRenderer")?;
|
||||
let mut renderer = GlesRenderer::new(egl_context).context("error creating GlesRenderer")?;
|
||||
|
||||
resources::init(&mut renderer);
|
||||
shaders::init(&mut renderer);
|
||||
|
@ -48,8 +48,9 @@ impl CompositorHandler for State {
|
||||
fn new_surface(&mut self, surface: &WlSurface) {
|
||||
add_pre_commit_hook::<Self, _>(surface, move |state, _dh, surface| {
|
||||
let maybe_dmabuf = with_states(surface, |surface_data| {
|
||||
let mut guard = surface_data.cached_state.get::<SurfaceAttributes>();
|
||||
guard
|
||||
surface_data
|
||||
.cached_state
|
||||
.get::<SurfaceAttributes>()
|
||||
.pending()
|
||||
.buffer
|
||||
.as_ref()
|
||||
|
@ -1143,13 +1143,13 @@ impl State {
|
||||
let geom = self.niri.global_space.output_geometry(output).unwrap();
|
||||
let mut point = (new_pos - geom.loc.to_f64())
|
||||
.to_physical(output.current_scale().fractional_scale())
|
||||
.to_i32_round();
|
||||
.to_i32_round::<i32>();
|
||||
|
||||
let size = output.current_mode().unwrap().size;
|
||||
let transform = output.current_transform();
|
||||
let size = transform.transform_size(size);
|
||||
point.x = min(size.w - 1, point.x);
|
||||
point.y = min(size.h - 1, point.y);
|
||||
point.x = point.x.clamp(0, size.w - 1);
|
||||
point.y = point.y.clamp(0, size.h - 1);
|
||||
|
||||
self.niri.screenshot_ui.pointer_motion(point);
|
||||
}
|
||||
@ -1242,13 +1242,13 @@ impl State {
|
||||
let geom = self.niri.global_space.output_geometry(output).unwrap();
|
||||
let mut point = (pos - geom.loc.to_f64())
|
||||
.to_physical(output.current_scale().fractional_scale())
|
||||
.to_i32_round();
|
||||
.to_i32_round::<i32>();
|
||||
|
||||
let size = output.current_mode().unwrap().size;
|
||||
let transform = output.current_transform();
|
||||
let size = transform.transform_size(size);
|
||||
point.x = min(size.w - 1, point.x);
|
||||
point.y = min(size.h - 1, point.y);
|
||||
point.x = point.x.clamp(0, size.w - 1);
|
||||
point.y = point.y.clamp(0, size.h - 1);
|
||||
|
||||
self.niri.screenshot_ui.pointer_motion(point);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user