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"
[dependencies]
wayland-server = "0.10.2"
wayland-server = "0.12.0"
nix = "0.9.0"
xkbcommon = "0.2.1"
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 }
input = { version = "0.2.0", optional = true }
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"
error-chain = "0.11.0"

View file

@ -15,8 +15,8 @@ use glium::Surface;
use helpers::{init_shell, GliumDrawer, MyWindowMap};
use slog::{Drain, Logger};
use smithay::backend::graphics::egl::EGLGraphicsBackend;
use smithay::backend::input::{self, Event, InputBackend, InputHandler, KeyboardKeyEvent, PointerButtonEvent,
PointerMotionAbsoluteEvent, PointerAxisEvent};
use smithay::backend::input::{self, Event, InputBackend, InputHandler, KeyboardKeyEvent, PointerAxisEvent,
PointerButtonEvent, PointerMotionAbsoluteEvent};
use smithay::backend::winit;
use smithay::wayland::compositor::{SubsurfaceRole, TraversalAction};
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::time::Duration;
use wayland_server::{EventLoopHandle, StateToken};
use wayland_server::sources::{FdEventSource, FdEventSourceImpl, READ};
use wayland_server::sources::{FdEventSource, FdEventSourceImpl, FdInterest};
mod backend;
pub mod error;
@ -484,7 +484,7 @@ where
device.as_raw_fd(),
fd_event_source_implementation(),
(device, handler),
READ,
FdInterest::READ,
)
}

View file

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

View file

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

View file

@ -33,10 +33,10 @@
//! use smithay::wayland::compositor::CompositorToken;
//! use smithay::wayland::shell::{shell_init, ShellSurfaceRole, ShellSurfaceUserImplementation};
//! 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::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;
//!
//! // define the roles type. You need to integrate the ShellSurface role:
@ -110,8 +110,9 @@ use std::rc::Rc;
use utils::Rectangle;
use wayland::compositor::CompositorToken;
use wayland::compositor::roles::Role;
use wayland_protocols::unstable::xdg_shell::server::{zxdg_popup_v6, zxdg_positioner_v6 as xdg_positioner,
zxdg_shell_v6, zxdg_surface_v6, zxdg_toplevel_v6};
use wayland_protocols::unstable::xdg_shell::v6::server::{zxdg_popup_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::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 wayland::compositor::CompositorToken;
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::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
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>,

View file

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