Upgrade wayland-server to 0.12

This commit is contained in:
Victor Berger 2017-10-31 11:28:41 +01:00 committed by Victor Berger
parent 291ba17a5c
commit c31d966fd4
8 changed files with 29 additions and 24 deletions

View File

@ -7,7 +7,7 @@ description = "Smithay is a library for writing wayland compositors."
repository = "https://github.com/Smithay/smithay" repository = "https://github.com/Smithay/smithay"
[dependencies] [dependencies]
wayland-server = "0.10.2" wayland-server = "0.12.0"
nix = "0.9.0" nix = "0.9.0"
xkbcommon = "0.2.1" xkbcommon = "0.2.1"
tempfile = "2.1.5" tempfile = "2.1.5"
@ -21,7 +21,7 @@ gbm = { version = "^0.2.2", optional = true }
glium = { version = "0.17.1", optional = true, default-features = false } glium = { version = "0.17.1", optional = true, default-features = false }
input = { version = "0.2.0", optional = true } input = { version = "0.2.0", optional = true }
rental = "0.4.11" rental = "0.4.11"
wayland-protocols = { version = "0.10.2", features = ["unstable_protocols", "server"] } wayland-protocols = { version = "0.12.0", features = ["unstable_protocols", "server"] }
image = "0.16.0" image = "0.16.0"
error-chain = "0.11.0" error-chain = "0.11.0"

View File

@ -15,8 +15,8 @@ use glium::Surface;
use helpers::{init_shell, GliumDrawer, MyWindowMap}; use helpers::{init_shell, GliumDrawer, MyWindowMap};
use slog::{Drain, Logger}; use slog::{Drain, Logger};
use smithay::backend::graphics::egl::EGLGraphicsBackend; use smithay::backend::graphics::egl::EGLGraphicsBackend;
use smithay::backend::input::{self, Event, InputBackend, InputHandler, KeyboardKeyEvent, PointerButtonEvent, use smithay::backend::input::{self, Event, InputBackend, InputHandler, KeyboardKeyEvent, PointerAxisEvent,
PointerMotionAbsoluteEvent, PointerAxisEvent}; PointerButtonEvent, PointerMotionAbsoluteEvent};
use smithay::backend::winit; use smithay::backend::winit;
use smithay::wayland::compositor::{SubsurfaceRole, TraversalAction}; use smithay::wayland::compositor::{SubsurfaceRole, TraversalAction};
use smithay::wayland::compositor::roles::Role; use smithay::wayland::compositor::roles::Role;

View File

@ -197,7 +197,7 @@ use std::os::unix::io::{AsRawFd, RawFd};
use std::rc::Rc; use std::rc::Rc;
use std::time::Duration; use std::time::Duration;
use wayland_server::{EventLoopHandle, StateToken}; use wayland_server::{EventLoopHandle, StateToken};
use wayland_server::sources::{FdEventSource, FdEventSourceImpl, READ}; use wayland_server::sources::{FdEventSource, FdEventSourceImpl, FdInterest};
mod backend; mod backend;
pub mod error; pub mod error;
@ -484,7 +484,7 @@ where
device.as_raw_fd(), device.as_raw_fd(),
fd_event_source_implementation(), fd_event_source_implementation(),
(device, handler), (device, handler),
READ, FdInterest::READ,
) )
} }

View File

@ -160,10 +160,10 @@ impl Output {
for &mode in &self.modes { for &mode in &self.modes {
let mut flags = wl_output::Mode::empty(); let mut flags = wl_output::Mode::empty();
if Some(mode) == self.current_mode { if Some(mode) == self.current_mode {
flags |= wl_output::Current; flags |= wl_output::Mode::Current;
} }
if Some(mode) == self.preferred_mode { if Some(mode) == self.preferred_mode {
flags |= wl_output::Preferred; flags |= wl_output::Mode::Preferred;
} }
output.mode(flags, mode.width, mode.height, mode.refresh); output.mode(flags, mode.width, mode.height, mode.refresh);
} }
@ -243,9 +243,9 @@ impl Output {
if let Some(scale) = new_scale { if let Some(scale) = new_scale {
self.scale = scale; self.scale = scale;
} }
let mut flags = wl_output::Current; let mut flags = wl_output::Mode::Current;
if self.preferred_mode == new_mode { if self.preferred_mode == new_mode {
flags |= wl_output::Preferred; flags |= wl_output::Mode::Preferred;
} }
for output in &self.instances { for output in &self.instances {
if let Some(mode) = new_mode { if let Some(mode) = new_mode {

View File

@ -220,10 +220,10 @@ impl Seat {
fn compute_caps(&self) -> wl_seat::Capability { fn compute_caps(&self) -> wl_seat::Capability {
let mut caps = wl_seat::Capability::empty(); let mut caps = wl_seat::Capability::empty();
if self.pointer.is_some() { if self.pointer.is_some() {
caps |= wl_seat::Pointer; caps |= wl_seat::Capability::Pointer;
} }
if self.keyboard.is_some() { if self.keyboard.is_some() {
caps |= wl_seat::Keyboard; caps |= wl_seat::Capability::Keyboard;
} }
caps caps
} }

View File

@ -33,10 +33,10 @@
//! use smithay::wayland::compositor::CompositorToken; //! use smithay::wayland::compositor::CompositorToken;
//! use smithay::wayland::shell::{shell_init, ShellSurfaceRole, ShellSurfaceUserImplementation}; //! use smithay::wayland::shell::{shell_init, ShellSurfaceRole, ShellSurfaceUserImplementation};
//! use wayland_server::protocol::wl_shell::WlShell; //! use wayland_server::protocol::wl_shell::WlShell;
//! use wayland_protocols::unstable::xdg_shell::server::zxdg_shell_v6::ZxdgShellV6; //! use wayland_protocols::unstable::xdg_shell::v6::server::zxdg_shell_v6::ZxdgShellV6;
//! use wayland_server::{EventLoop, EventLoopHandle}; //! use wayland_server::{EventLoop, EventLoopHandle};
//! # use wayland_server::protocol::{wl_seat, wl_output}; //! # use wayland_server::protocol::{wl_seat, wl_output};
//! # use wayland_protocols::unstable::xdg_shell::server::zxdg_toplevel_v6; //! # use wayland_protocols::unstable::xdg_shell::v6::server::zxdg_toplevel_v6;
//! # #[derive(Default)] struct MySurfaceData; //! # #[derive(Default)] struct MySurfaceData;
//! //!
//! // define the roles type. You need to integrate the ShellSurface role: //! // define the roles type. You need to integrate the ShellSurface role:
@ -110,8 +110,9 @@ use std::rc::Rc;
use utils::Rectangle; use utils::Rectangle;
use wayland::compositor::CompositorToken; use wayland::compositor::CompositorToken;
use wayland::compositor::roles::Role; use wayland::compositor::roles::Role;
use wayland_protocols::unstable::xdg_shell::server::{zxdg_popup_v6, zxdg_positioner_v6 as xdg_positioner, use wayland_protocols::unstable::xdg_shell::v6::server::{zxdg_popup_v6,
zxdg_shell_v6, zxdg_surface_v6, zxdg_toplevel_v6}; zxdg_positioner_v6 as xdg_positioner,
zxdg_shell_v6, zxdg_surface_v6, zxdg_toplevel_v6};
use wayland_server::{EventLoop, EventLoopHandle, EventResult, Global, Liveness, Resource, StateToken}; use wayland_server::{EventLoop, EventLoopHandle, EventResult, Global, Liveness, Resource, StateToken};
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};

View File

@ -5,7 +5,8 @@ use std::sync::Mutex;
use utils::Rectangle; use utils::Rectangle;
use wayland::compositor::CompositorToken; use wayland::compositor::CompositorToken;
use wayland::compositor::roles::*; use wayland::compositor::roles::*;
use wayland_protocols::unstable::xdg_shell::server::{zxdg_positioner_v6 as xdg_positioner, zxdg_toplevel_v6}; use wayland_protocols::unstable::xdg_shell::v6::server::{zxdg_positioner_v6 as xdg_positioner,
zxdg_toplevel_v6};
use wayland_server::{Client, EventLoopHandle, Resource}; use wayland_server::{Client, EventLoopHandle, Resource};
use wayland_server::protocol::{wl_output, wl_shell, wl_shell_surface, wl_surface}; use wayland_server::protocol::{wl_output, wl_shell, wl_shell_surface, wl_surface};
@ -177,7 +178,7 @@ fn wl_handle_display_state_change<U, R, CID, SID, SD>(evlh: &mut EventLoopHandle
); );
// 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));
shell_surface.configure(wl_shell_surface::None, w, h); shell_surface.configure(wl_shell_surface::Resize::None, w, h);
} }
fn wl_set_parent<U, R, CID, SID, SD>(idata: &ShellSurfaceIData<U, R, CID, SID, SD>, fn wl_set_parent<U, R, CID, SID, SD>(idata: &ShellSurfaceIData<U, R, CID, SID, SD>,

View File

@ -5,8 +5,8 @@ use std::sync::Mutex;
use utils::Rectangle; use utils::Rectangle;
use wayland::compositor::CompositorToken; use wayland::compositor::CompositorToken;
use wayland::compositor::roles::*; use wayland::compositor::roles::*;
use wayland_protocols::unstable::xdg_shell::server::{zxdg_popup_v6, zxdg_positioner_v6, zxdg_shell_v6, use wayland_protocols::unstable::xdg_shell::v6::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, EventLoopHandle, Resource}; use wayland_server::{Client, EventLoopHandle, Resource};
use wayland_server::protocol::{wl_output, wl_surface}; use wayland_server::protocol::{wl_output, wl_surface};
@ -177,8 +177,9 @@ fn positioner_implementation() -> zxdg_positioner_v6::Implementation<()> {
}; };
}, },
set_anchor: |_, _, _, positioner, anchor| { set_anchor: |_, _, _, positioner, anchor| {
use self::zxdg_positioner_v6::{AnchorBottom, AnchorLeft, AnchorRight, AnchorTop}; use self::zxdg_positioner_v6::Anchor;
if anchor.contains(AnchorLeft | AnchorRight) || anchor.contains(AnchorTop | AnchorBottom) { if anchor.contains(Anchor::Left | Anchor::Right) || anchor.contains(Anchor::Top | Anchor::Bottom)
{
positioner.post_error( positioner.post_error(
zxdg_positioner_v6::Error::InvalidInput as u32, zxdg_positioner_v6::Error::InvalidInput as u32,
"Invalid anchor for positioner.".into(), "Invalid anchor for positioner.".into(),
@ -190,8 +191,10 @@ fn positioner_implementation() -> zxdg_positioner_v6::Implementation<()> {
} }
}, },
set_gravity: |_, _, _, positioner, gravity| { set_gravity: |_, _, _, positioner, gravity| {
use self::zxdg_positioner_v6::{GravityBottom, GravityLeft, GravityRight, GravityTop}; use self::zxdg_positioner_v6::Gravity;
if gravity.contains(GravityLeft | GravityRight) || gravity.contains(GravityTop | GravityBottom) { if gravity.contains(Gravity::Left | Gravity::Right)
|| gravity.contains(Gravity::Top | Gravity::Bottom)
{
positioner.post_error( positioner.post_error(
zxdg_positioner_v6::Error::InvalidInput as u32, zxdg_positioner_v6::Error::InvalidInput as u32,
"Invalid gravity for positioner.".into(), "Invalid gravity for positioner.".into(),