1
0
Fork 0
forked from wry/wry

autocommit 2022-03-09 17:51:17 CET

This commit is contained in:
Julian Orth 2022-03-09 17:51:17 +01:00
parent 4df6b559b7
commit 0399772467
35 changed files with 429 additions and 423 deletions

View file

@ -2,7 +2,7 @@ use crate::_private::ipc::{ClientMessage, InitMessage, Response, ServerMessage};
use crate::_private::{bincode_ops, logging, Config, ConfigEntry, ConfigEntryGen, VERSION};
use crate::keyboard::keymap::Keymap;
use crate::theme::Color;
use crate::{Axis, Command, Direction, InputDevice, Keyboard, LogLevel, ModifiedKeySym, Seat};
use crate::{Axis, Command, Direction, InputDevice, LogLevel, ModifiedKeySym, Seat};
use std::cell::{Cell, RefCell};
use std::collections::hash_map::Entry;
use std::collections::HashMap;
@ -141,7 +141,7 @@ impl Client {
});
}
pub fn grab(&self, kb: Keyboard, grab: bool) {
pub fn grab(&self, kb: InputDevice, grab: bool) {
self.send(&ClientMessage::GrabKb { kb, grab });
}

View file

@ -2,7 +2,7 @@ use crate::keyboard::keymap::Keymap;
use crate::keyboard::mods::Modifiers;
use crate::keyboard::syms::KeySym;
use crate::theme::Color;
use crate::{Axis, Direction, InputDevice, Keyboard, LogLevel, Seat};
use crate::{Axis, Direction, InputDevice, LogLevel, Seat};
use bincode::{BorrowDecode, Decode, Encode};
#[derive(Encode, BorrowDecode, Debug)]
@ -92,7 +92,7 @@ pub enum ClientMessage<'a> {
direction: Direction,
},
GrabKb {
kb: Keyboard,
kb: InputDevice,
grab: bool,
},
GetTitleHeight,

View file

@ -1,5 +1,5 @@
use crate::Keyboard;
use crate::InputDevice;
pub fn grab_keyboard(kb: Keyboard, grab: bool) {
pub fn grab_input_device(kb: InputDevice, grab: bool) {
get!().grab(kb, grab);
}

View file

@ -42,16 +42,7 @@ impl Seat {
}
#[derive(Encode, Decode, Copy, Clone, Debug, Hash, Eq, PartialEq)]
pub struct Keyboard(pub u64);
#[derive(Encode, Decode, Copy, Clone, Debug, Hash, Eq, PartialEq)]
pub struct Mouse(pub u64);
#[derive(Encode, Decode, Copy, Clone, Debug, Hash, Eq, PartialEq)]
pub enum InputDevice {
Keyboard(Keyboard),
Mouse(Mouse),
}
pub struct InputDevice(pub u64);
impl InputDevice {
pub fn set_seat(self, seat: Seat) {