sorry about monster commit
This commit is contained in:
@@ -59,7 +59,7 @@ pub enum WlxFrame {
|
||||
MemPtr(MemPtrFrame),
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, Default)]
|
||||
#[derive(Debug, Clone, Copy, Default, PartialEq)]
|
||||
pub enum Transform {
|
||||
#[default]
|
||||
Undefined,
|
||||
|
||||
@@ -19,17 +19,19 @@ use smithay_client_toolkit::reexports::{
|
||||
|
||||
pub use wayland_client;
|
||||
use wayland_client::{
|
||||
Connection, Dispatch, EventQueue, Proxy, QueueHandle,
|
||||
backend::WaylandError,
|
||||
globals::{GlobalList, GlobalListContents, registry_queue_init},
|
||||
globals::{registry_queue_init, GlobalList, GlobalListContents},
|
||||
protocol::{
|
||||
wl_output::{self, Transform, WlOutput},
|
||||
wl_registry::{self, WlRegistry},
|
||||
wl_seat::WlSeat,
|
||||
wl_shm::WlShm,
|
||||
},
|
||||
Connection, Dispatch, EventQueue, Proxy, QueueHandle,
|
||||
};
|
||||
|
||||
use crate::frame;
|
||||
|
||||
pub enum OutputChangeEvent {
|
||||
/// New output has been created.
|
||||
Create(u32),
|
||||
@@ -50,7 +52,7 @@ pub struct WlxOutput {
|
||||
pub size: (i32, i32),
|
||||
pub logical_pos: (i32, i32),
|
||||
pub logical_size: (i32, i32),
|
||||
pub transform: Transform,
|
||||
pub transform: frame::Transform,
|
||||
done: bool,
|
||||
}
|
||||
|
||||
@@ -125,7 +127,7 @@ impl WlxClient {
|
||||
size: (0, 0),
|
||||
logical_pos: (0, 0),
|
||||
logical_size: (0, 0),
|
||||
transform: Transform::Normal,
|
||||
transform: frame::Transform::Normal,
|
||||
done: false,
|
||||
};
|
||||
|
||||
@@ -192,17 +194,17 @@ impl WlxClient {
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn wl_transform_to_frame_transform(transform: Transform) -> crate::frame::Transform {
|
||||
fn wl_transform_to_frame_transform(transform: Transform) -> frame::Transform {
|
||||
match transform {
|
||||
Transform::Normal => crate::frame::Transform::Normal,
|
||||
Transform::_90 => crate::frame::Transform::Rotated90,
|
||||
Transform::_180 => crate::frame::Transform::Rotated180,
|
||||
Transform::_270 => crate::frame::Transform::Rotated270,
|
||||
Transform::Flipped => crate::frame::Transform::Flipped,
|
||||
Transform::Flipped90 => crate::frame::Transform::Flipped90,
|
||||
Transform::Flipped180 => crate::frame::Transform::Flipped180,
|
||||
Transform::Flipped270 => crate::frame::Transform::Flipped270,
|
||||
_ => crate::frame::Transform::Undefined,
|
||||
Transform::Normal => frame::Transform::Normal,
|
||||
Transform::_90 => frame::Transform::Rotated90,
|
||||
Transform::_180 => frame::Transform::Rotated180,
|
||||
Transform::_270 => frame::Transform::Rotated270,
|
||||
Transform::Flipped => frame::Transform::Flipped,
|
||||
Transform::Flipped90 => frame::Transform::Flipped90,
|
||||
Transform::Flipped180 => frame::Transform::Flipped180,
|
||||
Transform::Flipped270 => frame::Transform::Flipped270,
|
||||
_ => frame::Transform::Undefined,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -327,8 +329,8 @@ impl Dispatch<WlOutput, u32> for WlxClient {
|
||||
if let Some(output) = state.outputs.get_mut(*data) {
|
||||
let transform = transform.into_result().unwrap_or(Transform::Normal);
|
||||
let old_transform = output.transform;
|
||||
output.transform = transform;
|
||||
if output.done && old_transform != transform {
|
||||
output.transform = wl_transform_to_frame_transform(transform);
|
||||
if output.done && old_transform != output.transform {
|
||||
log::info!(
|
||||
"{}: Transform changed {:?} -> {:?}",
|
||||
output.name,
|
||||
|
||||
@@ -11,7 +11,7 @@ use wayland_client::{Connection, QueueHandle, Dispatch, Proxy};
|
||||
|
||||
use crate::{
|
||||
frame::{DmabufFrame, DrmFormat, FramePlane, WlxFrame},
|
||||
wayland::{wl_transform_to_frame_transform, WlxClient},
|
||||
wayland::WlxClient,
|
||||
WlxCapture,
|
||||
};
|
||||
|
||||
@@ -146,7 +146,7 @@ fn request_dmabuf_frame(
|
||||
return client;
|
||||
};
|
||||
|
||||
let transform = wl_transform_to_frame_transform(output.transform);
|
||||
let transform = output.transform;
|
||||
|
||||
let (tx, rx) = mpsc::sync_channel::<zwlr_export_dmabuf_frame_v1::Event>(16);
|
||||
let name = output.name.clone();
|
||||
|
||||
@@ -21,7 +21,7 @@ use crate::{
|
||||
DrmFormat, FourCC, FrameFormat, FramePlane, MemFdFrame, WlxFrame, DRM_FORMAT_ARGB8888,
|
||||
DRM_FORMAT_XRGB8888,
|
||||
},
|
||||
wayland::{wl_transform_to_frame_transform, WlxClient},
|
||||
wayland::WlxClient,
|
||||
WlxCapture,
|
||||
};
|
||||
|
||||
@@ -194,7 +194,7 @@ where
|
||||
return client;
|
||||
};
|
||||
|
||||
let transform = wl_transform_to_frame_transform(output.transform);
|
||||
let transform = output.transform;
|
||||
|
||||
let (tx, rx) = mpsc::sync_channel::<ScreenCopyEvent>(16);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user