Make cursor_geometry() return a CursorGeometry struct
A bit better than just a tuple.
This commit is contained in:
parent
dd6ebd03c9
commit
27956e6e00
5 changed files with 33 additions and 21 deletions
|
|
@ -31,7 +31,7 @@ use smithay::{
|
|||
};
|
||||
|
||||
use crate::{
|
||||
shell::{CosmicSurface, Shell},
|
||||
shell::{CosmicSurface, CursorGeometry, Shell},
|
||||
state::{BackendData, State},
|
||||
utils::prelude::{
|
||||
OutputExt, PointExt, PointGlobalExt, PointLocalExt, RectExt, RectLocalExt, SeatExt,
|
||||
|
|
@ -86,7 +86,7 @@ impl ImageCopyCaptureHandler for State {
|
|||
) -> Option<BufferConstraints> {
|
||||
let shell = self.common.shell.read();
|
||||
let seat = seat_for_wl_pointer(&shell, pointer)?;
|
||||
let size = if let Some((geometry, _)) =
|
||||
let size = if let Some(CursorGeometry { geometry, .. }) =
|
||||
seat.cursor_geometry((0.0, 0.0), self.common.clock.now())
|
||||
{
|
||||
geometry.size
|
||||
|
|
@ -160,7 +160,7 @@ impl ImageCopyCaptureHandler for State {
|
|||
let pointer = seat.get_pointer().unwrap();
|
||||
let pointer_loc = pointer.current_location().to_i32_round().as_global();
|
||||
|
||||
let (pointer_size, hotspot) = if let Some((geometry, hotspot)) =
|
||||
let (pointer_size, hotspot) = if let Some(CursorGeometry { geometry, hotspot }) =
|
||||
seat.cursor_geometry((0.0, 0.0), self.common.clock.now())
|
||||
{
|
||||
(geometry.size, hotspot)
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ use crate::{
|
|||
render_workspace,
|
||||
wayland::SurfaceRenderElement,
|
||||
},
|
||||
shell::{CosmicMappedRenderElement, CosmicSurface, WorkspaceRenderElement},
|
||||
shell::{CosmicMappedRenderElement, CosmicSurface, CursorGeometry, WorkspaceRenderElement},
|
||||
state::{Common, KmsNodes, State},
|
||||
utils::prelude::{PointExt, PointGlobalExt, RectExt, RectLocalExt, SeatExt},
|
||||
wayland::{
|
||||
|
|
@ -804,7 +804,7 @@ pub fn render_cursor_to_buffer(
|
|||
let buffer = frame.buffer();
|
||||
let mut cursor_size = seat
|
||||
.cursor_geometry((0.0, 0.0), state.common.clock.now())
|
||||
.map(|(geo, _hotspot)| geo.size)
|
||||
.map(|CursorGeometry { geometry, .. }| geometry.size)
|
||||
.unwrap_or_else(|| Size::from((64, 64)));
|
||||
let buffer_size = buffer_dimensions(&buffer).unwrap();
|
||||
// Client shouldn't try to allocate 0x0 buffer
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue