autocommit 2022-04-07 17:31:31 CEST
This commit is contained in:
parent
1d33088dba
commit
be32036824
200 changed files with 3267 additions and 2479 deletions
|
|
@ -1,16 +1,21 @@
|
|||
use crate::client::{Client, ClientId, WaylandObject};
|
||||
use crate::ifs::wl_seat::WlSeatGlobal;
|
||||
use crate::object::ObjectId;
|
||||
use crate::utils::bitflags::BitflagsExt;
|
||||
use crate::utils::clonecell::CloneCell;
|
||||
use crate::utils::numcell::NumCell;
|
||||
use crate::utils::smallmap::SmallMap;
|
||||
use ahash::AHashSet;
|
||||
use std::cell::{Cell, RefCell};
|
||||
use std::ops::Deref;
|
||||
use std::rc::Rc;
|
||||
use thiserror::Error;
|
||||
use uapi::OwnedFd;
|
||||
use {
|
||||
crate::{
|
||||
client::{Client, ClientId, WaylandObject},
|
||||
ifs::wl_seat::WlSeatGlobal,
|
||||
object::ObjectId,
|
||||
utils::{
|
||||
bitflags::BitflagsExt, clonecell::CloneCell, numcell::NumCell, smallmap::SmallMap,
|
||||
},
|
||||
},
|
||||
ahash::AHashSet,
|
||||
std::{
|
||||
cell::{Cell, RefCell},
|
||||
ops::Deref,
|
||||
rc::Rc,
|
||||
},
|
||||
thiserror::Error,
|
||||
uapi::OwnedFd,
|
||||
};
|
||||
|
||||
pub mod wl_data_device;
|
||||
pub mod wl_data_device_manager;
|
||||
|
|
|
|||
|
|
@ -1,22 +1,25 @@
|
|||
use crate::client::{Client, ClientError, ClientId};
|
||||
use crate::fixed::Fixed;
|
||||
use crate::ifs::ipc::wl_data_device_manager::WlDataDeviceManager;
|
||||
use crate::ifs::ipc::wl_data_offer::WlDataOffer;
|
||||
use crate::ifs::ipc::wl_data_source::WlDataSource;
|
||||
use crate::ifs::ipc::{
|
||||
break_device_loops, destroy_device, DeviceData, OfferData, Role, SourceData, Vtable,
|
||||
use {
|
||||
crate::{
|
||||
client::{Client, ClientError, ClientId},
|
||||
fixed::Fixed,
|
||||
ifs::{
|
||||
ipc::{
|
||||
break_device_loops, destroy_device, wl_data_device_manager::WlDataDeviceManager,
|
||||
wl_data_offer::WlDataOffer, wl_data_source::WlDataSource, DeviceData, OfferData,
|
||||
Role, SourceData, Vtable,
|
||||
},
|
||||
wl_seat::{WlSeat, WlSeatError, WlSeatGlobal},
|
||||
wl_surface::{SurfaceRole, WlSurfaceError},
|
||||
},
|
||||
leaks::Tracker,
|
||||
object::{Object, ObjectId},
|
||||
utils::buffd::{MsgParser, MsgParserError},
|
||||
wire::{wl_data_device::*, WlDataDeviceId, WlDataOfferId, WlSurfaceId},
|
||||
},
|
||||
std::rc::Rc,
|
||||
thiserror::Error,
|
||||
uapi::OwnedFd,
|
||||
};
|
||||
use crate::ifs::wl_seat::{WlSeat, WlSeatError, WlSeatGlobal};
|
||||
use crate::ifs::wl_surface::{SurfaceRole, WlSurfaceError};
|
||||
use crate::leaks::Tracker;
|
||||
use crate::object::{Object, ObjectId};
|
||||
use crate::utils::buffd::MsgParser;
|
||||
use crate::utils::buffd::MsgParserError;
|
||||
use crate::wire::wl_data_device::*;
|
||||
use crate::wire::{WlDataDeviceId, WlDataOfferId, WlSurfaceId};
|
||||
use std::rc::Rc;
|
||||
use thiserror::Error;
|
||||
use uapi::OwnedFd;
|
||||
|
||||
#[allow(dead_code)]
|
||||
const ROLE: u32 = 0;
|
||||
|
|
|
|||
|
|
@ -1,15 +1,16 @@
|
|||
use crate::client::{Client, ClientError};
|
||||
use crate::globals::{Global, GlobalName};
|
||||
use crate::ifs::ipc::wl_data_device::WlDataDevice;
|
||||
use crate::ifs::ipc::wl_data_source::WlDataSource;
|
||||
use crate::leaks::Tracker;
|
||||
use crate::object::Object;
|
||||
use crate::utils::buffd::MsgParser;
|
||||
use crate::utils::buffd::MsgParserError;
|
||||
use crate::wire::wl_data_device_manager::*;
|
||||
use crate::wire::WlDataDeviceManagerId;
|
||||
use std::rc::Rc;
|
||||
use thiserror::Error;
|
||||
use {
|
||||
crate::{
|
||||
client::{Client, ClientError},
|
||||
globals::{Global, GlobalName},
|
||||
ifs::ipc::{wl_data_device::WlDataDevice, wl_data_source::WlDataSource},
|
||||
leaks::Tracker,
|
||||
object::Object,
|
||||
utils::buffd::{MsgParser, MsgParserError},
|
||||
wire::{wl_data_device_manager::*, WlDataDeviceManagerId},
|
||||
},
|
||||
std::rc::Rc,
|
||||
thiserror::Error,
|
||||
};
|
||||
|
||||
pub(super) const DND_NONE: u32 = 0;
|
||||
#[allow(dead_code)]
|
||||
|
|
|
|||
|
|
@ -1,19 +1,22 @@
|
|||
use crate::client::{Client, ClientError};
|
||||
use crate::ifs::ipc::wl_data_device::WlDataDevice;
|
||||
use crate::ifs::ipc::wl_data_device_manager::DND_ALL;
|
||||
use crate::ifs::ipc::{
|
||||
break_offer_loops, destroy_offer, receive, OfferData, Role, OFFER_STATE_ACCEPTED,
|
||||
OFFER_STATE_DROPPED, OFFER_STATE_FINISHED, SOURCE_STATE_FINISHED,
|
||||
use {
|
||||
crate::{
|
||||
client::{Client, ClientError},
|
||||
ifs::ipc::{
|
||||
break_offer_loops, destroy_offer, receive, wl_data_device::WlDataDevice,
|
||||
wl_data_device_manager::DND_ALL, OfferData, Role, OFFER_STATE_ACCEPTED,
|
||||
OFFER_STATE_DROPPED, OFFER_STATE_FINISHED, SOURCE_STATE_FINISHED,
|
||||
},
|
||||
leaks::Tracker,
|
||||
object::Object,
|
||||
utils::{
|
||||
bitflags::BitflagsExt,
|
||||
buffd::{MsgParser, MsgParserError},
|
||||
},
|
||||
wire::{wl_data_offer::*, WlDataOfferId},
|
||||
},
|
||||
std::rc::Rc,
|
||||
thiserror::Error,
|
||||
};
|
||||
use crate::leaks::Tracker;
|
||||
use crate::object::Object;
|
||||
use crate::utils::bitflags::BitflagsExt;
|
||||
use crate::utils::buffd::MsgParser;
|
||||
use crate::utils::buffd::MsgParserError;
|
||||
use crate::wire::wl_data_offer::*;
|
||||
use crate::wire::WlDataOfferId;
|
||||
use std::rc::Rc;
|
||||
use thiserror::Error;
|
||||
|
||||
#[allow(dead_code)]
|
||||
const INVALID_FINISH: u32 = 0;
|
||||
|
|
|
|||
|
|
@ -1,21 +1,25 @@
|
|||
use crate::client::{Client, ClientError};
|
||||
use crate::ifs::ipc::wl_data_device::WlDataDevice;
|
||||
use crate::ifs::ipc::wl_data_device_manager::{DND_ALL, DND_NONE};
|
||||
use crate::ifs::ipc::wl_data_offer::WlDataOffer;
|
||||
use crate::ifs::ipc::{
|
||||
add_mime_type, break_source_loops, cancel_offers, destroy_source, SharedState, SourceData,
|
||||
OFFER_STATE_ACCEPTED, OFFER_STATE_DROPPED,
|
||||
use {
|
||||
crate::{
|
||||
client::{Client, ClientError},
|
||||
ifs::ipc::{
|
||||
add_mime_type, break_source_loops, cancel_offers, destroy_source,
|
||||
wl_data_device::WlDataDevice,
|
||||
wl_data_device_manager::{DND_ALL, DND_NONE},
|
||||
wl_data_offer::WlDataOffer,
|
||||
SharedState, SourceData, OFFER_STATE_ACCEPTED, OFFER_STATE_DROPPED,
|
||||
},
|
||||
leaks::Tracker,
|
||||
object::Object,
|
||||
utils::{
|
||||
bitflags::BitflagsExt,
|
||||
buffd::{MsgParser, MsgParserError},
|
||||
},
|
||||
wire::{wl_data_source::*, WlDataSourceId},
|
||||
},
|
||||
std::rc::Rc,
|
||||
thiserror::Error,
|
||||
uapi::OwnedFd,
|
||||
};
|
||||
use crate::leaks::Tracker;
|
||||
use crate::object::Object;
|
||||
use crate::utils::bitflags::BitflagsExt;
|
||||
use crate::utils::buffd::MsgParser;
|
||||
use crate::utils::buffd::MsgParserError;
|
||||
use crate::wire::wl_data_source::*;
|
||||
use crate::wire::WlDataSourceId;
|
||||
use std::rc::Rc;
|
||||
use thiserror::Error;
|
||||
use uapi::OwnedFd;
|
||||
|
||||
#[allow(dead_code)]
|
||||
const INVALID_ACTION_MASK: u32 = 0;
|
||||
|
|
|
|||
|
|
@ -1,15 +1,19 @@
|
|||
use crate::client::{Client, ClientError};
|
||||
use crate::globals::{Global, GlobalName};
|
||||
use crate::ifs::ipc::zwp_primary_selection_device_v1::ZwpPrimarySelectionDeviceV1;
|
||||
use crate::ifs::ipc::zwp_primary_selection_source_v1::ZwpPrimarySelectionSourceV1;
|
||||
use crate::leaks::Tracker;
|
||||
use crate::object::Object;
|
||||
use crate::utils::buffd::MsgParser;
|
||||
use crate::utils::buffd::MsgParserError;
|
||||
use crate::wire::zwp_primary_selection_device_manager_v1::*;
|
||||
use crate::wire::ZwpPrimarySelectionDeviceManagerV1Id;
|
||||
use std::rc::Rc;
|
||||
use thiserror::Error;
|
||||
use {
|
||||
crate::{
|
||||
client::{Client, ClientError},
|
||||
globals::{Global, GlobalName},
|
||||
ifs::ipc::{
|
||||
zwp_primary_selection_device_v1::ZwpPrimarySelectionDeviceV1,
|
||||
zwp_primary_selection_source_v1::ZwpPrimarySelectionSourceV1,
|
||||
},
|
||||
leaks::Tracker,
|
||||
object::Object,
|
||||
utils::buffd::{MsgParser, MsgParserError},
|
||||
wire::{zwp_primary_selection_device_manager_v1::*, ZwpPrimarySelectionDeviceManagerV1Id},
|
||||
},
|
||||
std::rc::Rc,
|
||||
thiserror::Error,
|
||||
};
|
||||
|
||||
pub struct ZwpPrimarySelectionDeviceManagerV1Global {
|
||||
name: GlobalName,
|
||||
|
|
|
|||
|
|
@ -1,19 +1,28 @@
|
|||
use crate::client::{Client, ClientError, ClientId};
|
||||
use crate::ifs::ipc::zwp_primary_selection_device_manager_v1::ZwpPrimarySelectionDeviceManagerV1;
|
||||
use crate::ifs::ipc::zwp_primary_selection_offer_v1::ZwpPrimarySelectionOfferV1;
|
||||
use crate::ifs::ipc::zwp_primary_selection_source_v1::ZwpPrimarySelectionSourceV1;
|
||||
use crate::ifs::ipc::{
|
||||
break_device_loops, destroy_device, DeviceData, OfferData, Role, SourceData, Vtable,
|
||||
use {
|
||||
crate::{
|
||||
client::{Client, ClientError, ClientId},
|
||||
ifs::{
|
||||
ipc::{
|
||||
break_device_loops, destroy_device,
|
||||
zwp_primary_selection_device_manager_v1::ZwpPrimarySelectionDeviceManagerV1,
|
||||
zwp_primary_selection_offer_v1::ZwpPrimarySelectionOfferV1,
|
||||
zwp_primary_selection_source_v1::ZwpPrimarySelectionSourceV1, DeviceData,
|
||||
OfferData, Role, SourceData, Vtable,
|
||||
},
|
||||
wl_seat::{WlSeat, WlSeatError, WlSeatGlobal},
|
||||
},
|
||||
leaks::Tracker,
|
||||
object::{Object, ObjectId},
|
||||
utils::buffd::{MsgParser, MsgParserError},
|
||||
wire::{
|
||||
zwp_primary_selection_device_v1::*, ZwpPrimarySelectionDeviceV1Id,
|
||||
ZwpPrimarySelectionOfferV1Id,
|
||||
},
|
||||
},
|
||||
std::rc::Rc,
|
||||
thiserror::Error,
|
||||
uapi::OwnedFd,
|
||||
};
|
||||
use crate::ifs::wl_seat::{WlSeat, WlSeatError, WlSeatGlobal};
|
||||
use crate::leaks::Tracker;
|
||||
use crate::object::{Object, ObjectId};
|
||||
use crate::utils::buffd::{MsgParser, MsgParserError};
|
||||
use crate::wire::zwp_primary_selection_device_v1::*;
|
||||
use crate::wire::{ZwpPrimarySelectionDeviceV1Id, ZwpPrimarySelectionOfferV1Id};
|
||||
use std::rc::Rc;
|
||||
use thiserror::Error;
|
||||
use uapi::OwnedFd;
|
||||
|
||||
pub struct ZwpPrimarySelectionDeviceV1 {
|
||||
pub id: ZwpPrimarySelectionDeviceV1Id,
|
||||
|
|
|
|||
|
|
@ -1,13 +1,18 @@
|
|||
use crate::client::{Client, ClientError};
|
||||
use crate::ifs::ipc::zwp_primary_selection_device_v1::ZwpPrimarySelectionDeviceV1;
|
||||
use crate::ifs::ipc::{break_offer_loops, destroy_offer, receive, OfferData};
|
||||
use crate::leaks::Tracker;
|
||||
use crate::object::Object;
|
||||
use crate::utils::buffd::{MsgParser, MsgParserError};
|
||||
use crate::wire::zwp_primary_selection_offer_v1::*;
|
||||
use crate::wire::ZwpPrimarySelectionOfferV1Id;
|
||||
use std::rc::Rc;
|
||||
use thiserror::Error;
|
||||
use {
|
||||
crate::{
|
||||
client::{Client, ClientError},
|
||||
ifs::ipc::{
|
||||
break_offer_loops, destroy_offer, receive,
|
||||
zwp_primary_selection_device_v1::ZwpPrimarySelectionDeviceV1, OfferData,
|
||||
},
|
||||
leaks::Tracker,
|
||||
object::Object,
|
||||
utils::buffd::{MsgParser, MsgParserError},
|
||||
wire::{zwp_primary_selection_offer_v1::*, ZwpPrimarySelectionOfferV1Id},
|
||||
},
|
||||
std::rc::Rc,
|
||||
thiserror::Error,
|
||||
};
|
||||
|
||||
pub struct ZwpPrimarySelectionOfferV1 {
|
||||
pub id: ZwpPrimarySelectionOfferV1Id,
|
||||
|
|
|
|||
|
|
@ -1,14 +1,19 @@
|
|||
use crate::client::{Client, ClientError};
|
||||
use crate::ifs::ipc::zwp_primary_selection_device_v1::ZwpPrimarySelectionDeviceV1;
|
||||
use crate::ifs::ipc::{add_mime_type, break_source_loops, destroy_source, SourceData};
|
||||
use crate::leaks::Tracker;
|
||||
use crate::object::Object;
|
||||
use crate::utils::buffd::{MsgParser, MsgParserError};
|
||||
use crate::wire::zwp_primary_selection_source_v1::*;
|
||||
use crate::wire::ZwpPrimarySelectionSourceV1Id;
|
||||
use std::rc::Rc;
|
||||
use thiserror::Error;
|
||||
use uapi::OwnedFd;
|
||||
use {
|
||||
crate::{
|
||||
client::{Client, ClientError},
|
||||
ifs::ipc::{
|
||||
add_mime_type, break_source_loops, destroy_source,
|
||||
zwp_primary_selection_device_v1::ZwpPrimarySelectionDeviceV1, SourceData,
|
||||
},
|
||||
leaks::Tracker,
|
||||
object::Object,
|
||||
utils::buffd::{MsgParser, MsgParserError},
|
||||
wire::{zwp_primary_selection_source_v1::*, ZwpPrimarySelectionSourceV1Id},
|
||||
},
|
||||
std::rc::Rc,
|
||||
thiserror::Error,
|
||||
uapi::OwnedFd,
|
||||
};
|
||||
|
||||
pub struct ZwpPrimarySelectionSourceV1 {
|
||||
pub id: ZwpPrimarySelectionSourceV1Id,
|
||||
|
|
|
|||
|
|
@ -1,15 +1,18 @@
|
|||
use crate::cli::CliLogLevel;
|
||||
use crate::client::{Client, ClientError};
|
||||
use crate::globals::{Global, GlobalName};
|
||||
use crate::ifs::jay_log_file::JayLogFile;
|
||||
use crate::leaks::Tracker;
|
||||
use crate::object::Object;
|
||||
use crate::utils::buffd::{MsgParser, MsgParserError};
|
||||
use crate::wire::jay_compositor::*;
|
||||
use crate::wire::JayCompositorId;
|
||||
use log::Level;
|
||||
use std::rc::Rc;
|
||||
use thiserror::Error;
|
||||
use {
|
||||
crate::{
|
||||
cli::CliLogLevel,
|
||||
client::{Client, ClientError},
|
||||
globals::{Global, GlobalName},
|
||||
ifs::jay_log_file::JayLogFile,
|
||||
leaks::Tracker,
|
||||
object::Object,
|
||||
utils::buffd::{MsgParser, MsgParserError},
|
||||
wire::{jay_compositor::*, JayCompositorId},
|
||||
},
|
||||
log::Level,
|
||||
std::rc::Rc,
|
||||
thiserror::Error,
|
||||
};
|
||||
|
||||
pub struct JayCompositorGlobal {
|
||||
name: GlobalName,
|
||||
|
|
|
|||
|
|
@ -1,12 +1,15 @@
|
|||
use crate::client::{Client, ClientError};
|
||||
use crate::leaks::Tracker;
|
||||
use crate::object::Object;
|
||||
use crate::utils::buffd::{MsgParser, MsgParserError};
|
||||
use crate::wire::jay_log_file::*;
|
||||
use crate::wire::JayLogFileId;
|
||||
use bstr::BStr;
|
||||
use std::rc::Rc;
|
||||
use thiserror::Error;
|
||||
use {
|
||||
crate::{
|
||||
client::{Client, ClientError},
|
||||
leaks::Tracker,
|
||||
object::Object,
|
||||
utils::buffd::{MsgParser, MsgParserError},
|
||||
wire::{jay_log_file::*, JayLogFileId},
|
||||
},
|
||||
bstr::BStr,
|
||||
std::rc::Rc,
|
||||
thiserror::Error,
|
||||
};
|
||||
|
||||
pub struct JayLogFile {
|
||||
pub id: JayLogFileId,
|
||||
|
|
|
|||
|
|
@ -1,13 +1,14 @@
|
|||
use crate::client::{Client, ClientError};
|
||||
use crate::leaks::Tracker;
|
||||
use crate::object::Object;
|
||||
use crate::utils::buffd::MsgParser;
|
||||
use crate::utils::buffd::MsgParserError;
|
||||
use crate::wire::org_kde_kwin_server_decoration::*;
|
||||
use crate::wire::OrgKdeKwinServerDecorationId;
|
||||
use std::cell::Cell;
|
||||
use std::rc::Rc;
|
||||
use thiserror::Error;
|
||||
use {
|
||||
crate::{
|
||||
client::{Client, ClientError},
|
||||
leaks::Tracker,
|
||||
object::Object,
|
||||
utils::buffd::{MsgParser, MsgParserError},
|
||||
wire::{org_kde_kwin_server_decoration::*, OrgKdeKwinServerDecorationId},
|
||||
},
|
||||
std::{cell::Cell, rc::Rc},
|
||||
thiserror::Error,
|
||||
};
|
||||
|
||||
#[allow(dead_code)]
|
||||
const NONE: u32 = 0;
|
||||
|
|
|
|||
|
|
@ -1,14 +1,16 @@
|
|||
use crate::client::{Client, ClientError};
|
||||
use crate::globals::{Global, GlobalName};
|
||||
use crate::ifs::org_kde_kwin_server_decoration::OrgKdeKwinServerDecoration;
|
||||
use crate::leaks::Tracker;
|
||||
use crate::object::Object;
|
||||
use crate::utils::buffd::MsgParser;
|
||||
use crate::utils::buffd::MsgParserError;
|
||||
use crate::wire::org_kde_kwin_server_decoration_manager::*;
|
||||
use crate::wire::OrgKdeKwinServerDecorationManagerId;
|
||||
use std::rc::Rc;
|
||||
use thiserror::Error;
|
||||
use {
|
||||
crate::{
|
||||
client::{Client, ClientError},
|
||||
globals::{Global, GlobalName},
|
||||
ifs::org_kde_kwin_server_decoration::OrgKdeKwinServerDecoration,
|
||||
leaks::Tracker,
|
||||
object::Object,
|
||||
utils::buffd::{MsgParser, MsgParserError},
|
||||
wire::{org_kde_kwin_server_decoration_manager::*, OrgKdeKwinServerDecorationManagerId},
|
||||
},
|
||||
std::rc::Rc,
|
||||
thiserror::Error,
|
||||
};
|
||||
|
||||
#[allow(dead_code)]
|
||||
const NONE: u32 = 0;
|
||||
|
|
|
|||
|
|
@ -1,18 +1,21 @@
|
|||
use crate::client::{Client, ClientError};
|
||||
use crate::clientmem::{ClientMem, ClientMemError, ClientMemOffset};
|
||||
use crate::format::Format;
|
||||
use crate::leaks::Tracker;
|
||||
use crate::object::Object;
|
||||
use crate::rect::Rect;
|
||||
use crate::render::{Image, RenderError, Texture};
|
||||
use crate::utils::buffd::MsgParser;
|
||||
use crate::utils::buffd::MsgParserError;
|
||||
use crate::utils::clonecell::CloneCell;
|
||||
use crate::wire::wl_buffer::*;
|
||||
use crate::wire::WlBufferId;
|
||||
use std::cell::Cell;
|
||||
use std::rc::Rc;
|
||||
use thiserror::Error;
|
||||
use {
|
||||
crate::{
|
||||
client::{Client, ClientError},
|
||||
clientmem::{ClientMem, ClientMemError, ClientMemOffset},
|
||||
format::Format,
|
||||
leaks::Tracker,
|
||||
object::Object,
|
||||
rect::Rect,
|
||||
render::{Image, RenderError, Texture},
|
||||
utils::{
|
||||
buffd::{MsgParser, MsgParserError},
|
||||
clonecell::CloneCell,
|
||||
},
|
||||
wire::{wl_buffer::*, WlBufferId},
|
||||
},
|
||||
std::{cell::Cell, rc::Rc},
|
||||
thiserror::Error,
|
||||
};
|
||||
|
||||
pub enum WlBufferStorage {
|
||||
Shm { mem: ClientMemOffset, stride: i32 },
|
||||
|
|
|
|||
|
|
@ -1,10 +1,13 @@
|
|||
use crate::client::Client;
|
||||
use crate::leaks::Tracker;
|
||||
use crate::object::Object;
|
||||
use crate::wire::wl_callback::*;
|
||||
use crate::wire::WlCallbackId;
|
||||
use std::rc::Rc;
|
||||
use thiserror::Error;
|
||||
use {
|
||||
crate::{
|
||||
client::Client,
|
||||
leaks::Tracker,
|
||||
object::Object,
|
||||
wire::{wl_callback::*, WlCallbackId},
|
||||
},
|
||||
std::rc::Rc,
|
||||
thiserror::Error,
|
||||
};
|
||||
|
||||
pub struct WlCallback {
|
||||
client: Rc<Client>,
|
||||
|
|
|
|||
|
|
@ -1,16 +1,17 @@
|
|||
use crate::client::{Client, ClientError};
|
||||
use crate::globals::{Global, GlobalName};
|
||||
use crate::ifs::wl_region::WlRegion;
|
||||
use crate::ifs::wl_surface::WlSurface;
|
||||
use crate::leaks::Tracker;
|
||||
use crate::object::Object;
|
||||
use crate::utils::buffd::MsgParser;
|
||||
use crate::utils::buffd::MsgParserError;
|
||||
use crate::wire::wl_compositor::*;
|
||||
use crate::wire::WlCompositorId;
|
||||
use crate::xwayland::XWaylandEvent;
|
||||
use std::rc::Rc;
|
||||
use thiserror::Error;
|
||||
use {
|
||||
crate::{
|
||||
client::{Client, ClientError},
|
||||
globals::{Global, GlobalName},
|
||||
ifs::{wl_region::WlRegion, wl_surface::WlSurface},
|
||||
leaks::Tracker,
|
||||
object::Object,
|
||||
utils::buffd::{MsgParser, MsgParserError},
|
||||
wire::{wl_compositor::*, WlCompositorId},
|
||||
xwayland::XWaylandEvent,
|
||||
},
|
||||
std::rc::Rc,
|
||||
thiserror::Error,
|
||||
};
|
||||
|
||||
pub struct WlCompositorGlobal {
|
||||
name: GlobalName,
|
||||
|
|
|
|||
|
|
@ -1,15 +1,16 @@
|
|||
use crate::client::{Client, ClientError};
|
||||
use crate::globals::GlobalsError;
|
||||
use crate::ifs::wl_callback::WlCallback;
|
||||
use crate::ifs::wl_registry::WlRegistry;
|
||||
use crate::leaks::Tracker;
|
||||
use crate::object::{Object, ObjectId, WL_DISPLAY_ID};
|
||||
use crate::utils::buffd::MsgParser;
|
||||
use crate::utils::buffd::MsgParserError;
|
||||
use crate::wire::wl_display::*;
|
||||
use crate::wire::WlDisplayId;
|
||||
use std::rc::Rc;
|
||||
use thiserror::Error;
|
||||
use {
|
||||
crate::{
|
||||
client::{Client, ClientError},
|
||||
globals::GlobalsError,
|
||||
ifs::{wl_callback::WlCallback, wl_registry::WlRegistry},
|
||||
leaks::Tracker,
|
||||
object::{Object, ObjectId, WL_DISPLAY_ID},
|
||||
utils::buffd::{MsgParser, MsgParserError},
|
||||
wire::{wl_display::*, WlDisplayId},
|
||||
},
|
||||
std::rc::Rc,
|
||||
thiserror::Error,
|
||||
};
|
||||
|
||||
const INVALID_OBJECT: u32 = 0;
|
||||
const INVALID_METHOD: u32 = 1;
|
||||
|
|
|
|||
|
|
@ -1,19 +1,22 @@
|
|||
use crate::client::{Client, ClientError};
|
||||
use crate::drm::dma::{DmaBuf, DmaBufPlane};
|
||||
use crate::drm::INVALID_MODIFIER;
|
||||
use crate::globals::{Global, GlobalName};
|
||||
use crate::ifs::wl_buffer::WlBuffer;
|
||||
use crate::leaks::Tracker;
|
||||
use crate::object::Object;
|
||||
use crate::render::RenderError;
|
||||
use crate::utils::buffd::MsgParser;
|
||||
use crate::utils::buffd::MsgParserError;
|
||||
use crate::wire::wl_drm::*;
|
||||
use crate::wire::WlDrmId;
|
||||
use bstr::ByteSlice;
|
||||
use std::ffi::CString;
|
||||
use std::rc::Rc;
|
||||
use thiserror::Error;
|
||||
use {
|
||||
crate::{
|
||||
client::{Client, ClientError},
|
||||
video::{
|
||||
dma::{DmaBuf, DmaBufPlane},
|
||||
INVALID_MODIFIER,
|
||||
},
|
||||
globals::{Global, GlobalName},
|
||||
ifs::wl_buffer::WlBuffer,
|
||||
leaks::Tracker,
|
||||
object::Object,
|
||||
render::RenderError,
|
||||
utils::buffd::{MsgParser, MsgParserError},
|
||||
wire::{wl_drm::*, WlDrmId},
|
||||
},
|
||||
bstr::ByteSlice,
|
||||
std::{ffi::CString, rc::Rc},
|
||||
thiserror::Error,
|
||||
};
|
||||
|
||||
const PRIME: u32 = 1;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,23 +1,29 @@
|
|||
use crate::backend;
|
||||
use crate::client::{Client, ClientError, ClientId};
|
||||
use crate::globals::{Global, GlobalName};
|
||||
use crate::ifs::zxdg_output_v1::ZxdgOutputV1;
|
||||
use crate::leaks::Tracker;
|
||||
use crate::object::Object;
|
||||
use crate::rect::Rect;
|
||||
use crate::state::ConnectorData;
|
||||
use crate::tree::OutputNode;
|
||||
use crate::utils::buffd::MsgParser;
|
||||
use crate::utils::buffd::MsgParserError;
|
||||
use crate::utils::clonecell::CloneCell;
|
||||
use crate::utils::copyhashmap::CopyHashMap;
|
||||
use crate::wire::wl_output::*;
|
||||
use crate::wire::{WlOutputId, ZxdgOutputV1Id};
|
||||
use ahash::AHashMap;
|
||||
use std::cell::{Cell, RefCell};
|
||||
use std::collections::hash_map::Entry;
|
||||
use std::rc::Rc;
|
||||
use thiserror::Error;
|
||||
use {
|
||||
crate::{
|
||||
backend,
|
||||
client::{Client, ClientError, ClientId},
|
||||
globals::{Global, GlobalName},
|
||||
ifs::zxdg_output_v1::ZxdgOutputV1,
|
||||
leaks::Tracker,
|
||||
object::Object,
|
||||
rect::Rect,
|
||||
state::ConnectorData,
|
||||
tree::OutputNode,
|
||||
utils::{
|
||||
buffd::{MsgParser, MsgParserError},
|
||||
clonecell::CloneCell,
|
||||
copyhashmap::CopyHashMap,
|
||||
},
|
||||
wire::{wl_output::*, WlOutputId, ZxdgOutputV1Id},
|
||||
},
|
||||
ahash::AHashMap,
|
||||
std::{
|
||||
cell::{Cell, RefCell},
|
||||
collections::hash_map::Entry,
|
||||
rc::Rc,
|
||||
},
|
||||
thiserror::Error,
|
||||
};
|
||||
|
||||
const SP_UNKNOWN: i32 = 0;
|
||||
#[allow(dead_code)]
|
||||
|
|
|
|||
|
|
@ -1,14 +1,15 @@
|
|||
use crate::client::{Client, ClientError};
|
||||
use crate::leaks::Tracker;
|
||||
use crate::object::Object;
|
||||
use crate::rect::{Rect, Region, RegionBuilder};
|
||||
use crate::utils::buffd::MsgParser;
|
||||
use crate::utils::buffd::MsgParserError;
|
||||
use crate::wire::wl_region::*;
|
||||
use crate::wire::WlRegionId;
|
||||
use std::cell::RefCell;
|
||||
use std::rc::Rc;
|
||||
use thiserror::Error;
|
||||
use {
|
||||
crate::{
|
||||
client::{Client, ClientError},
|
||||
leaks::Tracker,
|
||||
object::Object,
|
||||
rect::{Rect, Region, RegionBuilder},
|
||||
utils::buffd::{MsgParser, MsgParserError},
|
||||
wire::{wl_region::*, WlRegionId},
|
||||
},
|
||||
std::{cell::RefCell, rc::Rc},
|
||||
thiserror::Error,
|
||||
};
|
||||
|
||||
pub struct WlRegion {
|
||||
id: WlRegionId,
|
||||
|
|
|
|||
|
|
@ -1,13 +1,15 @@
|
|||
use crate::client::Client;
|
||||
use crate::globals::{Global, GlobalName, GlobalsError};
|
||||
use crate::leaks::Tracker;
|
||||
use crate::object::{Interface, Object};
|
||||
use crate::utils::buffd::MsgParser;
|
||||
use crate::utils::buffd::MsgParserError;
|
||||
use crate::wire::wl_registry::*;
|
||||
use crate::wire::WlRegistryId;
|
||||
use std::rc::Rc;
|
||||
use thiserror::Error;
|
||||
use {
|
||||
crate::{
|
||||
client::Client,
|
||||
globals::{Global, GlobalName, GlobalsError},
|
||||
leaks::Tracker,
|
||||
object::{Interface, Object},
|
||||
utils::buffd::{MsgParser, MsgParserError},
|
||||
wire::{wl_registry::*, WlRegistryId},
|
||||
},
|
||||
std::rc::Rc,
|
||||
thiserror::Error,
|
||||
};
|
||||
|
||||
pub struct WlRegistry {
|
||||
id: WlRegistryId,
|
||||
|
|
|
|||
|
|
@ -5,53 +5,62 @@ pub mod wl_keyboard;
|
|||
pub mod wl_pointer;
|
||||
pub mod wl_touch;
|
||||
|
||||
use crate::async_engine::SpawnedFuture;
|
||||
use crate::client::{Client, ClientError, ClientId};
|
||||
use crate::cursor::{Cursor, KnownCursor};
|
||||
use crate::fixed::Fixed;
|
||||
use crate::globals::{Global, GlobalName};
|
||||
use crate::ifs::ipc;
|
||||
use crate::ifs::ipc::wl_data_device::WlDataDevice;
|
||||
use crate::ifs::ipc::wl_data_source::WlDataSource;
|
||||
use crate::ifs::ipc::zwp_primary_selection_device_v1::ZwpPrimarySelectionDeviceV1;
|
||||
use crate::ifs::ipc::zwp_primary_selection_source_v1::ZwpPrimarySelectionSourceV1;
|
||||
use crate::ifs::ipc::IpcError;
|
||||
use crate::ifs::wl_seat::kb_owner::KbOwnerHolder;
|
||||
use crate::ifs::wl_seat::pointer_owner::PointerOwnerHolder;
|
||||
use crate::ifs::wl_seat::wl_keyboard::{WlKeyboard, WlKeyboardError, REPEAT_INFO_SINCE};
|
||||
use crate::ifs::wl_seat::wl_pointer::WlPointer;
|
||||
use crate::ifs::wl_seat::wl_touch::WlTouch;
|
||||
use crate::ifs::wl_surface::WlSurface;
|
||||
use crate::leaks::Tracker;
|
||||
use crate::object::{Object, ObjectId};
|
||||
use crate::state::State;
|
||||
use crate::tree::toplevel::ToplevelNode;
|
||||
use crate::tree::{ContainerSplit, FloatNode, FoundNode, Node, OutputNode};
|
||||
use crate::utils::asyncevent::AsyncEvent;
|
||||
use crate::utils::buffd::MsgParser;
|
||||
use crate::utils::buffd::MsgParserError;
|
||||
use crate::utils::clonecell::CloneCell;
|
||||
use crate::utils::copyhashmap::CopyHashMap;
|
||||
use crate::utils::errorfmt::ErrorFmt;
|
||||
use crate::utils::linkedlist::{LinkedList, LinkedNode};
|
||||
use crate::utils::numcell::NumCell;
|
||||
use crate::utils::rc_eq::rc_eq;
|
||||
use crate::wire::wl_seat::*;
|
||||
use crate::wire::{
|
||||
WlDataDeviceId, WlKeyboardId, WlPointerId, WlSeatId, ZwpPrimarySelectionDeviceV1Id,
|
||||
};
|
||||
use crate::xkbcommon::{XkbKeymap, XkbState};
|
||||
use ahash::{AHashMap, AHashSet};
|
||||
pub use event_handling::NodeSeatState;
|
||||
use jay_config::keyboard::mods::Modifiers;
|
||||
use jay_config::Direction;
|
||||
use std::cell::{Cell, RefCell};
|
||||
use std::collections::hash_map::Entry;
|
||||
use std::mem;
|
||||
use std::ops::DerefMut;
|
||||
use std::rc::Rc;
|
||||
use thiserror::Error;
|
||||
use uapi::{c, Errno, OwnedFd};
|
||||
use {
|
||||
crate::{
|
||||
async_engine::SpawnedFuture,
|
||||
client::{Client, ClientError, ClientId},
|
||||
cursor::{Cursor, KnownCursor},
|
||||
fixed::Fixed,
|
||||
globals::{Global, GlobalName},
|
||||
ifs::{
|
||||
ipc,
|
||||
ipc::{
|
||||
wl_data_device::WlDataDevice, wl_data_source::WlDataSource,
|
||||
zwp_primary_selection_device_v1::ZwpPrimarySelectionDeviceV1,
|
||||
zwp_primary_selection_source_v1::ZwpPrimarySelectionSourceV1, IpcError,
|
||||
},
|
||||
wl_seat::{
|
||||
kb_owner::KbOwnerHolder,
|
||||
pointer_owner::PointerOwnerHolder,
|
||||
wl_keyboard::{WlKeyboard, WlKeyboardError, REPEAT_INFO_SINCE},
|
||||
wl_pointer::WlPointer,
|
||||
wl_touch::WlTouch,
|
||||
},
|
||||
wl_surface::WlSurface,
|
||||
},
|
||||
leaks::Tracker,
|
||||
object::{Object, ObjectId},
|
||||
state::State,
|
||||
tree::{ContainerSplit, FloatNode, FoundNode, Node, OutputNode, ToplevelNode},
|
||||
utils::{
|
||||
asyncevent::AsyncEvent,
|
||||
buffd::{MsgParser, MsgParserError},
|
||||
clonecell::CloneCell,
|
||||
copyhashmap::CopyHashMap,
|
||||
errorfmt::ErrorFmt,
|
||||
linkedlist::{LinkedList, LinkedNode},
|
||||
numcell::NumCell,
|
||||
rc_eq::rc_eq,
|
||||
},
|
||||
wire::{
|
||||
wl_seat::*, WlDataDeviceId, WlKeyboardId, WlPointerId, WlSeatId,
|
||||
ZwpPrimarySelectionDeviceV1Id,
|
||||
},
|
||||
xkbcommon::{XkbKeymap, XkbState},
|
||||
},
|
||||
ahash::{AHashMap, AHashSet},
|
||||
jay_config::{keyboard::mods::Modifiers, Direction},
|
||||
std::{
|
||||
cell::{Cell, RefCell},
|
||||
collections::hash_map::Entry,
|
||||
mem,
|
||||
ops::DerefMut,
|
||||
rc::Rc,
|
||||
},
|
||||
thiserror::Error,
|
||||
uapi::{c, Errno, OwnedFd},
|
||||
};
|
||||
|
||||
const POINTER: u32 = 1;
|
||||
const KEYBOARD: u32 = 2;
|
||||
|
|
|
|||
|
|
@ -1,27 +1,31 @@
|
|||
use crate::backend::{ConnectorId, InputEvent, KeyState, ScrollAxis};
|
||||
use crate::client::{Client, ClientId};
|
||||
use crate::fixed::Fixed;
|
||||
use crate::ifs::ipc;
|
||||
use crate::ifs::ipc::wl_data_device::WlDataDevice;
|
||||
use crate::ifs::ipc::zwp_primary_selection_device_v1::ZwpPrimarySelectionDeviceV1;
|
||||
use crate::ifs::wl_seat::wl_keyboard::WlKeyboard;
|
||||
use crate::ifs::wl_seat::wl_pointer::{WlPointer, POINTER_FRAME_SINCE_VERSION};
|
||||
use crate::ifs::wl_seat::{wl_keyboard, wl_pointer, Dnd, SeatId, WlSeat, WlSeatGlobal};
|
||||
use crate::ifs::wl_surface::xdg_surface::xdg_popup::XdgPopup;
|
||||
use crate::ifs::wl_surface::WlSurface;
|
||||
use crate::object::ObjectId;
|
||||
use crate::tree::toplevel::ToplevelNode;
|
||||
use crate::tree::{FloatNode, Node, OutputNode};
|
||||
use crate::utils::clonecell::CloneCell;
|
||||
use crate::utils::smallmap::SmallMap;
|
||||
use crate::wire::WlDataOfferId;
|
||||
use crate::xkbcommon::{ModifierState, XKB_KEY_DOWN, XKB_KEY_UP};
|
||||
use jay_config::keyboard::mods::Modifiers;
|
||||
use jay_config::keyboard::syms::KeySym;
|
||||
use jay_config::keyboard::ModifiedKeySym;
|
||||
use smallvec::SmallVec;
|
||||
use std::ops::Deref;
|
||||
use std::rc::Rc;
|
||||
use {
|
||||
crate::{
|
||||
backend::{ConnectorId, InputEvent, KeyState, ScrollAxis},
|
||||
client::{Client, ClientId},
|
||||
fixed::Fixed,
|
||||
ifs::{
|
||||
ipc,
|
||||
ipc::{
|
||||
wl_data_device::WlDataDevice,
|
||||
zwp_primary_selection_device_v1::ZwpPrimarySelectionDeviceV1,
|
||||
},
|
||||
wl_seat::{
|
||||
wl_keyboard::{self, WlKeyboard},
|
||||
wl_pointer::{self, WlPointer, POINTER_FRAME_SINCE_VERSION},
|
||||
Dnd, SeatId, WlSeat, WlSeatGlobal,
|
||||
},
|
||||
wl_surface::{xdg_surface::xdg_popup::XdgPopup, WlSurface},
|
||||
},
|
||||
object::ObjectId,
|
||||
tree::{FloatNode, Node, OutputNode, ToplevelNode},
|
||||
utils::{clonecell::CloneCell, smallmap::SmallMap},
|
||||
wire::WlDataOfferId,
|
||||
xkbcommon::{ModifierState, XKB_KEY_DOWN, XKB_KEY_UP},
|
||||
},
|
||||
jay_config::keyboard::{mods::Modifiers, syms::KeySym, ModifiedKeySym},
|
||||
smallvec::SmallVec,
|
||||
std::{ops::Deref, rc::Rc},
|
||||
};
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct NodeSeatState {
|
||||
|
|
@ -126,23 +130,47 @@ impl WlSeatGlobal {
|
|||
mut x: Fixed,
|
||||
mut y: Fixed,
|
||||
) {
|
||||
let output = match self.state.connectors.get(&connector) {
|
||||
let output = match self.state.outputs.get(&connector) {
|
||||
Some(o) => o,
|
||||
_ => return,
|
||||
};
|
||||
let node = match output.node.get() {
|
||||
Some(n) => n,
|
||||
_ => return,
|
||||
};
|
||||
let pos = node.global.pos.get();
|
||||
let pos = output.node.global.pos.get();
|
||||
x += Fixed::from_int(pos.x1());
|
||||
y += Fixed::from_int(pos.y1());
|
||||
self.set_new_position(x, y);
|
||||
}
|
||||
|
||||
fn motion_event(self: &Rc<Self>, dx: Fixed, dy: Fixed) {
|
||||
let (x, y) = self.pos.get();
|
||||
self.set_new_position(x + dx, y + dy);
|
||||
let (mut x, mut y) = self.pos.get();
|
||||
x += dx;
|
||||
y += dy;
|
||||
let output = self.output.get();
|
||||
let pos = output.global.pos.get();
|
||||
let mut x_int = x.round_down();
|
||||
let mut y_int = y.round_down();
|
||||
if !pos.contains(x_int, y_int) {
|
||||
'warp: {
|
||||
let outputs = self.state.outputs.lock();
|
||||
for output in outputs.values() {
|
||||
if output.node.global.pos.get().contains(x_int, y_int) {
|
||||
break 'warp;
|
||||
}
|
||||
}
|
||||
if x_int < pos.x1() {
|
||||
x_int = pos.x1();
|
||||
} else if x_int >= pos.x2() {
|
||||
x_int = pos.x2() - 1;
|
||||
}
|
||||
if y_int < pos.y1() {
|
||||
y_int = pos.y1();
|
||||
} else if y_int >= pos.y2() {
|
||||
y_int = pos.y2() - 1;
|
||||
}
|
||||
x = x.apply_fract(x_int);
|
||||
y = y.apply_fract(y_int);
|
||||
}
|
||||
}
|
||||
self.set_new_position(x, y);
|
||||
}
|
||||
|
||||
fn key_event(&self, key: u32, state: KeyState) {
|
||||
|
|
@ -201,8 +229,10 @@ impl WlSeatGlobal {
|
|||
}
|
||||
|
||||
pub fn last_tiled_keyboard_toplevel(&self, new: &dyn Node) -> Option<Rc<dyn ToplevelNode>> {
|
||||
let output = self.output.get();
|
||||
let workspace = output.workspace.get().unwrap();
|
||||
let workspace = match self.output.get().workspace.get() {
|
||||
Some(ws) => ws,
|
||||
_ => return None,
|
||||
};
|
||||
let is_container = new.is_container();
|
||||
for tl in self.toplevel_focus_history.rev_iter() {
|
||||
match tl.as_node().get_workspace() {
|
||||
|
|
@ -448,10 +478,6 @@ impl WlSeatGlobal {
|
|||
self.surface_pointer_event(0, n, |p| p.send_leave(serial, n.id));
|
||||
self.surface_pointer_frame(n);
|
||||
}
|
||||
|
||||
pub fn leave_output(&self) {
|
||||
self.output.set(self.state.dummy_output.get().unwrap());
|
||||
}
|
||||
}
|
||||
|
||||
// Unfocus callbacks
|
||||
|
|
|
|||
|
|
@ -1,8 +1,11 @@
|
|||
use crate::ifs::wl_seat::WlSeatGlobal;
|
||||
use crate::tree::{Node, OutputNode};
|
||||
use crate::utils::clonecell::CloneCell;
|
||||
use std::ops::Deref;
|
||||
use std::rc::Rc;
|
||||
use {
|
||||
crate::{
|
||||
ifs::wl_seat::WlSeatGlobal,
|
||||
tree::{Node, OutputNode},
|
||||
utils::clonecell::CloneCell,
|
||||
},
|
||||
std::{ops::Deref, rc::Rc},
|
||||
};
|
||||
|
||||
pub struct KbOwnerHolder {
|
||||
default: Rc<DefaultKbOwner>,
|
||||
|
|
|
|||
|
|
@ -1,15 +1,18 @@
|
|||
use crate::backend::{KeyState, ScrollAxis};
|
||||
use crate::fixed::Fixed;
|
||||
use crate::ifs::ipc;
|
||||
use crate::ifs::ipc::wl_data_device::WlDataDevice;
|
||||
use crate::ifs::ipc::wl_data_source::WlDataSource;
|
||||
use crate::ifs::wl_seat::{Dnd, DroppedDnd, WlSeatError, WlSeatGlobal};
|
||||
use crate::ifs::wl_surface::WlSurface;
|
||||
use crate::tree::{FoundNode, Node};
|
||||
use crate::utils::clonecell::CloneCell;
|
||||
use crate::utils::smallmap::SmallMap;
|
||||
use std::cell::Cell;
|
||||
use std::rc::Rc;
|
||||
use {
|
||||
crate::{
|
||||
backend::{KeyState, ScrollAxis},
|
||||
fixed::Fixed,
|
||||
ifs::{
|
||||
ipc,
|
||||
ipc::{wl_data_device::WlDataDevice, wl_data_source::WlDataSource},
|
||||
wl_seat::{Dnd, DroppedDnd, WlSeatError, WlSeatGlobal},
|
||||
wl_surface::WlSurface,
|
||||
},
|
||||
tree::{FoundNode, Node},
|
||||
utils::{clonecell::CloneCell, smallmap::SmallMap},
|
||||
},
|
||||
std::{cell::Cell, rc::Rc},
|
||||
};
|
||||
|
||||
pub struct PointerOwnerHolder {
|
||||
default: Rc<DefaultPointerOwner>,
|
||||
|
|
|
|||
|
|
@ -1,14 +1,16 @@
|
|||
use crate::client::ClientError;
|
||||
use crate::ifs::wl_seat::WlSeat;
|
||||
use crate::leaks::Tracker;
|
||||
use crate::object::Object;
|
||||
use crate::utils::buffd::MsgParser;
|
||||
use crate::utils::buffd::MsgParserError;
|
||||
use crate::wire::wl_keyboard::*;
|
||||
use crate::wire::{WlKeyboardId, WlSurfaceId};
|
||||
use std::rc::Rc;
|
||||
use thiserror::Error;
|
||||
use uapi::OwnedFd;
|
||||
use {
|
||||
crate::{
|
||||
client::ClientError,
|
||||
ifs::wl_seat::WlSeat,
|
||||
leaks::Tracker,
|
||||
object::Object,
|
||||
utils::buffd::{MsgParser, MsgParserError},
|
||||
wire::{wl_keyboard::*, WlKeyboardId, WlSurfaceId},
|
||||
},
|
||||
std::rc::Rc,
|
||||
thiserror::Error,
|
||||
uapi::OwnedFd,
|
||||
};
|
||||
|
||||
pub const REPEAT_INFO_SINCE: u32 = 4;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,16 +1,17 @@
|
|||
use crate::client::ClientError;
|
||||
use crate::cursor::Cursor;
|
||||
use crate::fixed::Fixed;
|
||||
use crate::ifs::wl_seat::WlSeat;
|
||||
use crate::ifs::wl_surface::WlSurfaceError;
|
||||
use crate::leaks::Tracker;
|
||||
use crate::object::Object;
|
||||
use crate::utils::buffd::MsgParser;
|
||||
use crate::utils::buffd::MsgParserError;
|
||||
use crate::wire::wl_pointer::*;
|
||||
use crate::wire::{WlPointerId, WlSurfaceId};
|
||||
use std::rc::Rc;
|
||||
use thiserror::Error;
|
||||
use {
|
||||
crate::{
|
||||
client::ClientError,
|
||||
cursor::Cursor,
|
||||
fixed::Fixed,
|
||||
ifs::{wl_seat::WlSeat, wl_surface::WlSurfaceError},
|
||||
leaks::Tracker,
|
||||
object::Object,
|
||||
utils::buffd::{MsgParser, MsgParserError},
|
||||
wire::{wl_pointer::*, WlPointerId, WlSurfaceId},
|
||||
},
|
||||
std::rc::Rc,
|
||||
thiserror::Error,
|
||||
};
|
||||
|
||||
#[allow(dead_code)]
|
||||
const ROLE: u32 = 0;
|
||||
|
|
|
|||
|
|
@ -1,13 +1,15 @@
|
|||
use crate::client::ClientError;
|
||||
use crate::ifs::wl_seat::WlSeat;
|
||||
use crate::leaks::Tracker;
|
||||
use crate::object::Object;
|
||||
use crate::utils::buffd::MsgParser;
|
||||
use crate::utils::buffd::MsgParserError;
|
||||
use crate::wire::wl_touch::*;
|
||||
use crate::wire::WlTouchId;
|
||||
use std::rc::Rc;
|
||||
use thiserror::Error;
|
||||
use {
|
||||
crate::{
|
||||
client::ClientError,
|
||||
ifs::wl_seat::WlSeat,
|
||||
leaks::Tracker,
|
||||
object::Object,
|
||||
utils::buffd::{MsgParser, MsgParserError},
|
||||
wire::{wl_touch::*, WlTouchId},
|
||||
},
|
||||
std::rc::Rc,
|
||||
thiserror::Error,
|
||||
};
|
||||
|
||||
#[allow(dead_code)]
|
||||
const DOWN: u32 = 0;
|
||||
|
|
|
|||
|
|
@ -1,15 +1,17 @@
|
|||
use crate::client::{Client, ClientError};
|
||||
use crate::format::FORMATS;
|
||||
use crate::globals::{Global, GlobalName};
|
||||
use crate::ifs::wl_shm_pool::{WlShmPool, WlShmPoolError};
|
||||
use crate::leaks::Tracker;
|
||||
use crate::object::Object;
|
||||
use crate::utils::buffd::MsgParser;
|
||||
use crate::utils::buffd::MsgParserError;
|
||||
use crate::wire::wl_shm::*;
|
||||
use crate::wire::WlShmId;
|
||||
use std::rc::Rc;
|
||||
use thiserror::Error;
|
||||
use {
|
||||
crate::{
|
||||
client::{Client, ClientError},
|
||||
format::FORMATS,
|
||||
globals::{Global, GlobalName},
|
||||
ifs::wl_shm_pool::{WlShmPool, WlShmPoolError},
|
||||
leaks::Tracker,
|
||||
object::Object,
|
||||
utils::buffd::{MsgParser, MsgParserError},
|
||||
wire::{wl_shm::*, WlShmId},
|
||||
},
|
||||
std::rc::Rc,
|
||||
thiserror::Error,
|
||||
};
|
||||
|
||||
pub struct WlShmGlobal {
|
||||
name: GlobalName,
|
||||
|
|
|
|||
|
|
@ -1,17 +1,21 @@
|
|||
use crate::client::{Client, ClientError};
|
||||
use crate::clientmem::{ClientMem, ClientMemError};
|
||||
use crate::format::{formats, map_wayland_format_id};
|
||||
use crate::ifs::wl_buffer::{WlBuffer, WlBufferError};
|
||||
use crate::leaks::Tracker;
|
||||
use crate::object::Object;
|
||||
use crate::utils::buffd::MsgParser;
|
||||
use crate::utils::buffd::MsgParserError;
|
||||
use crate::utils::clonecell::CloneCell;
|
||||
use crate::wire::wl_shm_pool::*;
|
||||
use crate::wire::WlShmPoolId;
|
||||
use std::rc::Rc;
|
||||
use thiserror::Error;
|
||||
use uapi::OwnedFd;
|
||||
use {
|
||||
crate::{
|
||||
client::{Client, ClientError},
|
||||
clientmem::{ClientMem, ClientMemError},
|
||||
format::{formats, map_wayland_format_id},
|
||||
ifs::wl_buffer::{WlBuffer, WlBufferError},
|
||||
leaks::Tracker,
|
||||
object::Object,
|
||||
utils::{
|
||||
buffd::{MsgParser, MsgParserError},
|
||||
clonecell::CloneCell,
|
||||
},
|
||||
wire::{wl_shm_pool::*, WlShmPoolId},
|
||||
},
|
||||
std::rc::Rc,
|
||||
thiserror::Error,
|
||||
uapi::OwnedFd,
|
||||
};
|
||||
|
||||
pub struct WlShmPool {
|
||||
id: WlShmPoolId,
|
||||
|
|
|
|||
|
|
@ -1,14 +1,16 @@
|
|||
use crate::client::{Client, ClientError};
|
||||
use crate::globals::{Global, GlobalName};
|
||||
use crate::ifs::wl_surface::wl_subsurface::{WlSubsurface, WlSubsurfaceError};
|
||||
use crate::leaks::Tracker;
|
||||
use crate::object::Object;
|
||||
use crate::utils::buffd::MsgParser;
|
||||
use crate::utils::buffd::MsgParserError;
|
||||
use crate::wire::wl_subcompositor::*;
|
||||
use crate::wire::WlSubcompositorId;
|
||||
use std::rc::Rc;
|
||||
use thiserror::Error;
|
||||
use {
|
||||
crate::{
|
||||
client::{Client, ClientError},
|
||||
globals::{Global, GlobalName},
|
||||
ifs::wl_surface::wl_subsurface::{WlSubsurface, WlSubsurfaceError},
|
||||
leaks::Tracker,
|
||||
object::Object,
|
||||
utils::buffd::{MsgParser, MsgParserError},
|
||||
wire::{wl_subcompositor::*, WlSubcompositorId},
|
||||
},
|
||||
std::rc::Rc,
|
||||
thiserror::Error,
|
||||
};
|
||||
|
||||
#[allow(dead_code)]
|
||||
const BAD_SURFACE: u32 = 0;
|
||||
|
|
|
|||
|
|
@ -4,39 +4,49 @@ pub mod xdg_surface;
|
|||
pub mod xwindow;
|
||||
pub mod zwlr_layer_surface_v1;
|
||||
|
||||
use crate::backend::{KeyState, ScrollAxis};
|
||||
use crate::client::{Client, ClientError, RequestParser};
|
||||
use crate::fixed::Fixed;
|
||||
use crate::ifs::wl_buffer::WlBuffer;
|
||||
use crate::ifs::wl_callback::WlCallback;
|
||||
use crate::ifs::wl_seat::{Dnd, NodeSeatState, SeatId, WlSeatGlobal};
|
||||
use crate::ifs::wl_surface::cursor::CursorSurface;
|
||||
use crate::ifs::wl_surface::wl_subsurface::WlSubsurface;
|
||||
use crate::ifs::wl_surface::xdg_surface::XdgSurfaceError;
|
||||
use crate::ifs::wl_surface::zwlr_layer_surface_v1::ZwlrLayerSurfaceV1Error;
|
||||
use crate::leaks::Tracker;
|
||||
use crate::object::Object;
|
||||
use crate::rect::{Rect, Region};
|
||||
use crate::render::Renderer;
|
||||
use crate::tree::toplevel::ToplevelNode;
|
||||
use crate::tree::walker::NodeVisitor;
|
||||
use crate::tree::{ContainerNode, ContainerSplit, Node, NodeId, WorkspaceNode};
|
||||
use crate::utils::buffd::{MsgParser, MsgParserError};
|
||||
use crate::utils::clonecell::CloneCell;
|
||||
use crate::utils::linkedlist::LinkedList;
|
||||
use crate::utils::numcell::NumCell;
|
||||
use crate::utils::smallmap::SmallMap;
|
||||
use crate::wire::wl_surface::*;
|
||||
use crate::wire::{WlOutputId, WlSurfaceId};
|
||||
use crate::xkbcommon::ModifierState;
|
||||
use ahash::AHashMap;
|
||||
use jay_config::Direction;
|
||||
use std::cell::{Cell, RefCell};
|
||||
use std::fmt::{Debug, Formatter};
|
||||
use std::mem;
|
||||
use std::ops::{Deref, DerefMut};
|
||||
use std::rc::Rc;
|
||||
use thiserror::Error;
|
||||
use {
|
||||
crate::{
|
||||
backend::{KeyState, ScrollAxis},
|
||||
client::{Client, ClientError, RequestParser},
|
||||
fixed::Fixed,
|
||||
ifs::{
|
||||
wl_buffer::WlBuffer,
|
||||
wl_callback::WlCallback,
|
||||
wl_seat::{Dnd, NodeSeatState, SeatId, WlSeatGlobal},
|
||||
wl_surface::{
|
||||
cursor::CursorSurface, wl_subsurface::WlSubsurface, xdg_surface::XdgSurfaceError,
|
||||
zwlr_layer_surface_v1::ZwlrLayerSurfaceV1Error,
|
||||
},
|
||||
},
|
||||
leaks::Tracker,
|
||||
object::Object,
|
||||
rect::{Rect, Region},
|
||||
render::Renderer,
|
||||
tree::{
|
||||
ContainerNode, ContainerSplit, FindTreeResult, FoundNode, Node, NodeId, NodeVisitor,
|
||||
ToplevelNode, WorkspaceNode,
|
||||
},
|
||||
utils::{
|
||||
buffd::{MsgParser, MsgParserError},
|
||||
clonecell::CloneCell,
|
||||
linkedlist::LinkedList,
|
||||
numcell::NumCell,
|
||||
smallmap::SmallMap,
|
||||
},
|
||||
wire::{wl_surface::*, WlOutputId, WlSurfaceId},
|
||||
xkbcommon::ModifierState,
|
||||
},
|
||||
ahash::AHashMap,
|
||||
jay_config::Direction,
|
||||
std::{
|
||||
cell::{Cell, RefCell},
|
||||
fmt::{Debug, Formatter},
|
||||
mem,
|
||||
ops::{Deref, DerefMut},
|
||||
rc::Rc,
|
||||
},
|
||||
thiserror::Error,
|
||||
};
|
||||
|
||||
#[allow(dead_code)]
|
||||
const INVALID_SCALE: u32 = 0;
|
||||
|
|
@ -365,7 +375,11 @@ impl WlSurface {
|
|||
}
|
||||
*children = None;
|
||||
}
|
||||
self.buffer.set(None);
|
||||
if let Some(buffer) = self.buffer.set(None) {
|
||||
if !buffer.destroyed() {
|
||||
buffer.send_release();
|
||||
}
|
||||
}
|
||||
self.frame_requests.borrow_mut().clear();
|
||||
self.toplevel.set(None);
|
||||
self.client.remove_obj(self)?;
|
||||
|
|
@ -558,6 +572,16 @@ impl WlSurface {
|
|||
}
|
||||
None
|
||||
}
|
||||
|
||||
fn find_tree_at_(self: &Rc<Self>, x: i32, y: i32, tree: &mut Vec<FoundNode>) -> FindTreeResult {
|
||||
match self.find_surface_at(x, y) {
|
||||
Some((node, x, y)) => {
|
||||
tree.push(FoundNode { node, x, y });
|
||||
FindTreeResult::AcceptsInput
|
||||
}
|
||||
_ => FindTreeResult::Other,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
object_base! {
|
||||
|
|
|
|||
|
|
@ -1,11 +1,13 @@
|
|||
use crate::cursor::Cursor;
|
||||
use crate::ifs::wl_seat::WlSeatGlobal;
|
||||
use crate::ifs::wl_surface::WlSurface;
|
||||
use crate::leaks::Tracker;
|
||||
use crate::rect::Rect;
|
||||
use crate::render::Renderer;
|
||||
use std::cell::Cell;
|
||||
use std::rc::Rc;
|
||||
use {
|
||||
crate::{
|
||||
cursor::Cursor,
|
||||
ifs::{wl_seat::WlSeatGlobal, wl_surface::WlSurface},
|
||||
leaks::Tracker,
|
||||
rect::Rect,
|
||||
render::Renderer,
|
||||
},
|
||||
std::{cell::Cell, rc::Rc},
|
||||
};
|
||||
|
||||
pub struct CursorSurface {
|
||||
seat: Rc<WlSeatGlobal>,
|
||||
|
|
|
|||
|
|
@ -1,21 +1,27 @@
|
|||
use crate::client::ClientError;
|
||||
use crate::ifs::wl_surface::{
|
||||
CommitAction, CommitContext, StackElement, SurfaceExt, SurfaceRole, WlSurface, WlSurfaceError,
|
||||
WlSurfaceId,
|
||||
use {
|
||||
crate::{
|
||||
client::ClientError,
|
||||
ifs::wl_surface::{
|
||||
CommitAction, CommitContext, StackElement, SurfaceExt, SurfaceRole, WlSurface,
|
||||
WlSurfaceError, WlSurfaceId,
|
||||
},
|
||||
leaks::Tracker,
|
||||
object::Object,
|
||||
rect::Rect,
|
||||
utils::{
|
||||
buffd::{MsgParser, MsgParserError},
|
||||
linkedlist::LinkedNode,
|
||||
numcell::NumCell,
|
||||
},
|
||||
wire::{wl_subsurface::*, WlSubsurfaceId},
|
||||
},
|
||||
std::{
|
||||
cell::{Cell, RefCell},
|
||||
ops::Deref,
|
||||
rc::Rc,
|
||||
},
|
||||
thiserror::Error,
|
||||
};
|
||||
use crate::leaks::Tracker;
|
||||
use crate::object::Object;
|
||||
use crate::rect::Rect;
|
||||
use crate::utils::buffd::MsgParser;
|
||||
use crate::utils::buffd::MsgParserError;
|
||||
use crate::utils::linkedlist::LinkedNode;
|
||||
use crate::utils::numcell::NumCell;
|
||||
use crate::wire::wl_subsurface::*;
|
||||
use crate::wire::WlSubsurfaceId;
|
||||
use std::cell::{Cell, RefCell};
|
||||
use std::ops::Deref;
|
||||
use std::rc::Rc;
|
||||
use thiserror::Error;
|
||||
|
||||
#[allow(dead_code)]
|
||||
const BAD_SURFACE: u32 = 0;
|
||||
|
|
|
|||
|
|
@ -1,29 +1,35 @@
|
|||
pub mod xdg_popup;
|
||||
pub mod xdg_toplevel;
|
||||
|
||||
use crate::client::ClientError;
|
||||
use crate::ifs::wl_seat::NodeSeatState;
|
||||
use crate::ifs::wl_surface::xdg_surface::xdg_popup::{XdgPopup, XdgPopupError};
|
||||
use crate::ifs::wl_surface::xdg_surface::xdg_toplevel::XdgToplevel;
|
||||
use crate::ifs::wl_surface::{
|
||||
CommitAction, CommitContext, SurfaceExt, SurfaceRole, WlSurface, WlSurfaceError,
|
||||
use {
|
||||
crate::{
|
||||
client::ClientError,
|
||||
ifs::{
|
||||
wl_seat::NodeSeatState,
|
||||
wl_surface::{
|
||||
xdg_surface::{
|
||||
xdg_popup::{XdgPopup, XdgPopupError},
|
||||
xdg_toplevel::XdgToplevel,
|
||||
},
|
||||
CommitAction, CommitContext, SurfaceExt, SurfaceRole, WlSurface, WlSurfaceError,
|
||||
},
|
||||
xdg_wm_base::XdgWmBase,
|
||||
},
|
||||
leaks::Tracker,
|
||||
object::Object,
|
||||
rect::Rect,
|
||||
tree::{FindTreeResult, FoundNode, Node, WorkspaceNode},
|
||||
utils::{
|
||||
buffd::{MsgParser, MsgParserError},
|
||||
clonecell::CloneCell,
|
||||
copyhashmap::CopyHashMap,
|
||||
numcell::NumCell,
|
||||
},
|
||||
wire::{xdg_surface::*, WlSurfaceId, XdgPopupId, XdgSurfaceId},
|
||||
},
|
||||
std::{cell::Cell, fmt::Debug, rc::Rc},
|
||||
thiserror::Error,
|
||||
};
|
||||
use crate::ifs::xdg_wm_base::XdgWmBase;
|
||||
use crate::leaks::Tracker;
|
||||
use crate::object::Object;
|
||||
use crate::rect::Rect;
|
||||
use crate::tree::{FindTreeResult, FoundNode, Node, WorkspaceNode};
|
||||
use crate::utils::buffd::MsgParser;
|
||||
use crate::utils::buffd::MsgParserError;
|
||||
use crate::utils::clonecell::CloneCell;
|
||||
use crate::utils::copyhashmap::CopyHashMap;
|
||||
use crate::utils::numcell::NumCell;
|
||||
use crate::wire::xdg_surface::*;
|
||||
use crate::wire::{WlSurfaceId, XdgPopupId, XdgSurfaceId};
|
||||
use std::cell::Cell;
|
||||
use std::fmt::Debug;
|
||||
use std::rc::Rc;
|
||||
use thiserror::Error;
|
||||
|
||||
#[allow(dead_code)]
|
||||
const NOT_CONSTRUCTED: u32 = 1;
|
||||
|
|
@ -284,13 +290,7 @@ impl XdgSurface {
|
|||
x = xt;
|
||||
y = yt;
|
||||
}
|
||||
match self.surface.find_surface_at(x, y) {
|
||||
Some((node, x, y)) => {
|
||||
tree.push(FoundNode { node, x, y });
|
||||
FindTreeResult::AcceptsInput
|
||||
}
|
||||
_ => FindTreeResult::Other,
|
||||
}
|
||||
self.surface.find_tree_at_(x, y, tree)
|
||||
}
|
||||
|
||||
fn update_popup_positions(&self) {
|
||||
|
|
|
|||
|
|
@ -1,25 +1,32 @@
|
|||
use crate::client::{Client, ClientError};
|
||||
use crate::cursor::KnownCursor;
|
||||
use crate::fixed::Fixed;
|
||||
use crate::ifs::wl_seat::{NodeSeatState, WlSeatGlobal};
|
||||
use crate::ifs::wl_surface::xdg_surface::{XdgSurface, XdgSurfaceError, XdgSurfaceExt};
|
||||
use crate::ifs::xdg_positioner::{XdgPositioned, XdgPositioner, CA};
|
||||
use crate::leaks::Tracker;
|
||||
use crate::object::Object;
|
||||
use crate::rect::Rect;
|
||||
use crate::render::Renderer;
|
||||
use crate::tree::walker::NodeVisitor;
|
||||
use crate::tree::{FindTreeResult, FoundNode, Node, NodeId, WorkspaceNode};
|
||||
use crate::utils::buffd::MsgParser;
|
||||
use crate::utils::buffd::MsgParserError;
|
||||
use crate::utils::clonecell::CloneCell;
|
||||
use crate::utils::linkedlist::LinkedNode;
|
||||
use crate::wire::xdg_popup::*;
|
||||
use crate::wire::XdgPopupId;
|
||||
use std::cell::{Cell, RefCell};
|
||||
use std::fmt::{Debug, Formatter};
|
||||
use std::rc::Rc;
|
||||
use thiserror::Error;
|
||||
use {
|
||||
crate::{
|
||||
client::{Client, ClientError},
|
||||
cursor::KnownCursor,
|
||||
fixed::Fixed,
|
||||
ifs::{
|
||||
wl_seat::{NodeSeatState, WlSeatGlobal},
|
||||
wl_surface::xdg_surface::{XdgSurface, XdgSurfaceError, XdgSurfaceExt},
|
||||
xdg_positioner::{XdgPositioned, XdgPositioner, CA},
|
||||
},
|
||||
leaks::Tracker,
|
||||
object::Object,
|
||||
rect::Rect,
|
||||
render::Renderer,
|
||||
tree::{FindTreeResult, FoundNode, Node, NodeId, NodeVisitor, WorkspaceNode},
|
||||
utils::{
|
||||
buffd::{MsgParser, MsgParserError},
|
||||
clonecell::CloneCell,
|
||||
linkedlist::LinkedNode,
|
||||
},
|
||||
wire::{xdg_popup::*, XdgPopupId},
|
||||
},
|
||||
std::{
|
||||
cell::{Cell, RefCell},
|
||||
fmt::{Debug, Formatter},
|
||||
rc::Rc,
|
||||
},
|
||||
thiserror::Error,
|
||||
};
|
||||
|
||||
#[allow(dead_code)]
|
||||
const INVALID_GRAB: u32 = 1;
|
||||
|
|
|
|||
|
|
@ -1,33 +1,43 @@
|
|||
use crate::bugs;
|
||||
use crate::bugs::Bugs;
|
||||
use crate::client::{Client, ClientError};
|
||||
use crate::cursor::KnownCursor;
|
||||
use crate::fixed::Fixed;
|
||||
use crate::ifs::wl_seat::{NodeSeatState, WlSeatGlobal};
|
||||
use crate::ifs::wl_surface::xdg_surface::{XdgSurface, XdgSurfaceError, XdgSurfaceExt};
|
||||
use crate::ifs::wl_surface::WlSurface;
|
||||
use crate::leaks::Tracker;
|
||||
use crate::object::Object;
|
||||
use crate::rect::Rect;
|
||||
use crate::render::Renderer;
|
||||
use crate::tree::toplevel::{ToplevelData, ToplevelNode};
|
||||
use crate::tree::walker::NodeVisitor;
|
||||
use crate::tree::FindTreeResult;
|
||||
use crate::tree::{FoundNode, Node, NodeId, ToplevelNodeId, WorkspaceNode};
|
||||
use crate::utils::buffd::MsgParser;
|
||||
use crate::utils::buffd::MsgParserError;
|
||||
use crate::utils::clonecell::CloneCell;
|
||||
use crate::wire::xdg_toplevel::*;
|
||||
use crate::wire::XdgToplevelId;
|
||||
use ahash::{AHashMap, AHashSet};
|
||||
use jay_config::Direction;
|
||||
use num_derive::FromPrimitive;
|
||||
use std::cell::{Cell, RefCell};
|
||||
use std::fmt::{Debug, Formatter};
|
||||
use std::mem;
|
||||
use std::ops::Deref;
|
||||
use std::rc::Rc;
|
||||
use thiserror::Error;
|
||||
use {
|
||||
crate::{
|
||||
bugs,
|
||||
bugs::Bugs,
|
||||
client::{Client, ClientError},
|
||||
cursor::KnownCursor,
|
||||
fixed::Fixed,
|
||||
ifs::{
|
||||
wl_seat::{NodeSeatState, WlSeatGlobal},
|
||||
wl_surface::{
|
||||
xdg_surface::{XdgSurface, XdgSurfaceError, XdgSurfaceExt},
|
||||
WlSurface,
|
||||
},
|
||||
},
|
||||
leaks::Tracker,
|
||||
object::Object,
|
||||
rect::Rect,
|
||||
render::Renderer,
|
||||
tree::{
|
||||
FindTreeResult, FoundNode, Node, NodeId, NodeVisitor, ToplevelData, ToplevelNode,
|
||||
ToplevelNodeId, WorkspaceNode,
|
||||
},
|
||||
utils::{
|
||||
buffd::{MsgParser, MsgParserError},
|
||||
clonecell::CloneCell,
|
||||
},
|
||||
wire::{xdg_toplevel::*, XdgToplevelId},
|
||||
},
|
||||
ahash::{AHashMap, AHashSet},
|
||||
jay_config::Direction,
|
||||
num_derive::FromPrimitive,
|
||||
std::{
|
||||
cell::{Cell, RefCell},
|
||||
fmt::{Debug, Formatter},
|
||||
mem,
|
||||
ops::Deref,
|
||||
rc::Rc,
|
||||
},
|
||||
thiserror::Error,
|
||||
};
|
||||
|
||||
#[derive(Copy, Clone, Debug, FromPrimitive)]
|
||||
pub enum ResizeEdge {
|
||||
|
|
|
|||
|
|
@ -1,28 +1,36 @@
|
|||
use crate::client::Client;
|
||||
use crate::cursor::KnownCursor;
|
||||
use crate::fixed::Fixed;
|
||||
use crate::ifs::wl_seat::{NodeSeatState, SeatId, WlSeatGlobal};
|
||||
use crate::ifs::wl_surface::{SurfaceExt, SurfaceRole, WlSurface, WlSurfaceError};
|
||||
use crate::rect::Rect;
|
||||
use crate::render::Renderer;
|
||||
use crate::state::State;
|
||||
use crate::tree::toplevel::{ToplevelData, ToplevelNode};
|
||||
use crate::tree::walker::NodeVisitor;
|
||||
use crate::tree::{FindTreeResult, FoundNode, Node, NodeId, WorkspaceNode};
|
||||
use crate::utils::clonecell::CloneCell;
|
||||
use crate::utils::copyhashmap::CopyHashMap;
|
||||
use crate::utils::linkedlist::LinkedNode;
|
||||
use crate::utils::queue::AsyncQueue;
|
||||
use crate::utils::smallmap::SmallMap;
|
||||
use crate::wire::WlSurfaceId;
|
||||
use crate::wire_xcon::CreateNotify;
|
||||
use crate::xwayland::XWaylandEvent;
|
||||
use bstr::BString;
|
||||
use jay_config::Direction;
|
||||
use std::cell::{Cell, RefCell};
|
||||
use std::ops::{Deref, Not};
|
||||
use std::rc::Rc;
|
||||
use thiserror::Error;
|
||||
use {
|
||||
crate::{
|
||||
client::Client,
|
||||
cursor::KnownCursor,
|
||||
fixed::Fixed,
|
||||
ifs::{
|
||||
wl_seat::{NodeSeatState, SeatId, WlSeatGlobal},
|
||||
wl_surface::{SurfaceExt, SurfaceRole, WlSurface, WlSurfaceError},
|
||||
},
|
||||
rect::Rect,
|
||||
render::Renderer,
|
||||
state::State,
|
||||
tree::{
|
||||
FindTreeResult, FoundNode, Node, NodeId, NodeVisitor, ToplevelData, ToplevelNode,
|
||||
WorkspaceNode,
|
||||
},
|
||||
utils::{
|
||||
clonecell::CloneCell, copyhashmap::CopyHashMap, linkedlist::LinkedNode,
|
||||
queue::AsyncQueue, smallmap::SmallMap,
|
||||
},
|
||||
wire::WlSurfaceId,
|
||||
wire_xcon::CreateNotify,
|
||||
xwayland::XWaylandEvent,
|
||||
},
|
||||
bstr::BString,
|
||||
jay_config::Direction,
|
||||
std::{
|
||||
cell::{Cell, RefCell},
|
||||
ops::{Deref, Not},
|
||||
rc::Rc,
|
||||
},
|
||||
thiserror::Error,
|
||||
};
|
||||
|
||||
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
|
||||
pub enum XInputModel {
|
||||
|
|
@ -275,20 +283,16 @@ impl Xwindow {
|
|||
self.data.state.tree_changed();
|
||||
}
|
||||
Change::Map if self.data.info.wants_floating.get() => {
|
||||
let ws = self
|
||||
.data
|
||||
.state
|
||||
.root
|
||||
.outputs
|
||||
.lock()
|
||||
.iter()
|
||||
.next()
|
||||
.unwrap()
|
||||
.1
|
||||
.workspace
|
||||
.get()
|
||||
.unwrap();
|
||||
// todo
|
||||
let ws = match self.data.state.root.outputs.lock().values().cloned().next() {
|
||||
Some(output) => output.ensure_workspace(),
|
||||
_ => self
|
||||
.data
|
||||
.state
|
||||
.dummy_output
|
||||
.get()
|
||||
.unwrap()
|
||||
.ensure_workspace(),
|
||||
};
|
||||
let ext = self.data.info.extents.get();
|
||||
self.data
|
||||
.state
|
||||
|
|
|
|||
|
|
@ -1,26 +1,29 @@
|
|||
use crate::client::{Client, ClientError};
|
||||
use crate::ifs::wl_seat::NodeSeatState;
|
||||
use crate::ifs::wl_surface::{
|
||||
CommitAction, CommitContext, SurfaceExt, SurfaceRole, WlSurface, WlSurfaceError,
|
||||
use {
|
||||
crate::{
|
||||
client::{Client, ClientError},
|
||||
ifs::{
|
||||
wl_seat::NodeSeatState,
|
||||
wl_surface::{
|
||||
CommitAction, CommitContext, SurfaceExt, SurfaceRole, WlSurface, WlSurfaceError,
|
||||
},
|
||||
zwlr_layer_shell_v1::{ZwlrLayerShellV1, OVERLAY},
|
||||
},
|
||||
leaks::Tracker,
|
||||
object::Object,
|
||||
rect::Rect,
|
||||
render::Renderer,
|
||||
tree::{FindTreeResult, FoundNode, Node, NodeId, NodeVisitor, OutputNode},
|
||||
utils::{
|
||||
bitflags::BitflagsExt,
|
||||
buffd::{MsgParser, MsgParserError},
|
||||
linkedlist::LinkedNode,
|
||||
numcell::NumCell,
|
||||
},
|
||||
wire::{zwlr_layer_surface_v1::*, WlSurfaceId, ZwlrLayerSurfaceV1Id},
|
||||
},
|
||||
std::{cell::Cell, ops::Deref, rc::Rc},
|
||||
thiserror::Error,
|
||||
};
|
||||
use crate::ifs::zwlr_layer_shell_v1::{ZwlrLayerShellV1, OVERLAY};
|
||||
use crate::leaks::Tracker;
|
||||
use crate::object::Object;
|
||||
use crate::rect::Rect;
|
||||
use crate::render::Renderer;
|
||||
use crate::tree::walker::NodeVisitor;
|
||||
use crate::tree::{FindTreeResult, FoundNode, Node, NodeId, OutputNode};
|
||||
use crate::utils::bitflags::BitflagsExt;
|
||||
use crate::utils::buffd::MsgParser;
|
||||
use crate::utils::buffd::MsgParserError;
|
||||
use crate::utils::linkedlist::LinkedNode;
|
||||
use crate::utils::numcell::NumCell;
|
||||
use crate::wire::zwlr_layer_surface_v1::*;
|
||||
use crate::wire::{WlSurfaceId, ZwlrLayerSurfaceV1Id};
|
||||
use std::cell::Cell;
|
||||
use std::ops::Deref;
|
||||
use std::rc::Rc;
|
||||
use thiserror::Error;
|
||||
|
||||
const KI_NONE: u32 = 0;
|
||||
#[allow(dead_code)]
|
||||
|
|
@ -65,6 +68,7 @@ struct Pending {
|
|||
margin: Cell<Option<(i32, i32, i32, i32)>>,
|
||||
keyboard_interactivity: Cell<Option<u32>>,
|
||||
layer: Cell<Option<u32>>,
|
||||
any: Cell<bool>,
|
||||
}
|
||||
|
||||
impl ZwlrLayerSurfaceV1 {
|
||||
|
|
@ -132,6 +136,7 @@ impl ZwlrLayerSurfaceV1 {
|
|||
self.pending
|
||||
.size
|
||||
.set(Some((req.width as _, req.height as _)));
|
||||
self.pending.any.set(true);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
|
@ -141,12 +146,14 @@ impl ZwlrLayerSurfaceV1 {
|
|||
return Err(SetAnchorError::UnknownAnchor(req.anchor));
|
||||
}
|
||||
self.pending.anchor.set(Some(req.anchor));
|
||||
self.pending.any.set(true);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn set_exclusive_zone(&self, parser: MsgParser<'_, '_>) -> Result<(), SetExclusiveZoneError> {
|
||||
let req: SetExclusiveZone = self.client.parse(self, parser)?;
|
||||
self.pending.exclusive_zone.set(Some(req.zone));
|
||||
self.pending.any.set(true);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
|
@ -155,6 +162,7 @@ impl ZwlrLayerSurfaceV1 {
|
|||
self.pending
|
||||
.margin
|
||||
.set(Some((req.top, req.right, req.bottom, req.left)));
|
||||
self.pending.any.set(true);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
|
@ -171,6 +179,7 @@ impl ZwlrLayerSurfaceV1 {
|
|||
self.pending
|
||||
.keyboard_interactivity
|
||||
.set(Some(req.keyboard_interactivity));
|
||||
self.pending.any.set(true);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
|
@ -199,11 +208,12 @@ impl ZwlrLayerSurfaceV1 {
|
|||
return Err(SetLayerError::UnknownLayer(req.layer));
|
||||
}
|
||||
self.pending.layer.set(Some(req.layer));
|
||||
self.pending.any.set(true);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn pre_commit(&self) -> Result<(), ZwlrLayerSurfaceV1Error> {
|
||||
let mut send_configure = false;
|
||||
let mut send_configure = self.pending.any.replace(false);
|
||||
if let Some(size) = self.pending.size.take() {
|
||||
self.size.set(size);
|
||||
}
|
||||
|
|
@ -370,7 +380,7 @@ impl Node for ZwlrLayerSurfaceV1 {
|
|||
x,
|
||||
y,
|
||||
});
|
||||
self.surface.find_tree_at(x, y, tree)
|
||||
self.surface.find_tree_at_(x, y, tree)
|
||||
}
|
||||
|
||||
fn render(&self, renderer: &mut Renderer, x: i32, y: i32) {
|
||||
|
|
|
|||
|
|
@ -1,16 +1,17 @@
|
|||
use crate::client::{Client, ClientError};
|
||||
use crate::ifs::xdg_wm_base::XdgWmBase;
|
||||
use crate::leaks::Tracker;
|
||||
use crate::object::Object;
|
||||
use crate::rect::Rect;
|
||||
use crate::utils::buffd::MsgParser;
|
||||
use crate::utils::buffd::MsgParserError;
|
||||
use crate::wire::xdg_positioner::*;
|
||||
use crate::wire::XdgPositionerId;
|
||||
use bitflags::bitflags;
|
||||
use std::cell::RefCell;
|
||||
use std::rc::Rc;
|
||||
use thiserror::Error;
|
||||
use {
|
||||
crate::{
|
||||
client::{Client, ClientError},
|
||||
ifs::xdg_wm_base::XdgWmBase,
|
||||
leaks::Tracker,
|
||||
object::Object,
|
||||
rect::Rect,
|
||||
utils::buffd::{MsgParser, MsgParserError},
|
||||
wire::{xdg_positioner::*, XdgPositionerId},
|
||||
},
|
||||
bitflags::bitflags,
|
||||
std::{cell::RefCell, rc::Rc},
|
||||
thiserror::Error,
|
||||
};
|
||||
|
||||
const INVALID_INPUT: u32 = 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,16 +1,22 @@
|
|||
use crate::client::{Client, ClientError};
|
||||
use crate::globals::{Global, GlobalName};
|
||||
use crate::ifs::wl_surface::xdg_surface::{XdgSurface, XdgSurfaceError};
|
||||
use crate::ifs::xdg_positioner::XdgPositioner;
|
||||
use crate::leaks::Tracker;
|
||||
use crate::object::Object;
|
||||
use crate::utils::buffd::MsgParser;
|
||||
use crate::utils::buffd::MsgParserError;
|
||||
use crate::utils::copyhashmap::CopyHashMap;
|
||||
use crate::wire::xdg_wm_base::*;
|
||||
use crate::wire::{XdgSurfaceId, XdgWmBaseId};
|
||||
use std::rc::Rc;
|
||||
use thiserror::Error;
|
||||
use {
|
||||
crate::{
|
||||
client::{Client, ClientError},
|
||||
globals::{Global, GlobalName},
|
||||
ifs::{
|
||||
wl_surface::xdg_surface::{XdgSurface, XdgSurfaceError},
|
||||
xdg_positioner::XdgPositioner,
|
||||
},
|
||||
leaks::Tracker,
|
||||
object::Object,
|
||||
utils::{
|
||||
buffd::{MsgParser, MsgParserError},
|
||||
copyhashmap::CopyHashMap,
|
||||
},
|
||||
wire::{xdg_wm_base::*, XdgSurfaceId, XdgWmBaseId},
|
||||
},
|
||||
std::rc::Rc,
|
||||
thiserror::Error,
|
||||
};
|
||||
|
||||
#[allow(dead_code)]
|
||||
const ROLE: u32 = 0;
|
||||
|
|
|
|||
|
|
@ -1,20 +1,21 @@
|
|||
use crate::client::{Client, ClientError};
|
||||
use crate::globals::{Global, GlobalName};
|
||||
use crate::ifs::wl_surface::zwlr_layer_surface_v1::{ZwlrLayerSurfaceV1, ZwlrLayerSurfaceV1Error};
|
||||
use crate::leaks::Tracker;
|
||||
use crate::object::Object;
|
||||
use crate::utils::buffd::MsgParser;
|
||||
use crate::utils::buffd::MsgParserError;
|
||||
use crate::wire::zwlr_layer_shell_v1::*;
|
||||
use crate::wire::ZwlrLayerShellV1Id;
|
||||
use std::rc::Rc;
|
||||
use thiserror::Error;
|
||||
use {
|
||||
crate::{
|
||||
client::{Client, ClientError},
|
||||
globals::{Global, GlobalName},
|
||||
ifs::wl_surface::zwlr_layer_surface_v1::{ZwlrLayerSurfaceV1, ZwlrLayerSurfaceV1Error},
|
||||
leaks::Tracker,
|
||||
object::Object,
|
||||
utils::buffd::{MsgParser, MsgParserError},
|
||||
wire::{zwlr_layer_shell_v1::*, ZwlrLayerShellV1Id},
|
||||
},
|
||||
std::rc::Rc,
|
||||
thiserror::Error,
|
||||
};
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub const BACKGROUND: u32 = 0;
|
||||
#[allow(dead_code)]
|
||||
pub const BOTTOM: u32 = 1;
|
||||
#[allow(dead_code)]
|
||||
pub const TOP: u32 = 2;
|
||||
pub const OVERLAY: u32 = 3;
|
||||
|
||||
|
|
@ -75,16 +76,13 @@ impl ZwlrLayerShellV1 {
|
|||
break 'get_output output;
|
||||
}
|
||||
}
|
||||
let outputs = self.client.state.connectors.lock();
|
||||
for output in outputs.values() {
|
||||
if let Some(node) = output.node.get() {
|
||||
break 'get_output node;
|
||||
}
|
||||
let outputs = self.client.state.outputs.lock();
|
||||
if let Some(output) = outputs.values().next() {
|
||||
break 'get_output output.node.clone();
|
||||
}
|
||||
return Err(GetLayerSurfaceError::NoOutputs);
|
||||
}
|
||||
};
|
||||
log::info!("output = {:?}", output.global.pos.get());
|
||||
if req.layer > OVERLAY {
|
||||
return Err(GetLayerSurfaceError::UnknownLayer(req.layer));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,20 +1,27 @@
|
|||
use crate::client::ClientError;
|
||||
use crate::drm::dma::{DmaBuf, DmaBufPlane};
|
||||
use crate::drm::INVALID_MODIFIER;
|
||||
use crate::ifs::wl_buffer::WlBuffer;
|
||||
use crate::ifs::zwp_linux_dmabuf_v1::ZwpLinuxDmabufV1;
|
||||
use crate::leaks::Tracker;
|
||||
use crate::object::Object;
|
||||
use crate::render::RenderError;
|
||||
use crate::utils::buffd::MsgParser;
|
||||
use crate::utils::buffd::MsgParserError;
|
||||
use crate::utils::errorfmt::ErrorFmt;
|
||||
use crate::wire::zwp_linux_buffer_params_v1::*;
|
||||
use crate::wire::{WlBufferId, ZwpLinuxBufferParamsV1Id};
|
||||
use ahash::AHashMap;
|
||||
use std::cell::{Cell, RefCell};
|
||||
use std::rc::Rc;
|
||||
use thiserror::Error;
|
||||
use {
|
||||
crate::{
|
||||
client::ClientError,
|
||||
video::{
|
||||
dma::{DmaBuf, DmaBufPlane},
|
||||
INVALID_MODIFIER,
|
||||
},
|
||||
ifs::{wl_buffer::WlBuffer, zwp_linux_dmabuf_v1::ZwpLinuxDmabufV1},
|
||||
leaks::Tracker,
|
||||
object::Object,
|
||||
render::RenderError,
|
||||
utils::{
|
||||
buffd::{MsgParser, MsgParserError},
|
||||
errorfmt::ErrorFmt,
|
||||
},
|
||||
wire::{zwp_linux_buffer_params_v1::*, WlBufferId, ZwpLinuxBufferParamsV1Id},
|
||||
},
|
||||
ahash::AHashMap,
|
||||
std::{
|
||||
cell::{Cell, RefCell},
|
||||
rc::Rc,
|
||||
},
|
||||
thiserror::Error,
|
||||
};
|
||||
|
||||
#[allow(dead_code)]
|
||||
const Y_INVERT: u32 = 1;
|
||||
|
|
|
|||
|
|
@ -1,15 +1,17 @@
|
|||
use crate::client::{Client, ClientError};
|
||||
use crate::drm::INVALID_MODIFIER;
|
||||
use crate::globals::{Global, GlobalName};
|
||||
use crate::ifs::zwp_linux_buffer_params_v1::ZwpLinuxBufferParamsV1;
|
||||
use crate::leaks::Tracker;
|
||||
use crate::object::Object;
|
||||
use crate::utils::buffd::MsgParser;
|
||||
use crate::utils::buffd::MsgParserError;
|
||||
use crate::wire::zwp_linux_dmabuf_v1::*;
|
||||
use crate::wire::ZwpLinuxDmabufV1Id;
|
||||
use std::rc::Rc;
|
||||
use thiserror::Error;
|
||||
use {
|
||||
crate::{
|
||||
client::{Client, ClientError},
|
||||
video::INVALID_MODIFIER,
|
||||
globals::{Global, GlobalName},
|
||||
ifs::zwp_linux_buffer_params_v1::ZwpLinuxBufferParamsV1,
|
||||
leaks::Tracker,
|
||||
object::Object,
|
||||
utils::buffd::{MsgParser, MsgParserError},
|
||||
wire::{zwp_linux_dmabuf_v1::*, ZwpLinuxDmabufV1Id},
|
||||
},
|
||||
std::rc::Rc,
|
||||
thiserror::Error,
|
||||
};
|
||||
|
||||
pub struct ZwpLinuxDmabufV1Global {
|
||||
name: GlobalName,
|
||||
|
|
|
|||
|
|
@ -1,13 +1,16 @@
|
|||
use crate::client::{Client, ClientError};
|
||||
use crate::globals::{Global, GlobalName};
|
||||
use crate::ifs::zxdg_toplevel_decoration_v1::ZxdgToplevelDecorationV1;
|
||||
use crate::leaks::Tracker;
|
||||
use crate::object::Object;
|
||||
use crate::utils::buffd::{MsgParser, MsgParserError};
|
||||
use crate::wire::zxdg_decoration_manager_v1::*;
|
||||
use crate::wire::ZxdgDecorationManagerV1Id;
|
||||
use std::rc::Rc;
|
||||
use thiserror::Error;
|
||||
use {
|
||||
crate::{
|
||||
client::{Client, ClientError},
|
||||
globals::{Global, GlobalName},
|
||||
ifs::zxdg_toplevel_decoration_v1::ZxdgToplevelDecorationV1,
|
||||
leaks::Tracker,
|
||||
object::Object,
|
||||
utils::buffd::{MsgParser, MsgParserError},
|
||||
wire::{zxdg_decoration_manager_v1::*, ZxdgDecorationManagerV1Id},
|
||||
},
|
||||
std::rc::Rc,
|
||||
thiserror::Error,
|
||||
};
|
||||
|
||||
pub struct ZxdgDecorationManagerV1Global {
|
||||
name: GlobalName,
|
||||
|
|
|
|||
|
|
@ -1,14 +1,16 @@
|
|||
use crate::client::{Client, ClientError};
|
||||
use crate::globals::{Global, GlobalName};
|
||||
use crate::ifs::zxdg_output_v1::ZxdgOutputV1;
|
||||
use crate::leaks::Tracker;
|
||||
use crate::object::Object;
|
||||
use crate::utils::buffd::MsgParser;
|
||||
use crate::utils::buffd::MsgParserError;
|
||||
use crate::wire::zxdg_output_manager_v1::*;
|
||||
use crate::wire::ZxdgOutputManagerV1Id;
|
||||
use std::rc::Rc;
|
||||
use thiserror::Error;
|
||||
use {
|
||||
crate::{
|
||||
client::{Client, ClientError},
|
||||
globals::{Global, GlobalName},
|
||||
ifs::zxdg_output_v1::ZxdgOutputV1,
|
||||
leaks::Tracker,
|
||||
object::Object,
|
||||
utils::buffd::{MsgParser, MsgParserError},
|
||||
wire::{zxdg_output_manager_v1::*, ZxdgOutputManagerV1Id},
|
||||
},
|
||||
std::rc::Rc,
|
||||
thiserror::Error,
|
||||
};
|
||||
|
||||
pub struct ZxdgOutputManagerV1Global {
|
||||
name: GlobalName,
|
||||
|
|
|
|||
|
|
@ -1,12 +1,15 @@
|
|||
use crate::client::{Client, ClientError};
|
||||
use crate::ifs::wl_output::{WlOutput, SEND_DONE_SINCE};
|
||||
use crate::leaks::Tracker;
|
||||
use crate::object::Object;
|
||||
use crate::utils::buffd::{MsgParser, MsgParserError};
|
||||
use crate::wire::zxdg_output_v1::*;
|
||||
use crate::wire::ZxdgOutputV1Id;
|
||||
use std::rc::Rc;
|
||||
use thiserror::Error;
|
||||
use {
|
||||
crate::{
|
||||
client::{Client, ClientError},
|
||||
ifs::wl_output::{WlOutput, SEND_DONE_SINCE},
|
||||
leaks::Tracker,
|
||||
object::Object,
|
||||
utils::buffd::{MsgParser, MsgParserError},
|
||||
wire::{zxdg_output_v1::*, ZxdgOutputV1Id},
|
||||
},
|
||||
std::rc::Rc,
|
||||
thiserror::Error,
|
||||
};
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub const NAME_SINCE: u32 = 2;
|
||||
|
|
|
|||
|
|
@ -1,12 +1,15 @@
|
|||
use crate::client::{Client, ClientError};
|
||||
use crate::ifs::wl_surface::xdg_surface::xdg_toplevel::{Decoration, XdgToplevel};
|
||||
use crate::leaks::Tracker;
|
||||
use crate::object::Object;
|
||||
use crate::utils::buffd::{MsgParser, MsgParserError};
|
||||
use crate::wire::zxdg_toplevel_decoration_v1::*;
|
||||
use crate::wire::ZxdgToplevelDecorationV1Id;
|
||||
use std::rc::Rc;
|
||||
use thiserror::Error;
|
||||
use {
|
||||
crate::{
|
||||
client::{Client, ClientError},
|
||||
ifs::wl_surface::xdg_surface::xdg_toplevel::{Decoration, XdgToplevel},
|
||||
leaks::Tracker,
|
||||
object::Object,
|
||||
utils::buffd::{MsgParser, MsgParserError},
|
||||
wire::{zxdg_toplevel_decoration_v1::*, ZxdgToplevelDecorationV1Id},
|
||||
},
|
||||
std::rc::Rc,
|
||||
thiserror::Error,
|
||||
};
|
||||
|
||||
const CLIENT_SIDE: u32 = 1;
|
||||
const SERVER_SIDE: u32 = 2;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue