Merge pull request #191 from mahkoh/jorth/new-fixes
Fix some issues with rust 1.78
This commit is contained in:
commit
4d33dbf32f
37 changed files with 29 additions and 155 deletions
|
|
@ -723,6 +723,10 @@ fn write_request_handler<W: Write>(
|
||||||
messages: &ParseResult,
|
messages: &ParseResult,
|
||||||
) -> Result<()> {
|
) -> Result<()> {
|
||||||
writeln!(f)?;
|
writeln!(f)?;
|
||||||
|
// TODO: remove this after https://github.com/mahkoh/jay/pull/190
|
||||||
|
if camel_obj_name == "ZwpTabletToolV2" {
|
||||||
|
writeln!(f, " #[allow(dead_code)]")?;
|
||||||
|
}
|
||||||
writeln!(
|
writeln!(
|
||||||
f,
|
f,
|
||||||
" pub trait {camel_obj_name}RequestHandler: crate::object::Object + Sized {{"
|
" pub trait {camel_obj_name}RequestHandler: crate::object::Object + Sized {{"
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@ linear_ids!(DrmDeviceIds, DrmDeviceId);
|
||||||
|
|
||||||
pub trait Backend {
|
pub trait Backend {
|
||||||
fn run(self: Rc<Self>) -> SpawnedFuture<Result<(), Box<dyn Error>>>;
|
fn run(self: Rc<Self>) -> SpawnedFuture<Result<(), Box<dyn Error>>>;
|
||||||
|
#[cfg_attr(not(feature = "it"), allow(dead_code))]
|
||||||
fn into_any(self: Rc<Self>) -> Rc<dyn Any>;
|
fn into_any(self: Rc<Self>) -> Rc<dyn Any>;
|
||||||
|
|
||||||
fn switch_to(&self, vtnr: u32) {
|
fn switch_to(&self, vtnr: u32) {
|
||||||
|
|
|
||||||
|
|
@ -1473,10 +1473,10 @@ fn create_connector_display_data(
|
||||||
for descriptor in edid.base_block.descriptors.iter().flatten() {
|
for descriptor in edid.base_block.descriptors.iter().flatten() {
|
||||||
match descriptor {
|
match descriptor {
|
||||||
Descriptor::DisplayProductSerialNumber(s) => {
|
Descriptor::DisplayProductSerialNumber(s) => {
|
||||||
serial_number = s.clone();
|
serial_number.clone_from(s);
|
||||||
}
|
}
|
||||||
Descriptor::DisplayProductName(s) => {
|
Descriptor::DisplayProductName(s) => {
|
||||||
name = s.clone();
|
name.clone_from(s);
|
||||||
}
|
}
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -222,8 +222,6 @@ pub enum ResetStatus {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub trait GfxFramebuffer: Debug {
|
pub trait GfxFramebuffer: Debug {
|
||||||
fn as_any(&self) -> &dyn Any;
|
|
||||||
|
|
||||||
fn take_render_ops(&self) -> Vec<GfxApiOpt>;
|
fn take_render_ops(&self) -> Vec<GfxApiOpt>;
|
||||||
|
|
||||||
fn physical_size(&self) -> (i32, i32);
|
fn physical_size(&self) -> (i32, i32);
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,6 @@ use {
|
||||||
theme::Color,
|
theme::Color,
|
||||||
},
|
},
|
||||||
std::{
|
std::{
|
||||||
any::Any,
|
|
||||||
cell::Cell,
|
cell::Cell,
|
||||||
fmt::{Debug, Formatter},
|
fmt::{Debug, Formatter},
|
||||||
mem,
|
mem,
|
||||||
|
|
@ -100,10 +99,6 @@ impl Framebuffer {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl GfxFramebuffer for Framebuffer {
|
impl GfxFramebuffer for Framebuffer {
|
||||||
fn as_any(&self) -> &dyn Any {
|
|
||||||
self
|
|
||||||
}
|
|
||||||
|
|
||||||
fn take_render_ops(&self) -> Vec<GfxApiOpt> {
|
fn take_render_ops(&self) -> Vec<GfxApiOpt> {
|
||||||
mem::take(&mut *self.ctx.gfx_ops.borrow_mut())
|
mem::take(&mut *self.ctx.gfx_ops.borrow_mut())
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ use {
|
||||||
ash::{
|
ash::{
|
||||||
extensions::khr::{ExternalFenceFd, ExternalMemoryFd, ExternalSemaphoreFd, PushDescriptor},
|
extensions::khr::{ExternalFenceFd, ExternalMemoryFd, ExternalSemaphoreFd, PushDescriptor},
|
||||||
vk::{
|
vk::{
|
||||||
DeviceCreateInfo, DeviceMemory, DeviceQueueCreateInfo, ExtExternalMemoryDmaBufFn,
|
DeviceCreateInfo, DeviceQueueCreateInfo, ExtExternalMemoryDmaBufFn,
|
||||||
ExtImageDrmFormatModifierFn, ExtPhysicalDeviceDrmFn, ExtQueueFamilyForeignFn,
|
ExtImageDrmFormatModifierFn, ExtPhysicalDeviceDrmFn, ExtQueueFamilyForeignFn,
|
||||||
ExternalSemaphoreFeatureFlags, ExternalSemaphoreHandleTypeFlags,
|
ExternalSemaphoreFeatureFlags, ExternalSemaphoreHandleTypeFlags,
|
||||||
ExternalSemaphoreProperties, KhrDriverPropertiesFn, KhrExternalFenceFdFn,
|
ExternalSemaphoreProperties, KhrDriverPropertiesFn, KhrExternalFenceFdFn,
|
||||||
|
|
@ -84,16 +84,6 @@ impl VulkanDevice {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
struct FreeMem<'a>(&'a Device, DeviceMemory);
|
|
||||||
|
|
||||||
impl<'a> Drop for FreeMem<'a> {
|
|
||||||
fn drop(&mut self) {
|
|
||||||
unsafe {
|
|
||||||
self.0.free_memory(self.1, None);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl VulkanInstance {
|
impl VulkanInstance {
|
||||||
fn get_device_extensions(&self, phy_dev: PhysicalDevice) -> Result<Extensions, VulkanError> {
|
fn get_device_extensions(&self, phy_dev: PhysicalDevice) -> Result<Extensions, VulkanError> {
|
||||||
unsafe {
|
unsafe {
|
||||||
|
|
|
||||||
|
|
@ -27,11 +27,6 @@ pub struct VulkanFormat {
|
||||||
pub features: FormatFeatureFlags,
|
pub features: FormatFeatureFlags,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug)]
|
|
||||||
pub struct VulkanFormatFeatures {
|
|
||||||
pub linear_sampling: bool,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct VulkanModifier {
|
pub struct VulkanModifier {
|
||||||
pub modifier: Modifier,
|
pub modifier: Modifier,
|
||||||
|
|
|
||||||
|
|
@ -516,10 +516,6 @@ impl Debug for VulkanImage {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl GfxFramebuffer for VulkanImage {
|
impl GfxFramebuffer for VulkanImage {
|
||||||
fn as_any(&self) -> &dyn Any {
|
|
||||||
self
|
|
||||||
}
|
|
||||||
|
|
||||||
fn take_render_ops(&self) -> Vec<GfxApiOpt> {
|
fn take_render_ops(&self) -> Vec<GfxApiOpt> {
|
||||||
self.render_ops.take()
|
self.render_ops.take()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1023,9 +1023,6 @@ impl Debug for VulkanRenderer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug)]
|
|
||||||
pub struct TmpShmTexture(pub i32, pub i32);
|
|
||||||
|
|
||||||
impl VulkanImage {
|
impl VulkanImage {
|
||||||
fn assert_device(&self, device: &Device) {
|
fn assert_device(&self, device: &Device) {
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
|
|
|
||||||
|
|
@ -116,7 +116,6 @@ pub trait GlobalBase {
|
||||||
pub trait Global: GlobalBase {
|
pub trait Global: GlobalBase {
|
||||||
fn singleton(&self) -> bool;
|
fn singleton(&self) -> bool;
|
||||||
fn version(&self) -> u32;
|
fn version(&self) -> u32;
|
||||||
fn break_loops(&self) {}
|
|
||||||
fn required_caps(&self) -> ClientCaps {
|
fn required_caps(&self) -> ClientCaps {
|
||||||
ClientCaps::none()
|
ClientCaps::none()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -101,7 +101,6 @@ pub trait DynDataOffer: 'static {
|
||||||
fn offer_id(&self) -> DataOfferId;
|
fn offer_id(&self) -> DataOfferId;
|
||||||
fn client_id(&self) -> ClientId;
|
fn client_id(&self) -> ClientId;
|
||||||
fn send_offer(&self, mime_type: &str);
|
fn send_offer(&self, mime_type: &str);
|
||||||
fn destroy(&self);
|
|
||||||
fn cancel(&self);
|
fn cancel(&self);
|
||||||
fn get_seat(&self) -> Rc<WlSeatGlobal>;
|
fn get_seat(&self) -> Rc<WlSeatGlobal>;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -64,10 +64,6 @@ impl DynDataOffer for WlDataOffer {
|
||||||
WlDataOffer::send_offer(self, mime_type);
|
WlDataOffer::send_offer(self, mime_type);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn destroy(&self) {
|
|
||||||
destroy_data_offer::<ClipboardIpc>(self);
|
|
||||||
}
|
|
||||||
|
|
||||||
fn cancel(&self) {
|
fn cancel(&self) {
|
||||||
cancel_offer::<ClipboardIpc>(self);
|
cancel_offer::<ClipboardIpc>(self);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ use {
|
||||||
client::ClientId,
|
client::ClientId,
|
||||||
ifs::{
|
ifs::{
|
||||||
ipc::{
|
ipc::{
|
||||||
cancel_offer, destroy_data_offer,
|
cancel_offer,
|
||||||
x_data_device::{XClipboardIpc, XIpcDevice, XPrimarySelectionIpc},
|
x_data_device::{XClipboardIpc, XIpcDevice, XPrimarySelectionIpc},
|
||||||
DataOffer, DataOfferId, DynDataOffer, IpcLocation, OfferData,
|
DataOffer, DataOfferId, DynDataOffer, IpcLocation, OfferData,
|
||||||
},
|
},
|
||||||
|
|
@ -50,13 +50,6 @@ impl DynDataOffer for XDataOffer {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
fn destroy(&self) {
|
|
||||||
match self.location {
|
|
||||||
IpcLocation::Clipboard => destroy_data_offer::<XClipboardIpc>(self),
|
|
||||||
IpcLocation::PrimarySelection => destroy_data_offer::<XPrimarySelectionIpc>(self),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn cancel(&self) {
|
fn cancel(&self) {
|
||||||
match self.location {
|
match self.location {
|
||||||
IpcLocation::Clipboard => cancel_offer::<XClipboardIpc>(self),
|
IpcLocation::Clipboard => cancel_offer::<XClipboardIpc>(self),
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ use {
|
||||||
client::{Client, ClientError},
|
client::{Client, ClientError},
|
||||||
ifs::{
|
ifs::{
|
||||||
ipc::{
|
ipc::{
|
||||||
destroy_data_device,
|
break_device_loops, destroy_data_device,
|
||||||
zwlr_data_control_device_v1::private::{
|
zwlr_data_control_device_v1::private::{
|
||||||
WlrClipboardIpcCore, WlrIpcImpl, WlrPrimarySelectionIpcCore,
|
WlrClipboardIpcCore, WlrIpcImpl, WlrPrimarySelectionIpcCore,
|
||||||
},
|
},
|
||||||
|
|
@ -282,6 +282,8 @@ object_base! {
|
||||||
|
|
||||||
impl Object for ZwlrDataControlDeviceV1 {
|
impl Object for ZwlrDataControlDeviceV1 {
|
||||||
fn break_loops(&self) {
|
fn break_loops(&self) {
|
||||||
|
break_device_loops::<WlrClipboardIpc>(self);
|
||||||
|
break_device_loops::<WlrPrimarySelectionIpc>(self);
|
||||||
self.seat.remove_wlr_device(self);
|
self.seat.remove_wlr_device(self);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -50,13 +50,6 @@ impl DynDataOffer for ZwlrDataControlOfferV1 {
|
||||||
ZwlrDataControlOfferV1::send_offer(self, mime_type)
|
ZwlrDataControlOfferV1::send_offer(self, mime_type)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn destroy(&self) {
|
|
||||||
match self.location {
|
|
||||||
IpcLocation::Clipboard => destroy_data_offer::<WlrClipboardIpc>(self),
|
|
||||||
IpcLocation::PrimarySelection => destroy_data_offer::<WlrPrimarySelectionIpc>(self),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn cancel(&self) {
|
fn cancel(&self) {
|
||||||
match self.location {
|
match self.location {
|
||||||
IpcLocation::Clipboard => cancel_offer::<WlrClipboardIpc>(self),
|
IpcLocation::Clipboard => cancel_offer::<WlrClipboardIpc>(self),
|
||||||
|
|
|
||||||
|
|
@ -50,10 +50,6 @@ impl DynDataOffer for ZwpPrimarySelectionOfferV1 {
|
||||||
ZwpPrimarySelectionOfferV1::send_offer(self, mime_type);
|
ZwpPrimarySelectionOfferV1::send_offer(self, mime_type);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn destroy(&self) {
|
|
||||||
destroy_data_offer::<PrimarySelectionIpc>(self);
|
|
||||||
}
|
|
||||||
|
|
||||||
fn cancel(&self) {
|
fn cancel(&self) {
|
||||||
cancel_offer::<PrimarySelectionIpc>(self);
|
cancel_offer::<PrimarySelectionIpc>(self);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -241,10 +241,6 @@ impl Global for WlOutputGlobal {
|
||||||
fn version(&self) -> u32 {
|
fn version(&self) -> u32 {
|
||||||
OUTPUT_VERSION
|
OUTPUT_VERSION
|
||||||
}
|
}
|
||||||
|
|
||||||
fn break_loops(&self) {
|
|
||||||
self.bindings.borrow_mut().clear();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dedicated_add_global!(WlOutputGlobal, outputs);
|
dedicated_add_global!(WlOutputGlobal, outputs);
|
||||||
|
|
|
||||||
|
|
@ -1203,12 +1203,6 @@ impl Global for WlSeatGlobal {
|
||||||
fn version(&self) -> u32 {
|
fn version(&self) -> u32 {
|
||||||
9
|
9
|
||||||
}
|
}
|
||||||
|
|
||||||
fn break_loops(&self) {
|
|
||||||
self.bindings.borrow_mut().clear();
|
|
||||||
self.queue_link.take();
|
|
||||||
self.tree_changed_handler.take();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dedicated_add_global!(WlSeatGlobal, seats);
|
dedicated_add_global!(WlSeatGlobal, seats);
|
||||||
|
|
|
||||||
|
|
@ -339,10 +339,6 @@ trait SurfaceExt {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn update_subsurface_parent_extents(&self) {
|
|
||||||
// nothing
|
|
||||||
}
|
|
||||||
|
|
||||||
fn subsurface_parent(&self) -> Option<Rc<WlSurface>> {
|
fn subsurface_parent(&self) -> Option<Rc<WlSurface>> {
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -85,10 +85,6 @@ impl Global for WpDrmLeaseDeviceV1Global {
|
||||||
1
|
1
|
||||||
}
|
}
|
||||||
|
|
||||||
fn break_loops(&self) {
|
|
||||||
self.bindings.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
fn required_caps(&self) -> ClientCaps {
|
fn required_caps(&self) -> ClientCaps {
|
||||||
CAP_DRM_LEASE
|
CAP_DRM_LEASE
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -467,33 +467,9 @@ macro_rules! fatal {
|
||||||
|
|
||||||
macro_rules! stacked_node_impl {
|
macro_rules! stacked_node_impl {
|
||||||
() => {
|
() => {
|
||||||
fn stacked_as_node(&self) -> &dyn Node {
|
|
||||||
self
|
|
||||||
}
|
|
||||||
|
|
||||||
fn stacked_into_node(self: Rc<Self>) -> Rc<dyn Node> {
|
fn stacked_into_node(self: Rc<Self>) -> Rc<dyn Node> {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
fn stacked_into_dyn(self: Rc<Self>) -> Rc<dyn StackedNode> {
|
|
||||||
self
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
macro_rules! containing_node_impl {
|
|
||||||
() => {
|
|
||||||
fn cnode_as_node(&self) -> &dyn Node {
|
|
||||||
self
|
|
||||||
}
|
|
||||||
|
|
||||||
fn cnode_into_node(self: Rc<Self>) -> Rc<dyn Node> {
|
|
||||||
self
|
|
||||||
}
|
|
||||||
|
|
||||||
fn cnode_into_dyn(self: Rc<Self>) -> Rc<dyn ContainingNode> {
|
|
||||||
self
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,7 @@ impl Display for ObjectId {
|
||||||
pub trait ObjectBase {
|
pub trait ObjectBase {
|
||||||
fn id(&self) -> ObjectId;
|
fn id(&self) -> ObjectId;
|
||||||
fn version(&self) -> Version;
|
fn version(&self) -> Version;
|
||||||
|
#[cfg_attr(not(feature = "it"), allow(dead_code))]
|
||||||
fn into_any(self: Rc<Self>) -> Rc<dyn Any>;
|
fn into_any(self: Rc<Self>) -> Rc<dyn Any>;
|
||||||
fn handle_request(
|
fn handle_request(
|
||||||
self: Rc<Self>,
|
self: Rc<Self>,
|
||||||
|
|
|
||||||
|
|
@ -799,10 +799,6 @@ pub struct spa_meta_cursor {
|
||||||
|
|
||||||
unsafe impl Pod for spa_meta_cursor {}
|
unsafe impl Pod for spa_meta_cursor {}
|
||||||
|
|
||||||
#[repr(C)]
|
|
||||||
#[derive(Copy, Clone, Debug)]
|
|
||||||
pub struct spa_meta_control {}
|
|
||||||
|
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
#[derive(Copy, Clone, Debug)]
|
#[derive(Copy, Clone, Debug)]
|
||||||
pub struct spa_meta_busy {
|
pub struct spa_meta_busy {
|
||||||
|
|
|
||||||
|
|
@ -345,6 +345,7 @@ pub trait Handle: RequestParser<'static> {
|
||||||
R: 'static,
|
R: 'static,
|
||||||
H: for<'a> Fn(&R, Self::Generic<'a>) + 'static;
|
H: for<'a> Fn(&R, Self::Generic<'a>) + 'static;
|
||||||
|
|
||||||
|
#[allow(dead_code)]
|
||||||
fn handle2<R, F, H>(tl: &Rc<ToolClient>, id: impl Into<ObjectId>, r: R, h: H)
|
fn handle2<R, F, H>(tl: &Rc<ToolClient>, id: impl Into<ObjectId>, r: R, h: H)
|
||||||
where
|
where
|
||||||
R: 'static,
|
R: 'static,
|
||||||
|
|
|
||||||
|
|
@ -358,10 +358,6 @@ pub trait Node: 'static {
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
|
||||||
fn node_into_output(self: Rc<Self>) -> Option<Rc<OutputNode>> {
|
|
||||||
None
|
|
||||||
}
|
|
||||||
|
|
||||||
fn node_into_surface(self: Rc<Self>) -> Option<Rc<WlSurface>> {
|
fn node_into_surface(self: Rc<Self>) -> Option<Rc<WlSurface>> {
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
|
@ -380,10 +376,6 @@ pub trait Node: 'static {
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
|
|
||||||
fn node_is_output(&self) -> bool {
|
|
||||||
false
|
|
||||||
}
|
|
||||||
|
|
||||||
fn node_is_float(&self) -> bool {
|
fn node_is_float(&self) -> bool {
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1342,8 +1342,6 @@ impl Node for ContainerNode {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ContainingNode for ContainerNode {
|
impl ContainingNode for ContainerNode {
|
||||||
containing_node_impl!();
|
|
||||||
|
|
||||||
fn cnode_replace_child(self: Rc<Self>, old: &dyn Node, new: Rc<dyn ToplevelNode>) {
|
fn cnode_replace_child(self: Rc<Self>, old: &dyn Node, new: Rc<dyn ToplevelNode>) {
|
||||||
let node = match self.child_nodes.borrow_mut().remove(&old.node_id()) {
|
let node = match self.child_nodes.borrow_mut().remove(&old.node_id()) {
|
||||||
Some(c) => c,
|
Some(c) => c,
|
||||||
|
|
|
||||||
|
|
@ -4,10 +4,6 @@ use {
|
||||||
};
|
};
|
||||||
|
|
||||||
pub trait ContainingNode: Node {
|
pub trait ContainingNode: Node {
|
||||||
fn cnode_as_node(&self) -> &dyn Node;
|
|
||||||
fn cnode_into_node(self: Rc<Self>) -> Rc<dyn Node>;
|
|
||||||
fn cnode_into_dyn(self: Rc<Self>) -> Rc<dyn ContainingNode>;
|
|
||||||
|
|
||||||
fn cnode_replace_child(self: Rc<Self>, old: &dyn Node, new: Rc<dyn ToplevelNode>);
|
fn cnode_replace_child(self: Rc<Self>, old: &dyn Node, new: Rc<dyn ToplevelNode>);
|
||||||
fn cnode_remove_child(self: Rc<Self>, child: &dyn Node) {
|
fn cnode_remove_child(self: Rc<Self>, child: &dyn Node) {
|
||||||
self.cnode_remove_child2(child, false);
|
self.cnode_remove_child2(child, false);
|
||||||
|
|
|
||||||
|
|
@ -586,8 +586,6 @@ impl Node for FloatNode {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ContainingNode for FloatNode {
|
impl ContainingNode for FloatNode {
|
||||||
containing_node_impl!();
|
|
||||||
|
|
||||||
fn cnode_replace_child(self: Rc<Self>, _old: &dyn Node, new: Rc<dyn ToplevelNode>) {
|
fn cnode_replace_child(self: Rc<Self>, _old: &dyn Node, new: Rc<dyn ToplevelNode>) {
|
||||||
self.discard_child_properties();
|
self.discard_child_properties();
|
||||||
self.child.set(Some(new.clone()));
|
self.child.set(Some(new.clone()));
|
||||||
|
|
|
||||||
|
|
@ -912,14 +912,6 @@ impl Node for OutputNode {
|
||||||
fn node_on_pointer_motion(self: Rc<Self>, seat: &Rc<WlSeatGlobal>, x: Fixed, y: Fixed) {
|
fn node_on_pointer_motion(self: Rc<Self>, seat: &Rc<WlSeatGlobal>, x: Fixed, y: Fixed) {
|
||||||
self.pointer_move(seat, x.round_down(), y.round_down());
|
self.pointer_move(seat, x.round_down(), y.round_down());
|
||||||
}
|
}
|
||||||
|
|
||||||
fn node_into_output(self: Rc<Self>) -> Option<Rc<OutputNode>> {
|
|
||||||
Some(self.clone())
|
|
||||||
}
|
|
||||||
|
|
||||||
fn node_is_output(&self) -> bool {
|
|
||||||
true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn calculate_logical_size(
|
pub fn calculate_logical_size(
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,7 @@
|
||||||
use {crate::tree::Node, std::rc::Rc};
|
use {crate::tree::Node, std::rc::Rc};
|
||||||
|
|
||||||
pub trait StackedNode: Node {
|
pub trait StackedNode: Node {
|
||||||
fn stacked_as_node(&self) -> &dyn Node;
|
|
||||||
fn stacked_into_node(self: Rc<Self>) -> Rc<dyn Node>;
|
fn stacked_into_node(self: Rc<Self>) -> Rc<dyn Node>;
|
||||||
fn stacked_into_dyn(self: Rc<Self>) -> Rc<dyn StackedNode>;
|
|
||||||
fn stacked_prepare_set_visible(&self) {
|
fn stacked_prepare_set_visible(&self) {
|
||||||
// nothing
|
// nothing
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -84,7 +84,11 @@ impl<T: ToplevelNodeBase> ToplevelNode for T {
|
||||||
parent.node_child_title_changed(self, &title);
|
parent.node_child_title_changed(self, &title);
|
||||||
}
|
}
|
||||||
if let Some(data) = data.fullscrceen_data.borrow_mut().deref() {
|
if let Some(data) = data.fullscrceen_data.borrow_mut().deref() {
|
||||||
*data.placeholder.tl_data().title.borrow_mut() = title.clone();
|
data.placeholder
|
||||||
|
.tl_data()
|
||||||
|
.title
|
||||||
|
.borrow_mut()
|
||||||
|
.clone_from(&title);
|
||||||
data.placeholder.tl_title_changed();
|
data.placeholder.tl_title_changed();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -291,8 +291,6 @@ impl Node for WorkspaceNode {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ContainingNode for WorkspaceNode {
|
impl ContainingNode for WorkspaceNode {
|
||||||
containing_node_impl!();
|
|
||||||
|
|
||||||
fn cnode_replace_child(self: Rc<Self>, old: &dyn Node, new: Rc<dyn ToplevelNode>) {
|
fn cnode_replace_child(self: Rc<Self>, old: &dyn Node, new: Rc<dyn ToplevelNode>) {
|
||||||
if let Some(container) = self.container.get() {
|
if let Some(container) = self.container.get() {
|
||||||
if container.node_id() == old.node_id() {
|
if container.node_id() == old.node_id() {
|
||||||
|
|
|
||||||
|
|
@ -41,26 +41,26 @@ impl<K: Eq + Hash, V> CopyHashMap<K, V> {
|
||||||
unsafe { self.map.get().deref_mut().insert(k, v) }
|
unsafe { self.map.get().deref_mut().insert(k, v) }
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get<Q: ?Sized>(&self, k: &Q) -> Option<V>
|
pub fn get<Q>(&self, k: &Q) -> Option<V>
|
||||||
where
|
where
|
||||||
V: UnsafeCellCloneSafe,
|
V: UnsafeCellCloneSafe,
|
||||||
Q: Hash + Eq,
|
Q: Hash + Eq + ?Sized,
|
||||||
K: Borrow<Q>,
|
K: Borrow<Q>,
|
||||||
{
|
{
|
||||||
unsafe { self.map.get().deref().get(k).cloned() }
|
unsafe { self.map.get().deref().get(k).cloned() }
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn remove<Q: ?Sized>(&self, k: &Q) -> Option<V>
|
pub fn remove<Q>(&self, k: &Q) -> Option<V>
|
||||||
where
|
where
|
||||||
Q: Hash + Eq,
|
Q: Hash + Eq + ?Sized,
|
||||||
K: Borrow<Q>,
|
K: Borrow<Q>,
|
||||||
{
|
{
|
||||||
unsafe { self.map.get().deref_mut().remove(k) }
|
unsafe { self.map.get().deref_mut().remove(k) }
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn contains<Q: ?Sized>(&self, k: &Q) -> bool
|
pub fn contains<Q>(&self, k: &Q) -> bool
|
||||||
where
|
where
|
||||||
Q: Hash + Eq,
|
Q: Hash + Eq + ?Sized,
|
||||||
K: Borrow<Q>,
|
K: Borrow<Q>,
|
||||||
{
|
{
|
||||||
unsafe { self.map.get().deref().contains_key(k) }
|
unsafe { self.map.get().deref().contains_key(k) }
|
||||||
|
|
|
||||||
|
|
@ -205,6 +205,7 @@ impl Display for OsError {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg_attr(not(feature = "it"), allow(dead_code))]
|
||||||
pub trait OsErrorExt {
|
pub trait OsErrorExt {
|
||||||
type Container;
|
type Container;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ pub trait Try: Sized {
|
||||||
where
|
where
|
||||||
F: FnOnce() -> Result<(), Self>;
|
F: FnOnce() -> Result<(), Self>;
|
||||||
|
|
||||||
|
#[allow(dead_code)]
|
||||||
fn tria<F>(f: F) -> Tria<Self, F>
|
fn tria<F>(f: F) -> Tria<Self, F>
|
||||||
where
|
where
|
||||||
F: Future<Output = Result<(), Self>>;
|
F: Future<Output = Result<(), Self>>;
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,13 @@
|
||||||
use crate::utils::ptr_ext::PtrExt;
|
use crate::utils::ptr_ext::PtrExt;
|
||||||
|
|
||||||
|
#[cfg_attr(not(feature = "it"), allow(dead_code))]
|
||||||
pub trait WindowsExt<T> {
|
pub trait WindowsExt<T> {
|
||||||
type Windows<'a, const N: usize>: Iterator<Item = &'a [T; N]>
|
type Windows<'a, const N: usize>: Iterator<Item = &'a [T; N]>
|
||||||
where
|
where
|
||||||
Self: 'a,
|
Self: 'a,
|
||||||
T: 'a;
|
T: 'a;
|
||||||
|
|
||||||
|
#[cfg_attr(not(feature = "rc_tracking"), allow(dead_code))]
|
||||||
fn array_windows_ext<'a, const N: usize>(&'a self) -> Self::Windows<'a, N>;
|
fn array_windows_ext<'a, const N: usize>(&'a self) -> Self::Windows<'a, N>;
|
||||||
fn array_chunks_ext<'a, const N: usize>(&'a self) -> &'a [[T; N]];
|
fn array_chunks_ext<'a, const N: usize>(&'a self) -> &'a [[T; N]];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -106,19 +106,3 @@ impl<T> DespanExt for Option<Spanned<T>> {
|
||||||
self.map(|v| v.value.into())
|
self.map(|v| v.value.into())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub trait SpannedResultExt1: Sized {
|
|
||||||
type T;
|
|
||||||
type E;
|
|
||||||
|
|
||||||
fn map_spanned<U, F: FnOnce(Self::T) -> U>(self, f: F) -> Result<Spanned<U>, Self::E>;
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<T, E> SpannedResultExt1 for Result<Spanned<T>, E> {
|
|
||||||
type T = T;
|
|
||||||
type E = E;
|
|
||||||
|
|
||||||
fn map_spanned<U, F: FnOnce(Self::T) -> U>(self, f: F) -> Result<Spanned<U>, Self::E> {
|
|
||||||
self.map(|v| v.map(f))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue