Skip to content
This repository was archived by the owner on Aug 3, 2024. It is now read-only.

Update dependencies (wlroots, bindgen, ...) #300

Open
wants to merge 24 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
251d8e4
Pulled down update to wlroot submodule
gynther-k Apr 9, 2020
505f3d4
Update bindgen to version 0.53.*
gynther-k Apr 9, 2020
095016e
Change deprecated item bindgen and remove protocols that do not exist…
gynther-k Apr 9, 2020
f5ef83b
Include the "wlr/types/*"-header files available in the current state…
perfah Apr 15, 2020
5a7d87c
Fix error likely occurring as a result of compiling in a newer Rust v…
perfah Apr 15, 2020
74fd086
Update wayland-rs dependencies to version 0.25.*
perfah Apr 16, 2020
ee7fc61
Fix unused return value in wlroots-sys build script
perfah Apr 23, 2020
ef9aa82
Fix for static compilation not working
perfah May 18, 2020
c0d5aeb
Explictly set bindgen parameters after default values have been changed
perfah May 19, 2020
c8b901e
Expose content in root namespace since generated constructs have been…
perfah May 19, 2020
8324f9f
Refactor to accommodate wlroots PR #1915
perfah May 19, 2020
9b11dcf
Remove 'screenshooter' protocol in order to accommodate removal in wl…
perfah May 19, 2020
9bd0f60
Fix for protocols not being exposed in wlroots-sys
perfah May 19, 2020
4f9f72c
Refactor to accommodate breaking changes in wlroots update 0.60
perfah May 19, 2020
d383b15
Remove function types::output::mode::flags() in alignment with wlroot…
perfah May 19, 2020
768f3cf
Refactor to accommodate wlroots PR #1797
perfah May 19, 2020
f70220f
Refactor to accommodate wlroots PR #1590
perfah May 19, 2020
1e6a59d
Fix for invalid import in static mode
perfah May 19, 2020
aca9065
Add rerun-if-changed instruction to build script so that cargo won't …
perfah Apr 18, 2020
d99c488
Fix for wlroots-sys not rebuilding a bindgen build
perfah May 20, 2020
a62d1c2
Fix deprecation warnings
perfah May 20, 2020
8b93a4f
Create /include/wlr/config.h regardless of static mode
perfah May 20, 2020
d45010c
Fix deprecation warnings in wlroots-rs examples
perfah May 20, 2020
14851d6
Add missing import 'wlroots::wlroots_sys::TransformOutput' in xdg_she…
perfah May 20, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/pointer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ impl output::Handler for ExOutput {
fn pointer_added(
compositor_handle: compositor::Handle,
pointer_handle: pointer::Handle
) -> Option<Box<pointer::Handler>> {
) -> Option<Box<dyn pointer::Handler>> {
with_handles!([(compositor: {compositor_handle}), (pointer: {pointer_handle})] => {
let compositor_state: &mut CompositorState = compositor.downcast();
compositor_state.cursor_handle
Expand All @@ -199,7 +199,7 @@ fn pointer_added(
fn keyboard_added(
_compositor_handle: compositor::Handle,
_keyboard_handle: keyboard::Handle
) -> Option<Box<keyboard::Handler>> {
) -> Option<Box<dyn keyboard::Handler>> {
Some(Box::new(ExKeyboardHandler))
}

Expand Down
2 changes: 1 addition & 1 deletion examples/rotation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ impl output::Handler for ExOutput {
fn keyboard_added(
_compositor_handle: compositor::Handle,
_keyboard_handle: keyboard::Handle
) -> Option<Box<keyboard::Handler>> {
) -> Option<Box<dyn keyboard::Handler>> {
Some(Box::new(KeyboardManager))
}

Expand Down
6 changes: 3 additions & 3 deletions examples/tablet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ struct OutputEx;
struct KeyboardEx;
struct TabletEx;

fn keyboard_added(_: compositor::Handle, _: keyboard::Handle) -> Option<Box<keyboard::Handler>> {
fn keyboard_added(_: compositor::Handle, _: keyboard::Handle) -> Option<Box<dyn keyboard::Handler>> {
Some(Box::new(KeyboardEx))
}

fn tablet_tool_added(
compositor: compositor::Handle,
tool: tablet_tool::Handle
) -> Option<Box<tablet_tool::Handler>> {
) -> Option<Box<dyn tablet_tool::Handler>> {
with_handles!([(compositor: {compositor}), (tool: {tool})] => {
let state: &mut State = compositor.downcast();
state.size_mm = tool.input_device().size();
Expand All @@ -70,7 +70,7 @@ fn tablet_tool_added(
Some(Box::new(TabletEx))
}

fn tablet_pad_added(_: compositor::Handle, _: tablet_pad::Handle) -> Option<Box<tablet_pad::Handler>> {
fn tablet_pad_added(_: compositor::Handle, _: tablet_pad::Handle) -> Option<Box<dyn tablet_pad::Handler>> {
Some(Box::new(TabletEx))
}

Expand Down
4 changes: 2 additions & 2 deletions examples/touch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,11 @@ impl touch::Handler for TouchHandlerEx {
}
}

fn touch_added(_: compositor::Handle, _: touch::Handle) -> Option<Box<touch::Handler>> {
fn touch_added(_: compositor::Handle, _: touch::Handle) -> Option<Box<dyn touch::Handler>> {
Some(Box::new(TouchHandlerEx))
}

fn keyboard_added(_: compositor::Handle, _: keyboard::Handle) -> Option<Box<keyboard::Handler>> {
fn keyboard_added(_: compositor::Handle, _: keyboard::Handle) -> Option<Box<dyn keyboard::Handler>> {
Some(Box::new(ExKeyboardHandler))
}

Expand Down
5 changes: 3 additions & 2 deletions examples/xdg_shell_v6_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ use wlroots::{
surface,
utils::{current_time, log::Logger, Handleable}
};
use wlroots::wlroots_sys::TransformOutput;

struct State {
xcursor_manager: xcursor::Manager,
Expand Down Expand Up @@ -284,15 +285,15 @@ impl output::Handler for ExOutput {
}
}

fn pointer_added(_: compositor::Handle, _: pointer::Handle) -> Option<Box<pointer::Handler>> {
fn pointer_added(_: compositor::Handle, _: pointer::Handle) -> Option<Box<dyn pointer::Handler>> {
Some(Box::new(ExPointer))
}

#[wlroots_dehandle]
fn keyboard_added(
compositor: compositor::Handle,
keyboard: keyboard::Handle
) -> Option<Box<keyboard::Handler>> {
) -> Option<Box<dyn keyboard::Handler>> {
{
#[dehandle]
let compositor = compositor;
Expand Down
27 changes: 5 additions & 22 deletions src/compositor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ use std::{
use crate::libc;
use crate::wayland_sys::server::{signal::wl_signal_add, wl_display, wl_event_loop, WAYLAND_SERVER_HANDLE};
use wlroots_sys::{
wlr_backend_destroy, wlr_backend_start, wlr_compositor, wlr_compositor_create, wlr_compositor_destroy,
wlr_backend_destroy, wlr_backend_start, wlr_compositor, wlr_compositor_create,
wlr_xdg_shell, wlr_xdg_shell_create, wlr_xdg_shell_v6, wlr_xdg_shell_v6_create
};

use crate::{
backend::{self, Backend, Session, UnsafeRenderSetupFunction},
data_device,
extensions::{
gamma_control, gtk_primary_selection, idle, idle_inhibit, input_inhibit, screencopy, screenshooter,
gamma_control, gtk_primary_selection, idle, idle_inhibit, input_inhibit, screencopy,
server_decoration
},
input, output,
Expand Down Expand Up @@ -93,7 +93,7 @@ pub struct Handle {
#[allow(dead_code)]
pub struct Compositor {
/// User data.
pub data: Box<Any>,
pub data: Box<dyn Any>,
/// Internal compositor handler
compositor_handler: Option<&'static mut InternalCompositor>,
/// Manager for the inputs.
Expand Down Expand Up @@ -137,16 +137,14 @@ pub struct Compositor {
pub gtk_primary_selection_manager: Option<gtk_primary_selection::Manager>,
/// Optional screencopy manager extension
pub screencopy_manager: Option<screencopy::ZManagerV1>,
/// Optional screenshooter manager extension
pub screenshooter: Option<screenshooter::Screenshooter>,
/// The renderer used to draw things to the screen.
pub renderer: Option<GenericRenderer>,
/// XWayland server, only Some if it is enabled
pub xwayland: Option<xwayland::Server>,
/// The DnD manager
data_device_manager: Option<data_device::Manager>,
/// The error from the panic, if there was one.
panic_error: Option<Box<Any + Send>>,
panic_error: Option<Box<dyn Any + Send>>,
/// Custom function to run at shutdown (or when a panic occurs).
user_terminate: Option<fn()>,
/// Lock used to borrow the compositor globally.
Expand All @@ -172,7 +170,6 @@ pub struct Builder {
input_inhibit_manager: bool,
gtk_primary_selection_manager: bool,
screencopy_manager: bool,
screenshooter: bool,
wayland_remote: Option<String>,
x11_display: Option<String>,
data_device_manager: bool,
Expand Down Expand Up @@ -309,13 +306,6 @@ impl Builder {
self
}

/// Decide whether or not to enable the screenshooter protocol
/// extension.
pub fn screenshooter(mut self, screenshooter: bool) -> Self {
self.screenshooter = screenshooter;
self
}

/// Set callbacks for managing XDG shell v6 resources.
///
/// If this function is not called then the xwayland server does not run.
Expand Down Expand Up @@ -518,11 +508,6 @@ impl Builder {
} else {
None
};
let screenshooter = if self.screenshooter {
screenshooter::Screenshooter::new(display)
} else {
None
};
let data_device_manager = if self.data_device_manager {
data_device::Manager::new(display as _)
} else {
Expand Down Expand Up @@ -634,7 +619,6 @@ impl Builder {
input_inhibit_manager,
gtk_primary_selection_manager,
screencopy_manager,
screenshooter,
renderer,
xwayland,
user_terminate,
Expand Down Expand Up @@ -752,7 +736,7 @@ impl Compositor {

/// Saves the panic error information in the compositor, to be re-thrown
/// later when we are out of the C callback stack.
pub(crate) fn save_panic_error(&mut self, error: Box<Any + Send>) {
pub(crate) fn save_panic_error(&mut self, error: Box<dyn Any + Send>) {
self.panic_error = Some(error);
}

Expand All @@ -775,7 +759,6 @@ impl Drop for Compositor {
"Builder was in improper state"
);
ffi_dispatch!(WAYLAND_SERVER_HANDLE, wl_display_destroy_clients, self.display);
wlr_compositor_destroy(self.compositor)
}
}
}
Expand Down
5 changes: 2 additions & 3 deletions src/events/xwayland_events.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use crate::libc::{int16_t, uint16_t};
use wlroots_sys::{wlr_xwayland_move_event, wlr_xwayland_resize_event, wlr_xwayland_surface_configure_event};

use crate::{utils::edges::Edges, xwayland};
Expand Down Expand Up @@ -37,14 +36,14 @@ impl Configure {
/// Get the coordinates for where the XWayland surface wants to be.
///
/// Return format is (x, y).
pub fn coords(&self) -> (int16_t, int16_t) {
pub fn coords(&self) -> (i16, i16) {
unsafe { ((*self.event).x, (*self.event).y) }
}

/// Get the dimensions the XWayland surface wants to have.
///
/// Return format is (width, height).
pub fn dimensions(&self) -> (uint16_t, uint16_t) {
pub fn dimensions(&self) -> (u16, u16) {
unsafe { ((*self.event).width, (*self.event).height) }
}
}
Expand Down
9 changes: 1 addition & 8 deletions src/extensions/gamma_control.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@

use crate::wayland_sys::server::wl_display as wl_server_display;
use wlroots_sys::{
wl_display, wlr_gamma_control_manager_v1, wlr_gamma_control_manager_v1_create,
wlr_gamma_control_manager_v1_destroy
wl_display, wlr_gamma_control_manager_v1, wlr_gamma_control_manager_v1_create
};

#[derive(Debug)]
Expand All @@ -26,9 +25,3 @@ impl ZManagerV1 {
}
}
}

impl Drop for ZManagerV1 {
fn drop(&mut self) {
unsafe { wlr_gamma_control_manager_v1_destroy(self.manager) }
}
}
9 changes: 1 addition & 8 deletions src/extensions/gtk_primary_selection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

use crate::wayland_sys::server::wl_display as wl_server_display;
use wlroots_sys::{
wl_display, wlr_gtk_primary_selection_device_manager, wlr_gtk_primary_selection_device_manager_create,
wlr_gtk_primary_selection_device_manager_destroy
wl_display, wlr_gtk_primary_selection_device_manager, wlr_gtk_primary_selection_device_manager_create
};

#[derive(Debug)]
Expand All @@ -23,9 +22,3 @@ impl Manager {
}
}
}

impl Drop for Manager {
fn drop(&mut self) {
unsafe { wlr_gtk_primary_selection_device_manager_destroy(self.manager) }
}
}
8 changes: 1 addition & 7 deletions src/extensions/idle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::seat::Seat;

use crate::wayland_sys::server::wl_display as wl_server_display;
use wlroots_sys::{
wl_display, wlr_idle, wlr_idle_create, wlr_idle_destroy, wlr_idle_notify_activity, wlr_idle_set_enabled
wl_display, wlr_idle, wlr_idle_create, wlr_idle_notify_activity, wlr_idle_set_enabled
};

#[derive(Debug)]
Expand Down Expand Up @@ -33,9 +33,3 @@ impl Manager {
unsafe { wlr_idle_set_enabled(self.manager, seat.as_ptr(), enabled) }
}
}

impl Drop for Manager {
fn drop(&mut self) {
unsafe { wlr_idle_destroy(self.manager) }
}
}
8 changes: 1 addition & 7 deletions src/extensions/idle_inhibit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use crate::wayland_sys::server::wl_display as wl_server_display;
use wlroots_sys::{
wl_display, wlr_idle_inhibit_manager_v1, wlr_idle_inhibit_v1_create, wlr_idle_inhibit_v1_destroy
wl_display, wlr_idle_inhibit_manager_v1, wlr_idle_inhibit_v1_create
};

#[derive(Debug)]
Expand All @@ -23,9 +23,3 @@ impl ZManagerV1 {
}
}
}

impl Drop for ZManagerV1 {
fn drop(&mut self) {
unsafe { wlr_idle_inhibit_v1_destroy(self.manager) }
}
}
8 changes: 1 addition & 7 deletions src/extensions/input_inhibit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use crate::wayland_sys::server::wl_display as wl_server_display;
use wlroots_sys::{
wl_display, wlr_input_inhibit_manager, wlr_input_inhibit_manager_create, wlr_input_inhibit_manager_destroy
wl_display, wlr_input_inhibit_manager, wlr_input_inhibit_manager_create
};

#[derive(Debug)]
Expand All @@ -23,9 +23,3 @@ impl ZManagerV1 {
}
}
}

impl Drop for ZManagerV1 {
fn drop(&mut self) {
unsafe { wlr_input_inhibit_manager_destroy(self.manager) }
}
}
1 change: 0 additions & 1 deletion src/extensions/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@ pub mod idle;
pub mod idle_inhibit;
pub mod input_inhibit;
pub mod screencopy;
pub mod screenshooter;
pub mod server_decoration;
9 changes: 1 addition & 8 deletions src/extensions/screencopy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@

use crate::wayland_sys::server::wl_display as wl_server_display;
use wlroots_sys::{
wl_display, wlr_screencopy_manager_v1, wlr_screencopy_manager_v1_create,
wlr_screencopy_manager_v1_destroy
wl_display, wlr_screencopy_manager_v1, wlr_screencopy_manager_v1_create
};

#[derive(Debug)]
Expand All @@ -26,9 +25,3 @@ impl ZManagerV1 {
}
}
}

impl Drop for ZManagerV1 {
fn drop(&mut self) {
unsafe { wlr_screencopy_manager_v1_destroy(self.manager) }
}
}
29 changes: 0 additions & 29 deletions src/extensions/screenshooter.rs

This file was deleted.

9 changes: 2 additions & 7 deletions src/extensions/server_decoration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

use crate::wayland_sys::server::wl_display as wl_server_display;
pub use wlroots_sys::protocols::server_decoration::server::org_kde_kwin_server_decoration_manager::Mode;

use wlroots_sys::{
wl_display, wlr_server_decoration_manager, wlr_server_decoration_manager_create,
wlr_server_decoration_manager_destroy, wlr_server_decoration_manager_set_default_mode
wlr_server_decoration_manager_set_default_mode
};

#[derive(Debug)]
Expand All @@ -31,9 +32,3 @@ impl Manager {
unsafe { wlr_server_decoration_manager_set_default_mode(self.manager, mode.to_raw()) }
}
}

impl Drop for Manager {
fn drop(&mut self) {
unsafe { wlr_server_decoration_manager_destroy(self.manager) }
}
}
Loading