Merge pull request #40 from Smithay/fix/borrow
Fix examples and expand travis
This commit is contained in:
commit
c5048fea71
22
.travis.yml
22
.travis.yml
|
@ -2,7 +2,7 @@ language: rust
|
||||||
|
|
||||||
cache: cargo
|
cache: cargo
|
||||||
|
|
||||||
sudo: false
|
sudo: required
|
||||||
|
|
||||||
rust:
|
rust:
|
||||||
- stable
|
- stable
|
||||||
|
@ -21,8 +21,16 @@ dist: trusty
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
packages:
|
packages:
|
||||||
- libwayland-dev
|
- libssl-dev
|
||||||
- libudev-dev
|
- libudev-dev
|
||||||
|
- libgbm-dev
|
||||||
|
- libxkbcommon-dev
|
||||||
|
- libegl1-mesa-dev
|
||||||
|
|
||||||
|
before_install:
|
||||||
|
- sudo add-apt-repository -y ppa:wayland.admin/daily-builds
|
||||||
|
- sudo apt-get update -qq
|
||||||
|
- sudo apt-get install -y libwayland-dev libinput-dev
|
||||||
|
|
||||||
branches:
|
branches:
|
||||||
only:
|
only:
|
||||||
|
@ -38,13 +46,13 @@ before_script:
|
||||||
- export XDG_RUNTIME_DIR="$(pwd)/socket"
|
- export XDG_RUNTIME_DIR="$(pwd)/socket"
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- travis-cargo --only nightly fmt -- -- --write-mode=diff
|
- travis-cargo -q --only nightly fmt -- -- --write-mode=diff
|
||||||
- travis-cargo --skip nightly build
|
- travis-cargo -q --skip nightly test
|
||||||
- travis-cargo --only nightly build -- --features "clippy"
|
- travis-cargo -q --only nightly test -- --features "clippy"
|
||||||
- travis-cargo --only stable doc -- --no-deps
|
- travis-cargo -q --only stable doc -- --no-deps
|
||||||
|
|
||||||
after_success:
|
after_success:
|
||||||
- travis-cargo --only stable doc-upload
|
- travis-cargo -q --only stable doc-upload
|
||||||
|
|
||||||
env:
|
env:
|
||||||
global:
|
global:
|
||||||
|
|
|
@ -25,7 +25,6 @@ use smithay::compositor::{compositor_init, CompositorToken, SubsurfaceRole, Trav
|
||||||
use smithay::compositor::roles::Role;
|
use smithay::compositor::roles::Role;
|
||||||
use smithay::shell::{shell_init, ShellState};
|
use smithay::shell::{shell_init, ShellState};
|
||||||
use smithay::shm::init_shm_global;
|
use smithay::shm::init_shm_global;
|
||||||
use std::borrow::Borrow;
|
|
||||||
use std::fs::OpenOptions;
|
use std::fs::OpenOptions;
|
||||||
use std::io::Error as IoError;
|
use std::io::Error as IoError;
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
|
@ -148,7 +147,7 @@ impl DrmHandler<GliumDrawer<DrmBackend>> for DrmHandlerImpl {
|
||||||
frame.clear_color(0.8, 0.8, 0.9, 1.0);
|
frame.clear_color(0.8, 0.8, 0.9, 1.0);
|
||||||
// redraw the frame, in a simple but inneficient way
|
// redraw the frame, in a simple but inneficient way
|
||||||
{
|
{
|
||||||
let screen_dimensions = (drawer.borrow() as &DrmBackend).get_framebuffer_dimensions();
|
let screen_dimensions = drawer.get_framebuffer_dimensions();
|
||||||
for toplevel_surface in state.get(&self.shell_state_token).toplevel_surfaces() {
|
for toplevel_surface in state.get(&self.shell_state_token).toplevel_surfaces() {
|
||||||
if let Some(wl_surface) = toplevel_surface.get_surface() {
|
if let Some(wl_surface) = toplevel_surface.get_surface() {
|
||||||
// this surface is a root of a subsurface tree that needs to be drawn
|
// this surface is a root of a subsurface tree that needs to be drawn
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
use glium;
|
use glium;
|
||||||
use glium::Surface;
|
use glium::{Frame, Surface};
|
||||||
use glium::index::PrimitiveType;
|
use glium::index::PrimitiveType;
|
||||||
use smithay::backend::graphics::egl::EGLGraphicsBackend;
|
use smithay::backend::graphics::egl::EGLGraphicsBackend;
|
||||||
use smithay::backend::graphics::glium::GliumGraphicsBackend;
|
use smithay::backend::graphics::glium::GliumGraphicsBackend;
|
||||||
use std::ops::Deref;
|
|
||||||
use std::borrow::Borrow;
|
use std::borrow::Borrow;
|
||||||
|
use std::ops::Deref;
|
||||||
|
|
||||||
#[derive(Copy, Clone)]
|
#[derive(Copy, Clone)]
|
||||||
struct Vertex {
|
struct Vertex {
|
||||||
|
@ -22,10 +22,10 @@ pub struct GliumDrawer<F: EGLGraphicsBackend + 'static> {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<F: EGLGraphicsBackend + 'static> Deref for GliumDrawer<F> {
|
impl<F: EGLGraphicsBackend + 'static> Deref for GliumDrawer<F> {
|
||||||
type Target = GliumGraphicsBackend<F>;
|
type Target = F;
|
||||||
|
|
||||||
fn deref(&self) -> &GliumGraphicsBackend<F> {
|
fn deref(&self) -> &F {
|
||||||
&self.display
|
self.borrow()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -142,4 +142,9 @@ impl<F: EGLGraphicsBackend + 'static> GliumDrawer<F> {
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
|
pub fn draw(&self) -> Frame {
|
||||||
|
self.display.draw()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,9 +26,8 @@ pub fn surface_implementation() -> SurfaceUserImplementation<SurfaceData, Roles,
|
||||||
let height = data.height as usize;
|
let height = data.height as usize;
|
||||||
let mut new_vec = Vec::with_capacity(width * height * 4);
|
let mut new_vec = Vec::with_capacity(width * height * 4);
|
||||||
for i in 0..height {
|
for i in 0..height {
|
||||||
new_vec.extend(
|
new_vec
|
||||||
&slice[(offset + i * stride)..(offset + i * stride + width * 4)],
|
.extend(&slice[(offset + i * stride)..(offset + i * stride + width * 4)]);
|
||||||
);
|
|
||||||
}
|
}
|
||||||
attributes.user_data.buffer =
|
attributes.user_data.buffer =
|
||||||
Some((new_vec, (data.width as u32, data.height as u32)));
|
Some((new_vec, (data.width as u32, data.height as u32)));
|
||||||
|
|
|
@ -491,12 +491,7 @@ where
|
||||||
|
|
||||||
let &mut (ref mut dev, ref mut handler) = id;
|
let &mut (ref mut dev, ref mut handler) = id;
|
||||||
|
|
||||||
struct PageFlipHandler<
|
struct PageFlipHandler<'a, 'b, B: Borrow<DrmBackend> + 'static, H: DrmHandler<B> + 'static> {
|
||||||
'a,
|
|
||||||
'b,
|
|
||||||
B: Borrow<DrmBackend> + 'static,
|
|
||||||
H: DrmHandler<B> + 'static,
|
|
||||||
> {
|
|
||||||
handler: &'a mut H,
|
handler: &'a mut H,
|
||||||
evlh: &'b mut EventLoopHandle,
|
evlh: &'b mut EventLoopHandle,
|
||||||
_marker: PhantomData<B>,
|
_marker: PhantomData<B>,
|
||||||
|
|
|
@ -619,11 +619,11 @@ impl<'a, T: NativeSurface> EGLContext<'a, T> {
|
||||||
};
|
};
|
||||||
|
|
||||||
let desc = PixelFormat {
|
let desc = PixelFormat {
|
||||||
hardware_accelerated: attrib!(egl, display, config_id, ffi::egl::CONFIG_CAVEAT) !=
|
hardware_accelerated: attrib!(egl, display, config_id, ffi::egl::CONFIG_CAVEAT)
|
||||||
ffi::egl::SLOW_CONFIG as i32,
|
!= ffi::egl::SLOW_CONFIG as i32,
|
||||||
color_bits: attrib!(egl, display, config_id, ffi::egl::RED_SIZE) as u8 +
|
color_bits: attrib!(egl, display, config_id, ffi::egl::RED_SIZE) as u8
|
||||||
attrib!(egl, display, config_id, ffi::egl::BLUE_SIZE) as u8 +
|
+ attrib!(egl, display, config_id, ffi::egl::BLUE_SIZE) as u8
|
||||||
attrib!(egl, display, config_id, ffi::egl::GREEN_SIZE) as u8,
|
+ attrib!(egl, display, config_id, ffi::egl::GREEN_SIZE) as u8,
|
||||||
alpha_bits: attrib!(egl, display, config_id, ffi::egl::ALPHA_SIZE) as u8,
|
alpha_bits: attrib!(egl, display, config_id, ffi::egl::ALPHA_SIZE) as u8,
|
||||||
depth_bits: attrib!(egl, display, config_id, ffi::egl::DEPTH_SIZE) as u8,
|
depth_bits: attrib!(egl, display, config_id, ffi::egl::DEPTH_SIZE) as u8,
|
||||||
stencil_bits: attrib!(egl, display, config_id, ffi::egl::STENCIL_SIZE) as u8,
|
stencil_bits: attrib!(egl, display, config_id, ffi::egl::STENCIL_SIZE) as u8,
|
||||||
|
|
|
@ -308,8 +308,8 @@ impl PointerMotionAbsoluteEvent for WinitMouseMovedEvent {
|
||||||
|
|
||||||
fn x_transformed(&self, width: u32) -> u32 {
|
fn x_transformed(&self, width: u32) -> u32 {
|
||||||
cmp::min(
|
cmp::min(
|
||||||
(self.x * width as f64 /
|
(self.x * width as f64
|
||||||
self.window
|
/ self.window
|
||||||
.head()
|
.head()
|
||||||
.get_inner_size_points()
|
.get_inner_size_points()
|
||||||
.unwrap_or((width, 0))
|
.unwrap_or((width, 0))
|
||||||
|
@ -320,8 +320,8 @@ impl PointerMotionAbsoluteEvent for WinitMouseMovedEvent {
|
||||||
|
|
||||||
fn y_transformed(&self, height: u32) -> u32 {
|
fn y_transformed(&self, height: u32) -> u32 {
|
||||||
cmp::min(
|
cmp::min(
|
||||||
(self.y * height as f64 /
|
(self.y * height as f64
|
||||||
self.window
|
/ self.window
|
||||||
.head()
|
.head()
|
||||||
.get_inner_size_points()
|
.get_inner_size_points()
|
||||||
.unwrap_or((0, height))
|
.unwrap_or((0, height))
|
||||||
|
@ -421,8 +421,8 @@ impl TouchDownEvent for WinitTouchStartedEvent {
|
||||||
|
|
||||||
fn x_transformed(&self, width: u32) -> u32 {
|
fn x_transformed(&self, width: u32) -> u32 {
|
||||||
cmp::min(
|
cmp::min(
|
||||||
self.location.0 as i32 * width as i32 /
|
self.location.0 as i32 * width as i32
|
||||||
self.window
|
/ self.window
|
||||||
.head()
|
.head()
|
||||||
.get_inner_size_points()
|
.get_inner_size_points()
|
||||||
.unwrap_or((width, 0))
|
.unwrap_or((width, 0))
|
||||||
|
@ -433,8 +433,8 @@ impl TouchDownEvent for WinitTouchStartedEvent {
|
||||||
|
|
||||||
fn y_transformed(&self, height: u32) -> u32 {
|
fn y_transformed(&self, height: u32) -> u32 {
|
||||||
cmp::min(
|
cmp::min(
|
||||||
self.location.1 as i32 * height as i32 /
|
self.location.1 as i32 * height as i32
|
||||||
self.window
|
/ self.window
|
||||||
.head()
|
.head()
|
||||||
.get_inner_size_points()
|
.get_inner_size_points()
|
||||||
.unwrap_or((0, height))
|
.unwrap_or((0, height))
|
||||||
|
@ -473,8 +473,8 @@ impl TouchMotionEvent for WinitTouchMovedEvent {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn x_transformed(&self, width: u32) -> u32 {
|
fn x_transformed(&self, width: u32) -> u32 {
|
||||||
self.location.0 as u32 * width /
|
self.location.0 as u32 * width
|
||||||
self.window
|
/ self.window
|
||||||
.head()
|
.head()
|
||||||
.get_inner_size_points()
|
.get_inner_size_points()
|
||||||
.unwrap_or((width, 0))
|
.unwrap_or((width, 0))
|
||||||
|
@ -482,8 +482,8 @@ impl TouchMotionEvent for WinitTouchMovedEvent {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn y_transformed(&self, height: u32) -> u32 {
|
fn y_transformed(&self, height: u32) -> u32 {
|
||||||
self.location.1 as u32 * height /
|
self.location.1 as u32 * height
|
||||||
self.window
|
/ self.window
|
||||||
.head()
|
.head()
|
||||||
.get_inner_size_points()
|
.get_inner_size_points()
|
||||||
.unwrap_or((0, height))
|
.unwrap_or((0, height))
|
||||||
|
@ -619,7 +619,8 @@ impl InputBackend for WinitInputBackend {
|
||||||
}
|
}
|
||||||
(
|
(
|
||||||
WindowEvent::KeyboardInput {
|
WindowEvent::KeyboardInput {
|
||||||
input: KeyboardInput {
|
input:
|
||||||
|
KeyboardInput {
|
||||||
scancode, state, ..
|
scancode, state, ..
|
||||||
},
|
},
|
||||||
..
|
..
|
||||||
|
|
|
@ -227,9 +227,7 @@ where
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
subsurface.set_user_data(
|
subsurface.set_user_data(Box::into_raw(Box::new(unsafe { surface.clone_unchecked() })) as *mut _);
|
||||||
Box::into_raw(Box::new(unsafe { surface.clone_unchecked() })) as *mut _,
|
|
||||||
);
|
|
||||||
evlh.register(
|
evlh.register(
|
||||||
&subsurface,
|
&subsurface,
|
||||||
subsurface_implementation::<U, R>(),
|
subsurface_implementation::<U, R>(),
|
||||||
|
@ -253,9 +251,8 @@ where
|
||||||
{
|
{
|
||||||
let ptr = subsurface.get_user_data();
|
let ptr = subsurface.get_user_data();
|
||||||
let surface = &*(ptr as *mut wl_surface::WlSurface);
|
let surface = &*(ptr as *mut wl_surface::WlSurface);
|
||||||
SurfaceData::<U, R>::with_role_data::<SubsurfaceRole, _, _>(surface, |d| f(d)).expect(
|
SurfaceData::<U, R>::with_role_data::<SubsurfaceRole, _, _>(surface, |d| f(d))
|
||||||
"The surface does not have a subsurface role while it has a wl_subsurface?!",
|
.expect("The surface does not have a subsurface role while it has a wl_subsurface?!");
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn subsurface_implementation<U, R>() -> wl_subsurface::Implementation<()>
|
fn subsurface_implementation<U, R>() -> wl_subsurface::Implementation<()>
|
||||||
|
|
|
@ -11,9 +11,8 @@ pub struct RegionData {
|
||||||
impl RegionData {
|
impl RegionData {
|
||||||
/// Initialize the user_data of a region, must be called right when the surface is created
|
/// Initialize the user_data of a region, must be called right when the surface is created
|
||||||
pub unsafe fn init(region: &wl_region::WlRegion) {
|
pub unsafe fn init(region: &wl_region::WlRegion) {
|
||||||
region.set_user_data(
|
region.set_user_data(Box::into_raw(Box::new(Mutex::new(RegionData::default())))
|
||||||
Box::into_raw(Box::new(Mutex::new(RegionData::default()))) as *mut _,
|
as *mut _)
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Cleans the user_data of that surface, must be called when it is destroyed
|
/// Cleans the user_data of that surface, must be called when it is destroyed
|
||||||
|
|
|
@ -57,9 +57,7 @@ impl<U: Default, R: Default> SurfaceData<U, R> {
|
||||||
|
|
||||||
/// Initialize the user_data of a surface, must be called right when the surface is created
|
/// Initialize the user_data of a surface, must be called right when the surface is created
|
||||||
pub unsafe fn init(surface: &wl_surface::WlSurface) {
|
pub unsafe fn init(surface: &wl_surface::WlSurface) {
|
||||||
surface.set_user_data(
|
surface.set_user_data(Box::into_raw(Box::new(Mutex::new(SurfaceData::<U, R>::new()))) as *mut _)
|
||||||
Box::into_raw(Box::new(Mutex::new(SurfaceData::<U, R>::new()))) as *mut _,
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -596,9 +596,7 @@ where
|
||||||
}
|
}
|
||||||
let configured = self.token
|
let configured = self.token
|
||||||
.with_role_data::<ShellSurfaceRole, _, _>(&self.wl_surface, |data| data.configured)
|
.with_role_data::<ShellSurfaceRole, _, _>(&self.wl_surface, |data| data.configured)
|
||||||
.expect(
|
.expect("A shell surface object exists but the surface does not have the shell_surface role ?!");
|
||||||
"A shell surface object exists but the surface does not have the shell_surface role ?!",
|
|
||||||
);
|
|
||||||
if !configured {
|
if !configured {
|
||||||
if let SurfaceKind::XdgToplevel(ref s) = self.shell_surface {
|
if let SurfaceKind::XdgToplevel(ref s) = self.shell_surface {
|
||||||
let ptr = s.get_user_data();
|
let ptr = s.get_user_data();
|
||||||
|
@ -733,9 +731,7 @@ where
|
||||||
}
|
}
|
||||||
let configured = self.token
|
let configured = self.token
|
||||||
.with_role_data::<ShellSurfaceRole, _, _>(&self.wl_surface, |data| data.configured)
|
.with_role_data::<ShellSurfaceRole, _, _>(&self.wl_surface, |data| data.configured)
|
||||||
.expect(
|
.expect("A shell surface object exists but the surface does not have the shell_surface role ?!");
|
||||||
"A shell surface object exists but the surface does not have the shell_surface role ?!",
|
|
||||||
);
|
|
||||||
if !configured {
|
if !configured {
|
||||||
if let SurfaceKind::XdgPopup(ref s) = self.shell_surface {
|
if let SurfaceKind::XdgPopup(ref s) = self.shell_surface {
|
||||||
let ptr = s.get_user_data();
|
let ptr = s.get_user_data();
|
||||||
|
|
|
@ -78,9 +78,8 @@ where
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
shell_surface.set_user_data(
|
shell_surface
|
||||||
Box::into_raw(Box::new(unsafe { surface.clone_unchecked() })) as *mut _,
|
.set_user_data(Box::into_raw(Box::new(unsafe { surface.clone_unchecked() })) as *mut _);
|
||||||
);
|
|
||||||
evlh.register(
|
evlh.register(
|
||||||
&shell_surface,
|
&shell_surface,
|
||||||
shell_surface_implementation(),
|
shell_surface_implementation(),
|
||||||
|
@ -243,9 +242,7 @@ where
|
||||||
});
|
});
|
||||||
return true;
|
return true;
|
||||||
})
|
})
|
||||||
.expect(
|
.expect("xdg_surface exists but surface has not shell_surface role?!");
|
||||||
"xdg_surface exists but surface has not shell_surface role?!",
|
|
||||||
);
|
|
||||||
// we need to notify about this new toplevel surface
|
// we need to notify about this new toplevel surface
|
||||||
if need_send {
|
if need_send {
|
||||||
evlh.state()
|
evlh.state()
|
||||||
|
|
|
@ -19,9 +19,7 @@ where
|
||||||
SID: 'static,
|
SID: 'static,
|
||||||
SD: Default + 'static,
|
SD: Default + 'static,
|
||||||
{
|
{
|
||||||
shell.set_user_data(
|
shell.set_user_data(Box::into_raw(Box::new(Mutex::new(make_shell_client_data::<SD>()))) as *mut _);
|
||||||
Box::into_raw(Box::new(Mutex::new(make_shell_client_data::<SD>()))) as *mut _,
|
|
||||||
);
|
|
||||||
evlh.register(
|
evlh.register(
|
||||||
&shell,
|
&shell,
|
||||||
shell_implementation(),
|
shell_implementation(),
|
||||||
|
@ -222,11 +220,8 @@ fn destroy_surface(surface: &zxdg_surface_v6::ZxdgSurfaceV6) {
|
||||||
let ptr = surface.get_user_data();
|
let ptr = surface.get_user_data();
|
||||||
surface.set_user_data(::std::ptr::null_mut());
|
surface.set_user_data(::std::ptr::null_mut());
|
||||||
// drop the state
|
// drop the state
|
||||||
let data = unsafe {
|
let data =
|
||||||
Box::from_raw(
|
unsafe { Box::from_raw(ptr as *mut (zxdg_surface_v6::ZxdgSurfaceV6, zxdg_shell_v6::ZxdgShellV6)) };
|
||||||
ptr as *mut (zxdg_surface_v6::ZxdgSurfaceV6, zxdg_shell_v6::ZxdgShellV6),
|
|
||||||
)
|
|
||||||
};
|
|
||||||
// explicit call to drop to not forget what we're doing here
|
// explicit call to drop to not forget what we're doing here
|
||||||
::std::mem::drop(data);
|
::std::mem::drop(data);
|
||||||
}
|
}
|
||||||
|
@ -258,9 +253,7 @@ where
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.expect(
|
.expect("xdg_surface exists but surface has not shell_surface role?!");
|
||||||
"xdg_surface exists but surface has not shell_surface role?!",
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
get_toplevel: |evlh, idata, _, xdg_surface, toplevel| {
|
get_toplevel: |evlh, idata, _, xdg_surface, toplevel| {
|
||||||
let ptr = xdg_surface.get_user_data();
|
let ptr = xdg_surface.get_user_data();
|
||||||
|
@ -277,9 +270,7 @@ where
|
||||||
max_size: (0, 0),
|
max_size: (0, 0),
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.expect(
|
.expect("xdg_surface exists but surface has not shell_surface role?!");
|
||||||
"xdg_surface exists but surface has not shell_surface role?!",
|
|
||||||
);
|
|
||||||
|
|
||||||
toplevel.set_user_data(Box::into_raw(Box::new(unsafe {
|
toplevel.set_user_data(Box::into_raw(Box::new(unsafe {
|
||||||
(
|
(
|
||||||
|
@ -326,9 +317,7 @@ where
|
||||||
positioner: positioner_data.clone(),
|
positioner: positioner_data.clone(),
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.expect(
|
.expect("xdg_surface exists but surface has not shell_surface role?!");
|
||||||
"xdg_surface exists but surface has not shell_surface role?!",
|
|
||||||
);
|
|
||||||
|
|
||||||
popup.set_user_data(Box::into_raw(Box::new(unsafe {
|
popup.set_user_data(Box::into_raw(Box::new(unsafe {
|
||||||
(
|
(
|
||||||
|
@ -370,9 +359,7 @@ where
|
||||||
height,
|
height,
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.expect(
|
.expect("xdg_surface exists but surface has not shell_surface role?!");
|
||||||
"xdg_surface exists but surface has not shell_surface role?!",
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
ack_configure: |_, idata, _, surface, serial| {
|
ack_configure: |_, idata, _, surface, serial| {
|
||||||
let ptr = surface.get_user_data();
|
let ptr = surface.get_user_data();
|
||||||
|
@ -397,9 +384,7 @@ where
|
||||||
}
|
}
|
||||||
data.configured = true;
|
data.configured = true;
|
||||||
})
|
})
|
||||||
.expect(
|
.expect("xdg_surface exists but surface has not shell_surface role?!");
|
||||||
"xdg_surface exists but surface has not shell_surface role?!",
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -442,9 +427,7 @@ where
|
||||||
ShellSurfacePendingState::Toplevel(ref mut toplevel_data) => f(toplevel_data),
|
ShellSurfacePendingState::Toplevel(ref mut toplevel_data) => f(toplevel_data),
|
||||||
_ => unreachable!(),
|
_ => unreachable!(),
|
||||||
})
|
})
|
||||||
.expect(
|
.expect("xdg_toplevel exists but surface has not shell_surface role?!");
|
||||||
"xdg_toplevel exists but surface has not shell_surface role?!",
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn xdg_handle_display_state_change<U, R, CID, SID, SD>(evlh: &mut EventLoopHandle,
|
fn xdg_handle_display_state_change<U, R, CID, SID, SD>(evlh: &mut EventLoopHandle,
|
||||||
|
@ -503,9 +486,7 @@ where
|
||||||
// Add the configure as pending
|
// Add the configure as pending
|
||||||
token
|
token
|
||||||
.with_role_data::<ShellSurfaceRole, _, _>(surface, |data| data.pending_configures.push(serial))
|
.with_role_data::<ShellSurfaceRole, _, _>(surface, |data| data.pending_configures.push(serial))
|
||||||
.expect(
|
.expect("xdg_toplevel exists but surface has not shell_surface role?!");
|
||||||
"xdg_toplevel exists but surface has not shell_surface role?!",
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn make_toplevel_handle<U, R, H, SD>(token: CompositorToken<U, R, H>,
|
fn make_toplevel_handle<U, R, H, SD>(token: CompositorToken<U, R, H>,
|
||||||
|
@ -541,9 +522,7 @@ where
|
||||||
data.pending_state = ShellSurfacePendingState::None;
|
data.pending_state = ShellSurfacePendingState::None;
|
||||||
data.configured = false;
|
data.configured = false;
|
||||||
})
|
})
|
||||||
.expect(
|
.expect("xdg_toplevel exists but surface has not shell_surface role?!");
|
||||||
"xdg_toplevel exists but surface has not shell_surface role?!",
|
|
||||||
);
|
|
||||||
// remove this surface from the known ones (as well as any leftover dead surface)
|
// remove this surface from the known ones (as well as any leftover dead surface)
|
||||||
evlh.state()
|
evlh.state()
|
||||||
.get_mut(&idata.state_token)
|
.get_mut(&idata.state_token)
|
||||||
|
@ -651,9 +630,7 @@ where
|
||||||
// Add the configure as pending
|
// Add the configure as pending
|
||||||
token
|
token
|
||||||
.with_role_data::<ShellSurfaceRole, _, _>(surface, |data| data.pending_configures.push(serial))
|
.with_role_data::<ShellSurfaceRole, _, _>(surface, |data| data.pending_configures.push(serial))
|
||||||
.expect(
|
.expect("xdg_toplevel exists but surface has not shell_surface role?!");
|
||||||
"xdg_toplevel exists but surface has not shell_surface role?!",
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn make_popup_handle<U, R, H, SD>(token: CompositorToken<U, R, H>, resource: &zxdg_popup_v6::ZxdgPopupV6)
|
fn make_popup_handle<U, R, H, SD>(token: CompositorToken<U, R, H>, resource: &zxdg_popup_v6::ZxdgPopupV6)
|
||||||
|
@ -682,8 +659,8 @@ where
|
||||||
destroy: |evlh, idata, _, popup| {
|
destroy: |evlh, idata, _, popup| {
|
||||||
let ptr = popup.get_user_data();
|
let ptr = popup.get_user_data();
|
||||||
let &(ref surface, _, _) = unsafe {
|
let &(ref surface, _, _) = unsafe {
|
||||||
&*(ptr as
|
&*(ptr
|
||||||
*mut (
|
as *mut (
|
||||||
wl_surface::WlSurface,
|
wl_surface::WlSurface,
|
||||||
zxdg_shell_v6::ZxdgShellV6,
|
zxdg_shell_v6::ZxdgShellV6,
|
||||||
zxdg_surface_v6::ZxdgSurfaceV6,
|
zxdg_surface_v6::ZxdgSurfaceV6,
|
||||||
|
@ -695,9 +672,7 @@ where
|
||||||
data.pending_state = ShellSurfacePendingState::None;
|
data.pending_state = ShellSurfacePendingState::None;
|
||||||
data.configured = false;
|
data.configured = false;
|
||||||
})
|
})
|
||||||
.expect(
|
.expect("xdg_toplevel exists but surface has not shell_surface role?!");
|
||||||
"xdg_toplevel exists but surface has not shell_surface role?!",
|
|
||||||
);
|
|
||||||
// remove this surface from the known ones (as well as any leftover dead surface)
|
// remove this surface from the known ones (as well as any leftover dead surface)
|
||||||
evlh.state()
|
evlh.state()
|
||||||
.get_mut(&idata.state_token)
|
.get_mut(&idata.state_token)
|
||||||
|
|
Loading…
Reference in New Issue