autocommit 2022-02-15 22:53:12 CET
This commit is contained in:
parent
290225190a
commit
cacd49d15a
33 changed files with 884 additions and 220 deletions
|
|
@ -4,6 +4,7 @@ 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;
|
||||
|
|
@ -38,6 +39,7 @@ use crate::{ErrorFmt, NumCell, State};
|
|||
use ahash::{AHashMap, AHashSet};
|
||||
pub use event_handling::NodeSeatState;
|
||||
use i4config::keyboard::mods::Modifiers;
|
||||
use i4config::Direction;
|
||||
use std::cell::{Cell, RefCell};
|
||||
use std::collections::hash_map::Entry;
|
||||
use std::mem;
|
||||
|
|
@ -45,8 +47,6 @@ use std::ops::DerefMut;
|
|||
use std::rc::Rc;
|
||||
use thiserror::Error;
|
||||
use uapi::{c, Errno, OwnedFd};
|
||||
use i4config::{ Direction};
|
||||
use crate::async_engine::SpawnedFuture;
|
||||
|
||||
const POINTER: u32 = 1;
|
||||
const KEYBOARD: u32 = 2;
|
||||
|
|
@ -119,11 +119,7 @@ pub struct WlSeatGlobal {
|
|||
}
|
||||
|
||||
impl WlSeatGlobal {
|
||||
pub fn new(
|
||||
name: GlobalName,
|
||||
seat_name: &str,
|
||||
state: &Rc<State>,
|
||||
) -> Rc<Self> {
|
||||
pub fn new(name: GlobalName, seat_name: &str, state: &Rc<State>) -> Rc<Self> {
|
||||
let slf = Rc::new(Self {
|
||||
id: state.seat_ids.next(),
|
||||
name,
|
||||
|
|
@ -167,7 +163,8 @@ impl WlSeatGlobal {
|
|||
}
|
||||
|
||||
pub fn mark_last_active(self: &Rc<Self>) {
|
||||
self.queue_link.set(Some(self.state.seat_queue.add_last(self.clone())));
|
||||
self.queue_link
|
||||
.set(Some(self.state.seat_queue.add_last(self.clone())));
|
||||
}
|
||||
|
||||
pub fn set_keymap(&self, keymap: &Rc<XkbKeymap>) {
|
||||
|
|
@ -464,7 +461,11 @@ impl WlSeat {
|
|||
self.client.add_client_obj(&p)?;
|
||||
self.keyboards.set(req.id, p.clone());
|
||||
let keymap = self.global.kb_map.get();
|
||||
p.send_keymap(wl_keyboard::XKB_V1, self.keymap_fd(&keymap)?, keymap.map_len as _);
|
||||
p.send_keymap(
|
||||
wl_keyboard::XKB_V1,
|
||||
self.keymap_fd(&keymap)?,
|
||||
keymap.map_len as _,
|
||||
);
|
||||
if self.version >= REPEAT_INFO_SINCE {
|
||||
let (rate, delay) = self.global.repeat_rate.get();
|
||||
p.send_repeat_info(rate, delay);
|
||||
|
|
@ -484,12 +485,7 @@ impl WlSeat {
|
|||
let mut pos = 0;
|
||||
while pos < target {
|
||||
let rem = target - pos;
|
||||
let res = uapi::sendfile(
|
||||
fd.raw(),
|
||||
keymap.map.raw(),
|
||||
Some(&mut pos),
|
||||
rem as usize,
|
||||
);
|
||||
let res = uapi::sendfile(fd.raw(), keymap.map.raw(), Some(&mut pos), rem as usize);
|
||||
match res {
|
||||
Ok(_) | Err(Errno(c::EINTR)) => {}
|
||||
Err(e) => return Err(WlKeyboardError::KeymapCopy(e.into())),
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
use crate::backend::{KeyboardEvent, KeyState, MouseEvent, OutputId, ScrollAxis};
|
||||
use crate::backend::{KeyState, KeyboardEvent, MouseEvent, OutputId, ScrollAxis};
|
||||
use crate::client::{Client, ClientId};
|
||||
use crate::fixed::Fixed;
|
||||
use crate::ifs::ipc;
|
||||
|
|
@ -6,7 +6,7 @@ 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, WlSeat, WlSeatGlobal, SeatId};
|
||||
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::xdg_surface::xdg_toplevel::XdgToplevel;
|
||||
use crate::ifs::wl_surface::xdg_surface::XdgSurface;
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ use crate::wire::wl_keyboard::*;
|
|||
use crate::wire::{WlKeyboardId, WlSurfaceId};
|
||||
use std::rc::Rc;
|
||||
use thiserror::Error;
|
||||
use uapi::{OwnedFd};
|
||||
use uapi::OwnedFd;
|
||||
|
||||
pub const REPEAT_INFO_SINCE: u32 = 4;
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ pub mod cursor;
|
|||
pub mod wl_subsurface;
|
||||
pub mod xdg_surface;
|
||||
|
||||
use crate::backend::{KeyState, ScrollAxis};
|
||||
use crate::client::{Client, ClientError, RequestParser};
|
||||
use crate::fixed::Fixed;
|
||||
use crate::ifs::wl_buffer::WlBuffer;
|
||||
|
|
@ -25,14 +26,13 @@ use crate::wire::{WlOutputId, WlSurfaceId};
|
|||
use crate::xkbcommon::ModifierState;
|
||||
use crate::NumCell;
|
||||
use ahash::AHashMap;
|
||||
use i4config::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 i4config::{ Direction};
|
||||
use crate::backend::{KeyState, ScrollAxis};
|
||||
|
||||
#[allow(dead_code)]
|
||||
const INVALID_SCALE: u32 = 0;
|
||||
|
|
|
|||
|
|
@ -21,11 +21,11 @@ use crate::utils::smallmap::SmallMap;
|
|||
use crate::wire::xdg_surface::*;
|
||||
use crate::wire::{WlSurfaceId, XdgPopupId, XdgSurfaceId};
|
||||
use crate::NumCell;
|
||||
use i4config::Direction;
|
||||
use std::cell::Cell;
|
||||
use std::fmt::Debug;
|
||||
use std::rc::Rc;
|
||||
use thiserror::Error;
|
||||
use i4config::{Direction};
|
||||
|
||||
#[allow(dead_code)]
|
||||
const NOT_CONSTRUCTED: u32 = 1;
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ use crate::wire::xdg_toplevel::*;
|
|||
use crate::wire::XdgToplevelId;
|
||||
use crate::{bugs, NumCell};
|
||||
use ahash::{AHashMap, AHashSet};
|
||||
use i4config::Direction;
|
||||
use num_derive::FromPrimitive;
|
||||
use std::cell::{Cell, RefCell};
|
||||
use std::fmt::{Debug, Formatter};
|
||||
|
|
@ -26,7 +27,6 @@ use std::mem;
|
|||
use std::ops::Deref;
|
||||
use std::rc::Rc;
|
||||
use thiserror::Error;
|
||||
use i4config::{Direction};
|
||||
|
||||
#[derive(Copy, Clone, Debug, FromPrimitive)]
|
||||
pub enum ResizeEdge {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue