Merge pull request #33 from vberger/shell

Update example to have weston-terminal not crashing
This commit is contained in:
Victor Berger 2017-09-08 17:59:50 +02:00 committed by GitHub
commit 1bea019bc5
1 changed files with 8 additions and 2 deletions

View File

@ -29,8 +29,8 @@ use smithay::shm::{ShmGlobal, ShmToken};
use wayland_protocols::unstable::xdg_shell::server::{zxdg_shell_v6, zxdg_toplevel_v6}; use wayland_protocols::unstable::xdg_shell::server::{zxdg_shell_v6, zxdg_toplevel_v6};
use wayland_server::{Client, EventLoopHandle}; use wayland_server::{Client, EventLoopHandle};
use wayland_server::protocol::{wl_compositor, wl_output, wl_seat, wl_shell, wl_shm, wl_subcompositor, use wayland_server::protocol::{wl_callback, wl_compositor, wl_output, wl_seat, wl_shell, wl_shm,
wl_surface}; wl_subcompositor, wl_surface};
define_roles!(Roles => [ ShellSurface, ShellSurfaceRole ] ); define_roles!(Roles => [ ShellSurface, ShellSurfaceRole ] );
@ -68,6 +68,7 @@ impl compositor::Handler<SurfaceData, Roles> for SurfaceHandler {
Some((new_vec, (data.width as u32, data.height as u32))); Some((new_vec, (data.width as u32, data.height as u32)));
}) })
.unwrap(); .unwrap();
buffer.release();
} }
Some(None) => { Some(None) => {
// erase the contents // erase the contents
@ -77,6 +78,11 @@ impl compositor::Handler<SurfaceData, Roles> for SurfaceHandler {
} }
}); });
} }
fn frame(&mut self, _evlh: &mut EventLoopHandle, _client: &Client, surface: &wl_surface::WlSurface,
callback: wl_callback::WlCallback, _token: CompositorToken<SurfaceData, Roles, SurfaceHandler>) {
callback.done(0);
}
} }
struct ShellSurfaceHandler { struct ShellSurfaceHandler {