1
0
Fork 0
forked from wry/wry

autocommit 2022-02-14 21:47:35 CET

This commit is contained in:
Julian Orth 2022-02-14 21:47:35 +01:00
parent da6b29f138
commit 290225190a
11 changed files with 191 additions and 19 deletions

View file

@ -1,6 +1,6 @@
use crate::_private::ipc::{InitMessage, Request, Response};
use crate::_private::{bincode_ops, logging, Config, ConfigEntry, ConfigEntryGen, VERSION};
use crate::{Direction, InputDevice, LogLevel, ModifiedKeySym, Seat};
use crate::{Axis, Direction, InputDevice, LogLevel, ModifiedKeySym, Seat};
use std::cell::{Cell, RefCell};
use std::collections::hash_map::Entry;
use std::collections::HashMap;
@ -171,6 +171,21 @@ impl Client {
}
}
pub fn split(&self, seat: Seat) -> Axis {
let res = self.with_response(|| self.send(&Request::GetSplit { seat }));
match res {
Response::GetSplit { axis } => axis,
_ => {
log::error!("Server did not send a response to a get_split request");
Axis::Horizontal
},
}
}
pub fn set_split(&self, seat: Seat, axis: Axis) {
self.send(&Request::SetSplit { seat, axis });
}
pub fn create_seat(&self, name: &str) -> Seat {
let response = self.with_response(|| self.send(&Request::CreateSeat { name }));
match response {