From 33272a2275836084c9f6278a7bbaba29214747be Mon Sep 17 00:00:00 2001 From: Victor Berger Date: Fri, 8 Sep 2017 17:25:36 +0200 Subject: [PATCH] Update example to have weston-terminal not crashing --- examples/simple.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/examples/simple.rs b/examples/simple.rs index b3dd58a..2a48d6b 100644 --- a/examples/simple.rs +++ b/examples/simple.rs @@ -29,8 +29,8 @@ use smithay::shm::{ShmGlobal, ShmToken}; use wayland_protocols::unstable::xdg_shell::server::{zxdg_shell_v6, zxdg_toplevel_v6}; use wayland_server::{Client, EventLoopHandle}; -use wayland_server::protocol::{wl_compositor, wl_output, wl_seat, wl_shell, wl_shm, wl_subcompositor, - wl_surface}; +use wayland_server::protocol::{wl_callback, wl_compositor, wl_output, wl_seat, wl_shell, wl_shm, + wl_subcompositor, wl_surface}; define_roles!(Roles => [ ShellSurface, ShellSurfaceRole ] ); @@ -68,6 +68,7 @@ impl compositor::Handler for SurfaceHandler { Some((new_vec, (data.width as u32, data.height as u32))); }) .unwrap(); + buffer.release(); } Some(None) => { // erase the contents @@ -77,6 +78,11 @@ impl compositor::Handler for SurfaceHandler { } }); } + + fn frame(&mut self, _evlh: &mut EventLoopHandle, _client: &Client, surface: &wl_surface::WlSurface, + callback: wl_callback::WlCallback, _token: CompositorToken) { + callback.done(0); + } } struct ShellSurfaceHandler {