67 lines
1.5 KiB
Rust
67 lines
1.5 KiB
Rust
// SPDX-License-Identifier: MPL-2.0-only
|
|
use cctk::sctk::{
|
|
compositor::CompositorHandler,
|
|
delegate_compositor,
|
|
reexports::client::{
|
|
Connection, QueueHandle,
|
|
protocol::{wl_output, wl_surface},
|
|
},
|
|
};
|
|
|
|
use crate::{
|
|
event_loop::state::receive_frame,
|
|
platform_specific::wayland::event_loop::state::SctkState,
|
|
};
|
|
|
|
impl CompositorHandler for SctkState {
|
|
fn scale_factor_changed(
|
|
&mut self,
|
|
_conn: &Connection,
|
|
_qh: &QueueHandle<Self>,
|
|
surface: &wl_surface::WlSurface,
|
|
new_factor: i32,
|
|
) {
|
|
self.scale_factor_changed(surface, new_factor as f64, true);
|
|
}
|
|
|
|
fn frame(
|
|
&mut self,
|
|
_conn: &Connection,
|
|
_qh: &QueueHandle<Self>,
|
|
surface: &wl_surface::WlSurface,
|
|
_time: u32,
|
|
) {
|
|
_ = receive_frame(&mut self.frame_status, surface);
|
|
}
|
|
|
|
fn transform_changed(
|
|
&mut self,
|
|
_conn: &Connection,
|
|
_qh: &QueueHandle<Self>,
|
|
_surface: &wl_surface::WlSurface,
|
|
_new_transform: wl_output::Transform,
|
|
) {
|
|
// TODO
|
|
// this is not required
|
|
}
|
|
|
|
fn surface_enter(
|
|
&mut self,
|
|
_: &Connection,
|
|
_: &QueueHandle<Self>,
|
|
_: &wl_surface::WlSurface,
|
|
_: &wl_output::WlOutput,
|
|
) {
|
|
}
|
|
|
|
fn surface_leave(
|
|
&mut self,
|
|
_: &Connection,
|
|
_: &QueueHandle<Self>,
|
|
_: &wl_surface::WlSurface,
|
|
_: &wl_output::WlOutput,
|
|
) {
|
|
}
|
|
}
|
|
|
|
delegate_compositor!(SctkState);
|