shell: fix warnings
This commit is contained in:
parent
6dec2cb5da
commit
3171160cff
|
@ -381,7 +381,9 @@ where
|
||||||
///
|
///
|
||||||
/// Returns `None` if the surface does actually no longer exist.
|
/// Returns `None` if the surface does actually no longer exist.
|
||||||
pub fn client(&self) -> Option<ShellClient<SD>> {
|
pub fn client(&self) -> Option<ShellClient<SD>> {
|
||||||
if !self.alive() { return None }
|
if !self.alive() {
|
||||||
|
return None;
|
||||||
|
}
|
||||||
match self.shell_surface {
|
match self.shell_surface {
|
||||||
SurfaceKind::Wl(ref s) => {
|
SurfaceKind::Wl(ref s) => {
|
||||||
let &(_, ref shell) =
|
let &(_, ref shell) =
|
||||||
|
@ -517,7 +519,9 @@ where
|
||||||
///
|
///
|
||||||
/// Returns `None` if the surface does actually no longer exist.
|
/// Returns `None` if the surface does actually no longer exist.
|
||||||
pub fn client(&self) -> Option<ShellClient<SD>> {
|
pub fn client(&self) -> Option<ShellClient<SD>> {
|
||||||
if !self.alive() { return None }
|
if !self.alive() {
|
||||||
|
return None;
|
||||||
|
}
|
||||||
match self.shell_surface {
|
match self.shell_surface {
|
||||||
SurfaceKind::Wl(ref s) => {
|
SurfaceKind::Wl(ref s) => {
|
||||||
let &(_, ref shell) =
|
let &(_, ref shell) =
|
||||||
|
|
|
@ -9,7 +9,7 @@ use std::sync::Mutex;
|
||||||
|
|
||||||
use wayland_protocols::unstable::xdg_shell::server::{zxdg_positioner_v6 as xdg_positioner, zxdg_toplevel_v6};
|
use wayland_protocols::unstable::xdg_shell::server::{zxdg_positioner_v6 as xdg_positioner, zxdg_toplevel_v6};
|
||||||
|
|
||||||
use wayland_server::{Client, Destroy, EventLoopHandle, Init, Resource};
|
use wayland_server::{Client, Destroy, EventLoopHandle, Resource};
|
||||||
use wayland_server::protocol::{wl_output, wl_seat, wl_shell, wl_shell_surface, wl_surface};
|
use wayland_server::protocol::{wl_output, wl_seat, wl_shell, wl_shell_surface, wl_surface};
|
||||||
|
|
||||||
pub struct WlShellDestructor<SD> {
|
pub struct WlShellDestructor<SD> {
|
||||||
|
@ -27,6 +27,8 @@ impl<SD> Destroy<wl_shell::WlShell> for WlShellDestructor<SD> {
|
||||||
let ptr = shell.get_user_data();
|
let ptr = shell.get_user_data();
|
||||||
shell.set_user_data(::std::ptr::null_mut());
|
shell.set_user_data(::std::ptr::null_mut());
|
||||||
let data = unsafe { Box::from_raw(ptr as *mut ShellUserData<SD>) };
|
let data = unsafe { Box::from_raw(ptr as *mut ShellUserData<SD>) };
|
||||||
|
// explicitly call drop to not forget what we're doing here
|
||||||
|
::std::mem::drop(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,9 +47,8 @@ where
|
||||||
SH: UserHandler<U, R, H, SD> + Send + 'static,
|
SH: UserHandler<U, R, H, SD> + Send + 'static,
|
||||||
SD: Send + 'static,
|
SD: Send + 'static,
|
||||||
{
|
{
|
||||||
fn get_shell_surface(&mut self, evqh: &mut EventLoopHandle, client: &Client,
|
fn get_shell_surface(&mut self, evlh: &mut EventLoopHandle, _: &Client, resource: &wl_shell::WlShell,
|
||||||
resource: &wl_shell::WlShell, id: wl_shell_surface::WlShellSurface,
|
id: wl_shell_surface::WlShellSurface, surface: &wl_surface::WlSurface) {
|
||||||
surface: &wl_surface::WlSurface) {
|
|
||||||
trace!(self.log, "Creating new wl_shell_surface.");
|
trace!(self.log, "Creating new wl_shell_surface.");
|
||||||
let role_data = ShellSurfaceRole {
|
let role_data = ShellSurfaceRole {
|
||||||
pending_state: ShellSurfacePendingState::None,
|
pending_state: ShellSurfacePendingState::None,
|
||||||
|
@ -65,7 +66,7 @@ where
|
||||||
id.set_user_data(
|
id.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 _,
|
||||||
);
|
);
|
||||||
evqh.register_with_destructor::<_, Self, WlShellDestructor<SD>>(&id, self.my_id);
|
evlh.register_with_destructor::<_, Self, WlShellDestructor<SD>>(&id, self.my_id);
|
||||||
|
|
||||||
// register ourselves to the wl_shell for ping handling
|
// register ourselves to the wl_shell for ping handling
|
||||||
let mutex = unsafe { &*(resource.get_user_data() as *mut ShellUserData<SD>) };
|
let mutex = unsafe { &*(resource.get_user_data() as *mut ShellUserData<SD>) };
|
||||||
|
@ -98,6 +99,8 @@ impl<SD> Destroy<wl_shell_surface::WlShellSurface> for WlShellDestructor<SD> {
|
||||||
shell_surface.set_user_data(::std::ptr::null_mut());
|
shell_surface.set_user_data(::std::ptr::null_mut());
|
||||||
// drop the WlSurface object
|
// drop the WlSurface object
|
||||||
let surface = unsafe { Box::from_raw(ptr as *mut ShellSurfaceUserData) };
|
let surface = unsafe { Box::from_raw(ptr as *mut ShellSurfaceUserData) };
|
||||||
|
// explicitly call drop to not forget what we're doing here
|
||||||
|
::std::mem::drop(surface);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -145,7 +148,7 @@ where
|
||||||
SH: UserHandler<U, R, H, SD> + Send + 'static,
|
SH: UserHandler<U, R, H, SD> + Send + 'static,
|
||||||
SD: Send + 'static,
|
SD: Send + 'static,
|
||||||
{
|
{
|
||||||
fn wl_handle_display_state_change(&mut self, evqh: &mut EventLoopHandle,
|
fn wl_handle_display_state_change(&mut self, evlh: &mut EventLoopHandle,
|
||||||
resource: &wl_shell_surface::WlShellSurface,
|
resource: &wl_shell_surface::WlShellSurface,
|
||||||
maximized: Option<bool>, minimized: Option<bool>,
|
maximized: Option<bool>, minimized: Option<bool>,
|
||||||
fullscreen: Option<bool>, output: Option<&wl_output::WlOutput>) {
|
fullscreen: Option<bool>, output: Option<&wl_output::WlOutput>) {
|
||||||
|
@ -153,13 +156,13 @@ where
|
||||||
// handler callback
|
// handler callback
|
||||||
let configure =
|
let configure =
|
||||||
self.handler
|
self.handler
|
||||||
.change_display_state(evqh, handle, maximized, minimized, fullscreen, output);
|
.change_display_state(evlh, handle, maximized, minimized, fullscreen, output);
|
||||||
// send the configure response to client
|
// send the configure response to client
|
||||||
let (w, h) = configure.size.unwrap_or((0, 0));
|
let (w, h) = configure.size.unwrap_or((0, 0));
|
||||||
resource.configure(wl_shell_surface::None, w, h);
|
resource.configure(wl_shell_surface::None, w, h);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn wl_ensure_toplevel(&mut self, evqh: &mut EventLoopHandle,
|
fn wl_ensure_toplevel(&mut self, evlh: &mut EventLoopHandle,
|
||||||
resource: &wl_shell_surface::WlShellSurface) {
|
resource: &wl_shell_surface::WlShellSurface) {
|
||||||
let ptr = resource.get_user_data();
|
let ptr = resource.get_user_data();
|
||||||
let &(ref wl_surface, _) = unsafe { &*(ptr as *mut ShellSurfaceUserData) };
|
let &(ref wl_surface, _) = unsafe { &*(ptr as *mut ShellSurfaceUserData) };
|
||||||
|
@ -198,7 +201,7 @@ where
|
||||||
// we need to notify about this new toplevel surface
|
// we need to notify about this new toplevel surface
|
||||||
if need_send {
|
if need_send {
|
||||||
let handle = make_toplevel_handle(self.token, resource);
|
let handle = make_toplevel_handle(self.token, resource);
|
||||||
let configure = self.handler.new_toplevel(evqh, handle);
|
let configure = self.handler.new_toplevel(evlh, handle);
|
||||||
send_toplevel_configure(resource, configure);
|
send_toplevel_configure(resource, configure);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -212,7 +215,7 @@ where
|
||||||
SH: UserHandler<U, R, H, SD> + Send + 'static,
|
SH: UserHandler<U, R, H, SD> + Send + 'static,
|
||||||
SD: Send + 'static,
|
SD: Send + 'static,
|
||||||
{
|
{
|
||||||
fn pong(&mut self, evqh: &mut EventLoopHandle, client: &Client,
|
fn pong(&mut self, evlh: &mut EventLoopHandle, _: &Client,
|
||||||
resource: &wl_shell_surface::WlShellSurface, serial: u32) {
|
resource: &wl_shell_surface::WlShellSurface, serial: u32) {
|
||||||
let &(_, ref shell) = unsafe { &*(resource.get_user_data() as *mut ShellSurfaceUserData) };
|
let &(_, ref shell) = unsafe { &*(resource.get_user_data() as *mut ShellSurfaceUserData) };
|
||||||
let valid = {
|
let valid = {
|
||||||
|
@ -226,35 +229,35 @@ where
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
if valid {
|
if valid {
|
||||||
self.handler.client_pong(evqh, make_shell_client(shell));
|
self.handler.client_pong(evlh, make_shell_client(shell));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn move_(&mut self, evqh: &mut EventLoopHandle, client: &Client,
|
fn move_(&mut self, evlh: &mut EventLoopHandle, _: &Client,
|
||||||
resource: &wl_shell_surface::WlShellSurface, seat: &wl_seat::WlSeat, serial: u32) {
|
resource: &wl_shell_surface::WlShellSurface, seat: &wl_seat::WlSeat, serial: u32) {
|
||||||
let handle = make_toplevel_handle(self.token, resource);
|
let handle = make_toplevel_handle(self.token, resource);
|
||||||
self.handler.move_(evqh, handle, seat, serial);
|
self.handler.move_(evlh, handle, seat, serial);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn resize(&mut self, evqh: &mut EventLoopHandle, client: &Client,
|
fn resize(&mut self, evlh: &mut EventLoopHandle, _: &Client,
|
||||||
resource: &wl_shell_surface::WlShellSurface, seat: &wl_seat::WlSeat, serial: u32,
|
resource: &wl_shell_surface::WlShellSurface, seat: &wl_seat::WlSeat, serial: u32,
|
||||||
edges: wl_shell_surface::Resize) {
|
edges: wl_shell_surface::Resize) {
|
||||||
let edges = zxdg_toplevel_v6::ResizeEdge::from_raw(edges.bits())
|
let edges = zxdg_toplevel_v6::ResizeEdge::from_raw(edges.bits())
|
||||||
.unwrap_or(zxdg_toplevel_v6::ResizeEdge::None);
|
.unwrap_or(zxdg_toplevel_v6::ResizeEdge::None);
|
||||||
let handle = make_toplevel_handle(self.token, resource);
|
let handle = make_toplevel_handle(self.token, resource);
|
||||||
self.handler.resize(evqh, handle, seat, serial, edges);
|
self.handler.resize(evlh, handle, seat, serial, edges);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn set_toplevel(&mut self, evqh: &mut EventLoopHandle, client: &Client,
|
fn set_toplevel(&mut self, evlh: &mut EventLoopHandle, _: &Client,
|
||||||
resource: &wl_shell_surface::WlShellSurface) {
|
resource: &wl_shell_surface::WlShellSurface) {
|
||||||
self.wl_ensure_toplevel(evqh, resource);
|
self.wl_ensure_toplevel(evlh, resource);
|
||||||
self.wl_handle_display_state_change(evqh, resource, Some(false), Some(false), Some(false), None)
|
self.wl_handle_display_state_change(evlh, resource, Some(false), Some(false), Some(false), None)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn set_transient(&mut self, evqh: &mut EventLoopHandle, client: &Client,
|
fn set_transient(&mut self, evlh: &mut EventLoopHandle, _: &Client,
|
||||||
resource: &wl_shell_surface::WlShellSurface, parent: &wl_surface::WlSurface, x: i32,
|
resource: &wl_shell_surface::WlShellSurface, parent: &wl_surface::WlSurface, _x: i32,
|
||||||
y: i32, flags: wl_shell_surface::Transient) {
|
_y: i32, _flags: wl_shell_surface::Transient) {
|
||||||
self.wl_ensure_toplevel(evqh, resource);
|
self.wl_ensure_toplevel(evlh, resource);
|
||||||
// set the parent
|
// set the parent
|
||||||
let ptr = resource.get_user_data();
|
let ptr = resource.get_user_data();
|
||||||
let &(ref wl_surface, _) = unsafe { &*(ptr as *mut ShellSurfaceUserData) };
|
let &(ref wl_surface, _) = unsafe { &*(ptr as *mut ShellSurfaceUserData) };
|
||||||
|
@ -267,20 +270,20 @@ where
|
||||||
})
|
})
|
||||||
.unwrap();
|
.unwrap();
|
||||||
// set as regular surface
|
// set as regular surface
|
||||||
self.wl_handle_display_state_change(evqh, resource, Some(false), Some(false), Some(false), None)
|
self.wl_handle_display_state_change(evlh, resource, Some(false), Some(false), Some(false), None)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn set_fullscreen(&mut self, evqh: &mut EventLoopHandle, client: &Client,
|
fn set_fullscreen(&mut self, evlh: &mut EventLoopHandle, _: &Client,
|
||||||
resource: &wl_shell_surface::WlShellSurface,
|
resource: &wl_shell_surface::WlShellSurface,
|
||||||
method: wl_shell_surface::FullscreenMethod, framerate: u32,
|
_method: wl_shell_surface::FullscreenMethod, _framerate: u32,
|
||||||
output: Option<&wl_output::WlOutput>) {
|
output: Option<&wl_output::WlOutput>) {
|
||||||
self.wl_ensure_toplevel(evqh, resource);
|
self.wl_ensure_toplevel(evlh, resource);
|
||||||
self.wl_handle_display_state_change(evqh, resource, Some(false), Some(false), Some(true), output)
|
self.wl_handle_display_state_change(evlh, resource, Some(false), Some(false), Some(true), output)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn set_popup(&mut self, evqh: &mut EventLoopHandle, client: &Client,
|
fn set_popup(&mut self, evlh: &mut EventLoopHandle, _: &Client,
|
||||||
resource: &wl_shell_surface::WlShellSurface, seat: &wl_seat::WlSeat, serial: u32,
|
resource: &wl_shell_surface::WlShellSurface, seat: &wl_seat::WlSeat, serial: u32,
|
||||||
parent: &wl_surface::WlSurface, x: i32, y: i32, flags: wl_shell_surface::Transient) {
|
parent: &wl_surface::WlSurface, x: i32, y: i32, _: wl_shell_surface::Transient) {
|
||||||
let ptr = resource.get_user_data();
|
let ptr = resource.get_user_data();
|
||||||
let &(ref wl_surface, _) = unsafe { &*(ptr as *mut ShellSurfaceUserData) };
|
let &(ref wl_surface, _) = unsafe { &*(ptr as *mut ShellSurfaceUserData) };
|
||||||
// we are reseting the popup state, so remove this surface from everywhere
|
// we are reseting the popup state, so remove this surface from everywhere
|
||||||
|
@ -319,17 +322,19 @@ where
|
||||||
|
|
||||||
// notify the handler about this new popup
|
// notify the handler about this new popup
|
||||||
let handle = make_popup_handle(self.token, resource);
|
let handle = make_popup_handle(self.token, resource);
|
||||||
let configure = self.handler.new_popup(evqh, handle);
|
let configure = self.handler.new_popup(evlh, handle);
|
||||||
send_popup_configure(resource, configure);
|
send_popup_configure(resource, configure);
|
||||||
|
self.handler
|
||||||
|
.grab(evlh, make_popup_handle(self.token, resource), seat, serial);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn set_maximized(&mut self, evqh: &mut EventLoopHandle, client: &Client,
|
fn set_maximized(&mut self, evlh: &mut EventLoopHandle, _: &Client,
|
||||||
resource: &wl_shell_surface::WlShellSurface, output: Option<&wl_output::WlOutput>) {
|
resource: &wl_shell_surface::WlShellSurface, output: Option<&wl_output::WlOutput>) {
|
||||||
self.wl_ensure_toplevel(evqh, resource);
|
self.wl_ensure_toplevel(evlh, resource);
|
||||||
self.wl_handle_display_state_change(evqh, resource, Some(true), Some(false), Some(false), output)
|
self.wl_handle_display_state_change(evlh, resource, Some(true), Some(false), Some(false), output)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn set_title(&mut self, evqh: &mut EventLoopHandle, client: &Client,
|
fn set_title(&mut self, _: &mut EventLoopHandle, _: &Client,
|
||||||
resource: &wl_shell_surface::WlShellSurface, title: String) {
|
resource: &wl_shell_surface::WlShellSurface, title: String) {
|
||||||
let ptr = resource.get_user_data();
|
let ptr = resource.get_user_data();
|
||||||
let &(ref surface, _) = unsafe { &*(ptr as *mut ShellSurfaceUserData) };
|
let &(ref surface, _) = unsafe { &*(ptr as *mut ShellSurfaceUserData) };
|
||||||
|
@ -343,7 +348,7 @@ where
|
||||||
.expect("wl_shell_surface exists but wl_surface has wrong role?!");
|
.expect("wl_shell_surface exists but wl_surface has wrong role?!");
|
||||||
}
|
}
|
||||||
|
|
||||||
fn set_class(&mut self, evqh: &mut EventLoopHandle, client: &Client,
|
fn set_class(&mut self, _: &mut EventLoopHandle, _: &Client,
|
||||||
resource: &wl_shell_surface::WlShellSurface, class_: String) {
|
resource: &wl_shell_surface::WlShellSurface, class_: String) {
|
||||||
let ptr = resource.get_user_data();
|
let ptr = resource.get_user_data();
|
||||||
let &(ref surface, _) = unsafe { &*(ptr as *mut ShellSurfaceUserData) };
|
let &(ref surface, _) = unsafe { &*(ptr as *mut ShellSurfaceUserData) };
|
||||||
|
|
|
@ -9,7 +9,7 @@ use std::sync::Mutex;
|
||||||
|
|
||||||
use wayland_protocols::unstable::xdg_shell::server::{zxdg_popup_v6, zxdg_positioner_v6, zxdg_shell_v6,
|
use wayland_protocols::unstable::xdg_shell::server::{zxdg_popup_v6, zxdg_positioner_v6, zxdg_shell_v6,
|
||||||
zxdg_surface_v6, zxdg_toplevel_v6};
|
zxdg_surface_v6, zxdg_toplevel_v6};
|
||||||
use wayland_server::{Client, Destroy, EventLoopHandle, Init, Resource};
|
use wayland_server::{Client, Destroy, EventLoopHandle, Resource};
|
||||||
use wayland_server::protocol::{wl_output, wl_seat, wl_surface};
|
use wayland_server::protocol::{wl_output, wl_seat, wl_surface};
|
||||||
|
|
||||||
pub struct XdgShellDestructor<SD> {
|
pub struct XdgShellDestructor<SD> {
|
||||||
|
@ -27,6 +27,8 @@ impl<SD> Destroy<zxdg_shell_v6::ZxdgShellV6> for XdgShellDestructor<SD> {
|
||||||
let ptr = shell.get_user_data();
|
let ptr = shell.get_user_data();
|
||||||
shell.set_user_data(::std::ptr::null_mut());
|
shell.set_user_data(::std::ptr::null_mut());
|
||||||
let data = unsafe { Box::from_raw(ptr as *mut ShellUserData<SD>) };
|
let data = unsafe { Box::from_raw(ptr as *mut ShellUserData<SD>) };
|
||||||
|
// explicit call to drop to not forget what we're doing here
|
||||||
|
::std::mem::drop(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,11 +47,9 @@ where
|
||||||
SH: UserHandler<U, R, H, SD> + Send + 'static,
|
SH: UserHandler<U, R, H, SD> + Send + 'static,
|
||||||
SD: Send + 'static,
|
SD: Send + 'static,
|
||||||
{
|
{
|
||||||
fn destroy(&mut self, evqh: &mut EventLoopHandle, client: &Client,
|
fn destroy(&mut self, _: &mut EventLoopHandle, _: &Client, _: &zxdg_shell_v6::ZxdgShellV6) {}
|
||||||
resource: &zxdg_shell_v6::ZxdgShellV6) {
|
fn create_positioner(&mut self, evlh: &mut EventLoopHandle, _: &Client,
|
||||||
}
|
_: &zxdg_shell_v6::ZxdgShellV6, id: zxdg_positioner_v6::ZxdgPositionerV6) {
|
||||||
fn create_positioner(&mut self, evqh: &mut EventLoopHandle, client: &Client,
|
|
||||||
resource: &zxdg_shell_v6::ZxdgShellV6, id: zxdg_positioner_v6::ZxdgPositionerV6) {
|
|
||||||
trace!(self.log, "Creating new xdg_positioner.");
|
trace!(self.log, "Creating new xdg_positioner.");
|
||||||
id.set_user_data(Box::into_raw(Box::new(PositionerState {
|
id.set_user_data(Box::into_raw(Box::new(PositionerState {
|
||||||
rect_size: (0, 0),
|
rect_size: (0, 0),
|
||||||
|
@ -64,9 +64,9 @@ where
|
||||||
constraint_adjustment: zxdg_positioner_v6::ConstraintAdjustment::empty(),
|
constraint_adjustment: zxdg_positioner_v6::ConstraintAdjustment::empty(),
|
||||||
offset: (0, 0),
|
offset: (0, 0),
|
||||||
})) as *mut _);
|
})) as *mut _);
|
||||||
evqh.register_with_destructor::<_, Self, XdgShellDestructor<SD>>(&id, self.my_id);
|
evlh.register_with_destructor::<_, Self, XdgShellDestructor<SD>>(&id, self.my_id);
|
||||||
}
|
}
|
||||||
fn get_xdg_surface(&mut self, evqh: &mut EventLoopHandle, client: &Client,
|
fn get_xdg_surface(&mut self, evlh: &mut EventLoopHandle, _: &Client,
|
||||||
resource: &zxdg_shell_v6::ZxdgShellV6, id: zxdg_surface_v6::ZxdgSurfaceV6,
|
resource: &zxdg_shell_v6::ZxdgShellV6, id: zxdg_surface_v6::ZxdgSurfaceV6,
|
||||||
surface: &wl_surface::WlSurface) {
|
surface: &wl_surface::WlSurface) {
|
||||||
trace!(self.log, "Creating new wl_shell_surface.");
|
trace!(self.log, "Creating new wl_shell_surface.");
|
||||||
|
@ -88,10 +88,10 @@ where
|
||||||
resource.clone_unchecked()
|
resource.clone_unchecked()
|
||||||
}))) as *mut _,
|
}))) as *mut _,
|
||||||
);
|
);
|
||||||
evqh.register_with_destructor::<_, Self, XdgShellDestructor<SD>>(&id, self.my_id);
|
evlh.register_with_destructor::<_, Self, XdgShellDestructor<SD>>(&id, self.my_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn pong(&mut self, evqh: &mut EventLoopHandle, client: &Client, resource: &zxdg_shell_v6::ZxdgShellV6,
|
fn pong(&mut self, evlh: &mut EventLoopHandle, _: &Client, resource: &zxdg_shell_v6::ZxdgShellV6,
|
||||||
serial: u32) {
|
serial: u32) {
|
||||||
let valid = {
|
let valid = {
|
||||||
let mutex = unsafe { &*(resource.get_user_data() as *mut ShellUserData<SD>) };
|
let mutex = unsafe { &*(resource.get_user_data() as *mut ShellUserData<SD>) };
|
||||||
|
@ -104,7 +104,7 @@ where
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
if valid {
|
if valid {
|
||||||
self.handler.client_pong(evqh, make_shell_client(resource));
|
self.handler.client_pong(evlh, make_shell_client(resource));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -125,6 +125,8 @@ impl<SD> Destroy<zxdg_positioner_v6::ZxdgPositionerV6> for XdgShellDestructor<SD
|
||||||
positioner.set_user_data(::std::ptr::null_mut());
|
positioner.set_user_data(::std::ptr::null_mut());
|
||||||
// drop the PositionerState
|
// drop the PositionerState
|
||||||
let surface = unsafe { Box::from_raw(ptr as *mut PositionerState) };
|
let surface = unsafe { Box::from_raw(ptr as *mut PositionerState) };
|
||||||
|
// explicit call to drop to not forget what we're doing here
|
||||||
|
::std::mem::drop(surface);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -136,11 +138,9 @@ where
|
||||||
SH: UserHandler<U, R, H, SD> + Send + 'static,
|
SH: UserHandler<U, R, H, SD> + Send + 'static,
|
||||||
SD: Send + 'static,
|
SD: Send + 'static,
|
||||||
{
|
{
|
||||||
fn destroy(&mut self, evqh: &mut EventLoopHandle, client: &Client,
|
fn destroy(&mut self, _: &mut EventLoopHandle, _: &Client, _: &zxdg_positioner_v6::ZxdgPositionerV6) {}
|
||||||
resource: &zxdg_positioner_v6::ZxdgPositionerV6) {
|
|
||||||
}
|
|
||||||
|
|
||||||
fn set_size(&mut self, evqh: &mut EventLoopHandle, client: &Client,
|
fn set_size(&mut self, _: &mut EventLoopHandle, _: &Client,
|
||||||
resource: &zxdg_positioner_v6::ZxdgPositionerV6, width: i32, height: i32) {
|
resource: &zxdg_positioner_v6::ZxdgPositionerV6, width: i32, height: i32) {
|
||||||
if width < 1 || height < 1 {
|
if width < 1 || height < 1 {
|
||||||
resource.post_error(
|
resource.post_error(
|
||||||
|
@ -154,7 +154,7 @@ where
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn set_anchor_rect(&mut self, evqh: &mut EventLoopHandle, client: &Client,
|
fn set_anchor_rect(&mut self, _: &mut EventLoopHandle, _: &Client,
|
||||||
resource: &zxdg_positioner_v6::ZxdgPositionerV6, x: i32, y: i32, width: i32,
|
resource: &zxdg_positioner_v6::ZxdgPositionerV6, x: i32, y: i32, width: i32,
|
||||||
height: i32) {
|
height: i32) {
|
||||||
if width < 1 || height < 1 {
|
if width < 1 || height < 1 {
|
||||||
|
@ -174,7 +174,7 @@ where
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn set_anchor(&mut self, evqh: &mut EventLoopHandle, client: &Client,
|
fn set_anchor(&mut self, _: &mut EventLoopHandle, _: &Client,
|
||||||
resource: &zxdg_positioner_v6::ZxdgPositionerV6, anchor: zxdg_positioner_v6::Anchor) {
|
resource: &zxdg_positioner_v6::ZxdgPositionerV6, anchor: zxdg_positioner_v6::Anchor) {
|
||||||
use self::zxdg_positioner_v6::{AnchorBottom, AnchorLeft, AnchorRight, AnchorTop};
|
use self::zxdg_positioner_v6::{AnchorBottom, AnchorLeft, AnchorRight, AnchorTop};
|
||||||
if anchor.contains(AnchorLeft | AnchorRight) || anchor.contains(AnchorTop | AnchorBottom) {
|
if anchor.contains(AnchorLeft | AnchorRight) || anchor.contains(AnchorTop | AnchorBottom) {
|
||||||
|
@ -189,7 +189,7 @@ where
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn set_gravity(&mut self, evqh: &mut EventLoopHandle, client: &Client,
|
fn set_gravity(&mut self, _: &mut EventLoopHandle, _: &Client,
|
||||||
resource: &zxdg_positioner_v6::ZxdgPositionerV6, gravity: zxdg_positioner_v6::Gravity) {
|
resource: &zxdg_positioner_v6::ZxdgPositionerV6, gravity: zxdg_positioner_v6::Gravity) {
|
||||||
use self::zxdg_positioner_v6::{GravityBottom, GravityLeft, GravityRight, GravityTop};
|
use self::zxdg_positioner_v6::{GravityBottom, GravityLeft, GravityRight, GravityTop};
|
||||||
if gravity.contains(GravityLeft | GravityRight) || gravity.contains(GravityTop | GravityBottom) {
|
if gravity.contains(GravityLeft | GravityRight) || gravity.contains(GravityTop | GravityBottom) {
|
||||||
|
@ -204,7 +204,7 @@ where
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn set_constraint_adjustment(&mut self, evqh: &mut EventLoopHandle, client: &Client,
|
fn set_constraint_adjustment(&mut self, _: &mut EventLoopHandle, _: &Client,
|
||||||
resource: &zxdg_positioner_v6::ZxdgPositionerV6,
|
resource: &zxdg_positioner_v6::ZxdgPositionerV6,
|
||||||
constraint_adjustment: u32) {
|
constraint_adjustment: u32) {
|
||||||
let constraint_adjustment =
|
let constraint_adjustment =
|
||||||
|
@ -214,7 +214,7 @@ where
|
||||||
state.constraint_adjustment = constraint_adjustment;
|
state.constraint_adjustment = constraint_adjustment;
|
||||||
}
|
}
|
||||||
|
|
||||||
fn set_offset(&mut self, evqh: &mut EventLoopHandle, client: &Client,
|
fn set_offset(&mut self, _: &mut EventLoopHandle, _: &Client,
|
||||||
resource: &zxdg_positioner_v6::ZxdgPositionerV6, x: i32, y: i32) {
|
resource: &zxdg_positioner_v6::ZxdgPositionerV6, x: i32, y: i32) {
|
||||||
let ptr = resource.get_user_data();
|
let ptr = resource.get_user_data();
|
||||||
let state = unsafe { &mut *(ptr as *mut PositionerState) };
|
let state = unsafe { &mut *(ptr as *mut PositionerState) };
|
||||||
|
@ -242,6 +242,8 @@ impl<SD> Destroy<zxdg_surface_v6::ZxdgSurfaceV6> for XdgShellDestructor<SD> {
|
||||||
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
|
||||||
|
::std::mem::drop(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -253,8 +255,7 @@ where
|
||||||
SH: UserHandler<U, R, H, SD> + Send + 'static,
|
SH: UserHandler<U, R, H, SD> + Send + 'static,
|
||||||
SD: Send + 'static,
|
SD: Send + 'static,
|
||||||
{
|
{
|
||||||
fn destroy(&mut self, evqh: &mut EventLoopHandle, client: &Client,
|
fn destroy(&mut self, _: &mut EventLoopHandle, _: &Client, resource: &zxdg_surface_v6::ZxdgSurfaceV6) {
|
||||||
resource: &zxdg_surface_v6::ZxdgSurfaceV6) {
|
|
||||||
let ptr = resource.get_user_data();
|
let ptr = resource.get_user_data();
|
||||||
let &(ref surface, ref shell) =
|
let &(ref surface, ref shell) =
|
||||||
unsafe { &*(ptr as *mut (wl_surface::WlSurface, zxdg_shell_v6::ZxdgShellV6)) };
|
unsafe { &*(ptr as *mut (wl_surface::WlSurface, zxdg_shell_v6::ZxdgShellV6)) };
|
||||||
|
@ -274,7 +275,7 @@ where
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_toplevel(&mut self, evqh: &mut EventLoopHandle, client: &Client,
|
fn get_toplevel(&mut self, evlh: &mut EventLoopHandle, _: &Client,
|
||||||
resource: &zxdg_surface_v6::ZxdgSurfaceV6, id: zxdg_toplevel_v6::ZxdgToplevelV6) {
|
resource: &zxdg_surface_v6::ZxdgSurfaceV6, id: zxdg_toplevel_v6::ZxdgToplevelV6) {
|
||||||
let ptr = resource.get_user_data();
|
let ptr = resource.get_user_data();
|
||||||
let &(ref surface, ref shell) =
|
let &(ref surface, ref shell) =
|
||||||
|
@ -300,7 +301,7 @@ where
|
||||||
resource.clone_unchecked(),
|
resource.clone_unchecked(),
|
||||||
)
|
)
|
||||||
})) as *mut _);
|
})) as *mut _);
|
||||||
evqh.register_with_destructor::<_, Self, XdgShellDestructor<SD>>(&id, self.my_id);
|
evlh.register_with_destructor::<_, Self, XdgShellDestructor<SD>>(&id, self.my_id);
|
||||||
|
|
||||||
// register to self
|
// register to self
|
||||||
self.known_toplevels
|
self.known_toplevels
|
||||||
|
@ -308,11 +309,11 @@ where
|
||||||
|
|
||||||
// intial configure event
|
// intial configure event
|
||||||
let handle = make_toplevel_handle(self.token, &id);
|
let handle = make_toplevel_handle(self.token, &id);
|
||||||
let configure = self.handler.new_toplevel(evqh, handle);
|
let configure = self.handler.new_toplevel(evlh, handle);
|
||||||
send_toplevel_configure(self.token, &id, configure);
|
send_toplevel_configure(self.token, &id, configure);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_popup(&mut self, evqh: &mut EventLoopHandle, client: &Client,
|
fn get_popup(&mut self, evlh: &mut EventLoopHandle, _: &Client,
|
||||||
resource: &zxdg_surface_v6::ZxdgSurfaceV6, id: zxdg_popup_v6::ZxdgPopupV6,
|
resource: &zxdg_surface_v6::ZxdgSurfaceV6, id: zxdg_popup_v6::ZxdgPopupV6,
|
||||||
parent: &zxdg_surface_v6::ZxdgSurfaceV6,
|
parent: &zxdg_surface_v6::ZxdgSurfaceV6,
|
||||||
positioner: &zxdg_positioner_v6::ZxdgPositionerV6) {
|
positioner: &zxdg_positioner_v6::ZxdgPositionerV6) {
|
||||||
|
@ -324,7 +325,7 @@ where
|
||||||
|
|
||||||
let parent_ptr = parent.get_user_data();
|
let parent_ptr = parent.get_user_data();
|
||||||
let &(ref parent_surface, _) =
|
let &(ref parent_surface, _) =
|
||||||
unsafe { &*(ptr as *mut (wl_surface::WlSurface, zxdg_shell_v6::ZxdgShellV6)) };
|
unsafe { &*(parent_ptr as *mut (wl_surface::WlSurface, zxdg_shell_v6::ZxdgShellV6)) };
|
||||||
|
|
||||||
self.token
|
self.token
|
||||||
.with_role_data::<ShellSurfaceRole, _, _>(surface, |data| {
|
.with_role_data::<ShellSurfaceRole, _, _>(surface, |data| {
|
||||||
|
@ -344,18 +345,18 @@ where
|
||||||
resource.clone_unchecked(),
|
resource.clone_unchecked(),
|
||||||
)
|
)
|
||||||
})) as *mut _);
|
})) as *mut _);
|
||||||
evqh.register_with_destructor::<_, Self, XdgShellDestructor<SD>>(&id, self.my_id);
|
evlh.register_with_destructor::<_, Self, XdgShellDestructor<SD>>(&id, self.my_id);
|
||||||
|
|
||||||
// register to self
|
// register to self
|
||||||
self.known_popups.push(make_popup_handle(self.token, &id));
|
self.known_popups.push(make_popup_handle(self.token, &id));
|
||||||
|
|
||||||
// intial configure event
|
// intial configure event
|
||||||
let handle = make_popup_handle(self.token, &id);
|
let handle = make_popup_handle(self.token, &id);
|
||||||
let configure = self.handler.new_popup(evqh, handle);
|
let configure = self.handler.new_popup(evlh, handle);
|
||||||
send_popup_configure(self.token, &id, configure);
|
send_popup_configure(self.token, &id, configure);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn set_window_geometry(&mut self, evqh: &mut EventLoopHandle, client: &Client,
|
fn set_window_geometry(&mut self, _: &mut EventLoopHandle, _: &Client,
|
||||||
resource: &zxdg_surface_v6::ZxdgSurfaceV6, x: i32, y: i32, width: i32,
|
resource: &zxdg_surface_v6::ZxdgSurfaceV6, x: i32, y: i32, width: i32,
|
||||||
height: i32) {
|
height: i32) {
|
||||||
let ptr = resource.get_user_data();
|
let ptr = resource.get_user_data();
|
||||||
|
@ -375,7 +376,7 @@ where
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn ack_configure(&mut self, evqh: &mut EventLoopHandle, client: &Client,
|
fn ack_configure(&mut self, _: &mut EventLoopHandle, _: &Client,
|
||||||
resource: &zxdg_surface_v6::ZxdgSurfaceV6, serial: u32) {
|
resource: &zxdg_surface_v6::ZxdgSurfaceV6, serial: u32) {
|
||||||
let ptr = resource.get_user_data();
|
let ptr = resource.get_user_data();
|
||||||
let &(ref surface, ref shell) =
|
let &(ref surface, ref shell) =
|
||||||
|
@ -426,6 +427,8 @@ impl<SD> Destroy<zxdg_toplevel_v6::ZxdgToplevelV6> for XdgShellDestructor<SD> {
|
||||||
surface.set_user_data(::std::ptr::null_mut());
|
surface.set_user_data(::std::ptr::null_mut());
|
||||||
// drop the PositionerState
|
// drop the PositionerState
|
||||||
let data = unsafe { Box::from_raw(ptr as *mut ShellSurfaceUserData) };
|
let data = unsafe { Box::from_raw(ptr as *mut ShellSurfaceUserData) };
|
||||||
|
// explicit call to drop to not forget what we're doing there
|
||||||
|
::std::mem::drop(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -454,7 +457,7 @@ where
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn xdg_handle_display_state_change(&mut self, evqh: &mut EventLoopHandle,
|
fn xdg_handle_display_state_change(&mut self, evlh: &mut EventLoopHandle,
|
||||||
resource: &zxdg_toplevel_v6::ZxdgToplevelV6,
|
resource: &zxdg_toplevel_v6::ZxdgToplevelV6,
|
||||||
maximized: Option<bool>, minimized: Option<bool>,
|
maximized: Option<bool>, minimized: Option<bool>,
|
||||||
fullscreen: Option<bool>, output: Option<&wl_output::WlOutput>) {
|
fullscreen: Option<bool>, output: Option<&wl_output::WlOutput>) {
|
||||||
|
@ -462,7 +465,7 @@ where
|
||||||
// handler callback
|
// handler callback
|
||||||
let configure =
|
let configure =
|
||||||
self.handler
|
self.handler
|
||||||
.change_display_state(evqh, handle, maximized, minimized, fullscreen, output);
|
.change_display_state(evlh, handle, maximized, minimized, fullscreen, output);
|
||||||
// send the configure response to client
|
// send the configure response to client
|
||||||
send_toplevel_configure(self.token, resource, configure);
|
send_toplevel_configure(self.token, resource, configure);
|
||||||
}
|
}
|
||||||
|
@ -520,8 +523,7 @@ where
|
||||||
SH: UserHandler<U, R, H, SD> + Send + 'static,
|
SH: UserHandler<U, R, H, SD> + Send + 'static,
|
||||||
SD: Send + 'static,
|
SD: Send + 'static,
|
||||||
{
|
{
|
||||||
fn destroy(&mut self, evqh: &mut EventLoopHandle, client: &Client,
|
fn destroy(&mut self, _: &mut EventLoopHandle, _: &Client, resource: &zxdg_toplevel_v6::ZxdgToplevelV6) {
|
||||||
resource: &zxdg_toplevel_v6::ZxdgToplevelV6) {
|
|
||||||
let ptr = resource.get_user_data();
|
let ptr = resource.get_user_data();
|
||||||
let &(ref surface, _, _) = unsafe { &*(ptr as *mut ShellSurfaceUserData) };
|
let &(ref surface, _, _) = unsafe { &*(ptr as *mut ShellSurfaceUserData) };
|
||||||
self.token
|
self.token
|
||||||
|
@ -541,7 +543,7 @@ where
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
fn set_parent(&mut self, evqh: &mut EventLoopHandle, client: &Client,
|
fn set_parent(&mut self, _: &mut EventLoopHandle, _: &Client,
|
||||||
resource: &zxdg_toplevel_v6::ZxdgToplevelV6,
|
resource: &zxdg_toplevel_v6::ZxdgToplevelV6,
|
||||||
parent: Option<&zxdg_toplevel_v6::ZxdgToplevelV6>) {
|
parent: Option<&zxdg_toplevel_v6::ZxdgToplevelV6>) {
|
||||||
self.with_surface_toplevel_data(resource, |toplevel_data| {
|
self.with_surface_toplevel_data(resource, |toplevel_data| {
|
||||||
|
@ -554,75 +556,75 @@ where
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
fn set_title(&mut self, evqh: &mut EventLoopHandle, client: &Client,
|
fn set_title(&mut self, _: &mut EventLoopHandle, _: &Client,
|
||||||
resource: &zxdg_toplevel_v6::ZxdgToplevelV6, title: String) {
|
resource: &zxdg_toplevel_v6::ZxdgToplevelV6, title: String) {
|
||||||
self.with_surface_toplevel_data(resource, |toplevel_data| { toplevel_data.title = title; });
|
self.with_surface_toplevel_data(resource, |toplevel_data| { toplevel_data.title = title; });
|
||||||
}
|
}
|
||||||
|
|
||||||
fn set_app_id(&mut self, evqh: &mut EventLoopHandle, client: &Client,
|
fn set_app_id(&mut self, _: &mut EventLoopHandle, _: &Client,
|
||||||
resource: &zxdg_toplevel_v6::ZxdgToplevelV6, app_id: String) {
|
resource: &zxdg_toplevel_v6::ZxdgToplevelV6, app_id: String) {
|
||||||
self.with_surface_toplevel_data(resource, |toplevel_data| { toplevel_data.app_id = app_id; });
|
self.with_surface_toplevel_data(resource, |toplevel_data| { toplevel_data.app_id = app_id; });
|
||||||
}
|
}
|
||||||
|
|
||||||
fn show_window_menu(&mut self, evqh: &mut EventLoopHandle, client: &Client,
|
fn show_window_menu(&mut self, evlh: &mut EventLoopHandle, _: &Client,
|
||||||
resource: &zxdg_toplevel_v6::ZxdgToplevelV6, seat: &wl_seat::WlSeat, serial: u32,
|
resource: &zxdg_toplevel_v6::ZxdgToplevelV6, seat: &wl_seat::WlSeat, serial: u32,
|
||||||
x: i32, y: i32) {
|
x: i32, y: i32) {
|
||||||
let handle = make_toplevel_handle(self.token, resource);
|
let handle = make_toplevel_handle(self.token, resource);
|
||||||
self.handler
|
self.handler
|
||||||
.show_window_menu(evqh, handle, seat, serial, x, y);
|
.show_window_menu(evlh, handle, seat, serial, x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn move_(&mut self, evqh: &mut EventLoopHandle, client: &Client,
|
fn move_(&mut self, evlh: &mut EventLoopHandle, _: &Client,
|
||||||
resource: &zxdg_toplevel_v6::ZxdgToplevelV6, seat: &wl_seat::WlSeat, serial: u32) {
|
resource: &zxdg_toplevel_v6::ZxdgToplevelV6, seat: &wl_seat::WlSeat, serial: u32) {
|
||||||
let handle = make_toplevel_handle(self.token, resource);
|
let handle = make_toplevel_handle(self.token, resource);
|
||||||
self.handler.move_(evqh, handle, seat, serial);
|
self.handler.move_(evlh, handle, seat, serial);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn resize(&mut self, evqh: &mut EventLoopHandle, client: &Client,
|
fn resize(&mut self, evlh: &mut EventLoopHandle, _: &Client,
|
||||||
resource: &zxdg_toplevel_v6::ZxdgToplevelV6, seat: &wl_seat::WlSeat, serial: u32, edges: u32) {
|
resource: &zxdg_toplevel_v6::ZxdgToplevelV6, seat: &wl_seat::WlSeat, serial: u32, edges: u32) {
|
||||||
let edges =
|
let edges =
|
||||||
zxdg_toplevel_v6::ResizeEdge::from_raw(edges).unwrap_or(zxdg_toplevel_v6::ResizeEdge::None);
|
zxdg_toplevel_v6::ResizeEdge::from_raw(edges).unwrap_or(zxdg_toplevel_v6::ResizeEdge::None);
|
||||||
let handle = make_toplevel_handle(self.token, resource);
|
let handle = make_toplevel_handle(self.token, resource);
|
||||||
self.handler.resize(evqh, handle, seat, serial, edges);
|
self.handler.resize(evlh, handle, seat, serial, edges);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn set_max_size(&mut self, evqh: &mut EventLoopHandle, client: &Client,
|
fn set_max_size(&mut self, _: &mut EventLoopHandle, _: &Client,
|
||||||
resource: &zxdg_toplevel_v6::ZxdgToplevelV6, width: i32, height: i32) {
|
resource: &zxdg_toplevel_v6::ZxdgToplevelV6, width: i32, height: i32) {
|
||||||
self.with_surface_toplevel_data(resource, |toplevel_data| {
|
self.with_surface_toplevel_data(resource, |toplevel_data| {
|
||||||
toplevel_data.max_size = (width, height);
|
toplevel_data.max_size = (width, height);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
fn set_min_size(&mut self, evqh: &mut EventLoopHandle, client: &Client,
|
fn set_min_size(&mut self, _: &mut EventLoopHandle, _: &Client,
|
||||||
resource: &zxdg_toplevel_v6::ZxdgToplevelV6, width: i32, height: i32) {
|
resource: &zxdg_toplevel_v6::ZxdgToplevelV6, width: i32, height: i32) {
|
||||||
self.with_surface_toplevel_data(resource, |toplevel_data| {
|
self.with_surface_toplevel_data(resource, |toplevel_data| {
|
||||||
toplevel_data.min_size = (width, height);
|
toplevel_data.min_size = (width, height);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
fn set_maximized(&mut self, evqh: &mut EventLoopHandle, client: &Client,
|
fn set_maximized(&mut self, evlh: &mut EventLoopHandle, _: &Client,
|
||||||
resource: &zxdg_toplevel_v6::ZxdgToplevelV6) {
|
resource: &zxdg_toplevel_v6::ZxdgToplevelV6) {
|
||||||
self.xdg_handle_display_state_change(evqh, resource, Some(true), None, None, None);
|
self.xdg_handle_display_state_change(evlh, resource, Some(true), None, None, None);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn unset_maximized(&mut self, evqh: &mut EventLoopHandle, client: &Client,
|
fn unset_maximized(&mut self, evlh: &mut EventLoopHandle, _: &Client,
|
||||||
resource: &zxdg_toplevel_v6::ZxdgToplevelV6) {
|
resource: &zxdg_toplevel_v6::ZxdgToplevelV6) {
|
||||||
self.xdg_handle_display_state_change(evqh, resource, Some(false), None, None, None);
|
self.xdg_handle_display_state_change(evlh, resource, Some(false), None, None, None);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn set_fullscreen(&mut self, evqh: &mut EventLoopHandle, client: &Client,
|
fn set_fullscreen(&mut self, evlh: &mut EventLoopHandle, _: &Client,
|
||||||
resource: &zxdg_toplevel_v6::ZxdgToplevelV6, output: Option<&wl_output::WlOutput>) {
|
resource: &zxdg_toplevel_v6::ZxdgToplevelV6, output: Option<&wl_output::WlOutput>) {
|
||||||
self.xdg_handle_display_state_change(evqh, resource, None, None, Some(true), output);
|
self.xdg_handle_display_state_change(evlh, resource, None, None, Some(true), output);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn unset_fullscreen(&mut self, evqh: &mut EventLoopHandle, client: &Client,
|
fn unset_fullscreen(&mut self, evlh: &mut EventLoopHandle, _: &Client,
|
||||||
resource: &zxdg_toplevel_v6::ZxdgToplevelV6) {
|
resource: &zxdg_toplevel_v6::ZxdgToplevelV6) {
|
||||||
self.xdg_handle_display_state_change(evqh, resource, None, None, Some(false), None);
|
self.xdg_handle_display_state_change(evlh, resource, None, None, Some(false), None);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn set_minimized(&mut self, evqh: &mut EventLoopHandle, client: &Client,
|
fn set_minimized(&mut self, evlh: &mut EventLoopHandle, _: &Client,
|
||||||
resource: &zxdg_toplevel_v6::ZxdgToplevelV6) {
|
resource: &zxdg_toplevel_v6::ZxdgToplevelV6) {
|
||||||
self.xdg_handle_display_state_change(evqh, resource, None, Some(true), None, None);
|
self.xdg_handle_display_state_change(evlh, resource, None, Some(true), None, None);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -644,6 +646,8 @@ impl<SD> Destroy<zxdg_popup_v6::ZxdgPopupV6> for XdgShellDestructor<SD> {
|
||||||
surface.set_user_data(::std::ptr::null_mut());
|
surface.set_user_data(::std::ptr::null_mut());
|
||||||
// drop the PositionerState
|
// drop the PositionerState
|
||||||
let data = unsafe { Box::from_raw(ptr as *mut ShellSurfaceUserData) };
|
let data = unsafe { Box::from_raw(ptr as *mut ShellSurfaceUserData) };
|
||||||
|
// explicit call to drop to not forget what we're doing
|
||||||
|
::std::mem::drop(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -689,8 +693,7 @@ where
|
||||||
SH: UserHandler<U, R, H, SD> + Send + 'static,
|
SH: UserHandler<U, R, H, SD> + Send + 'static,
|
||||||
SD: Send + 'static,
|
SD: Send + 'static,
|
||||||
{
|
{
|
||||||
fn destroy(&mut self, evqh: &mut EventLoopHandle, client: &Client,
|
fn destroy(&mut self, _: &mut EventLoopHandle, _: &Client, resource: &zxdg_popup_v6::ZxdgPopupV6) {
|
||||||
resource: &zxdg_popup_v6::ZxdgPopupV6) {
|
|
||||||
let ptr = resource.get_user_data();
|
let ptr = resource.get_user_data();
|
||||||
let &(ref surface, _, _) = unsafe {
|
let &(ref surface, _, _) = unsafe {
|
||||||
&*(ptr as
|
&*(ptr as
|
||||||
|
@ -717,10 +720,10 @@ where
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
fn grab(&mut self, evqh: &mut EventLoopHandle, client: &Client, resource: &zxdg_popup_v6::ZxdgPopupV6,
|
fn grab(&mut self, evlh: &mut EventLoopHandle, _: &Client, resource: &zxdg_popup_v6::ZxdgPopupV6,
|
||||||
seat: &wl_seat::WlSeat, serial: u32) {
|
seat: &wl_seat::WlSeat, serial: u32) {
|
||||||
let handle = make_popup_handle(self.token, resource);
|
let handle = make_popup_handle(self.token, resource);
|
||||||
self.handler.grab(evqh, handle, seat, serial);
|
self.handler.grab(evlh, handle, seat, serial);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue