1
0
Fork 0
forked from wry/wry

autocommit 2022-03-13 22:20:31 CET

This commit is contained in:
Julian Orth 2022-03-13 22:20:31 +01:00
parent 156bd5b042
commit a15a02a95c
38 changed files with 63 additions and 66 deletions

20
Cargo.lock generated
View file

@ -184,7 +184,7 @@ dependencies = [
name = "default-config"
version = "0.1.0"
dependencies = [
"i4config",
"jay-config",
"log",
"rand",
]
@ -405,7 +405,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4"
[[package]]
name = "i4"
name = "isnt"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2a7558cc96ddcaf0b4144d7149984ace2899bb29d4ee2999979d429efc305200"
[[package]]
name = "jay"
version = "0.1.0"
dependencies = [
"ahash",
@ -420,8 +426,8 @@ dependencies = [
"default-config",
"env_logger",
"futures",
"i4config",
"isnt",
"jay-config",
"libloading",
"log",
"num-derive",
@ -443,19 +449,13 @@ dependencies = [
]
[[package]]
name = "i4config"
name = "jay-config"
version = "0.1.0"
dependencies = [
"bincode",
"log",
]
[[package]]
name = "isnt"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2a7558cc96ddcaf0b4144d7149984ace2899bb29d4ee2999979d429efc305200"
[[package]]
name = "lazy_static"
version = "1.4.0"

View file

@ -1,11 +1,11 @@
[package]
name = "i4"
name = "jay"
version = "0.1.0"
edition = "2021"
build = "build/build.rs"
[workspace]
members = ["i4config", "default-config"]
members = ["jay-config", "default-config"]
[profile.release]
panic = "abort"
@ -39,7 +39,7 @@ bincode = "2.0.0-beta.3"
pangocairo = "0.15.1"
cairo-rs = { version = "0.15.1", features = ["png"] }
pango = { version = "0.15.2", features = ["v1_44"] }
i4config = { path = "i4config" }
jay-config = { path = "jay-config" }
default-config = { path = "default-config" }
x11rb = { version = "0.9.0", features = ["composite", "cursor"] }
pin-project = "1.0.10"

View file

@ -7,6 +7,6 @@ edition = "2021"
crate-type = ["lib", "cdylib"]
[dependencies]
i4config = { path = "../i4config" }
jay-config = { path = "../jay-config" }
log = "0.4.14"
rand = "0.8.5"

View file

@ -1,13 +1,13 @@
use i4config::embedded::grab_input_device;
use i4config::keyboard::mods::{Modifiers, ALT, CTRL, SHIFT};
use i4config::keyboard::syms::{
use jay_config::embedded::grab_input_device;
use jay_config::keyboard::mods::{Modifiers, ALT, CTRL, SHIFT};
use jay_config::keyboard::syms::{
SYM_Super_L, SYM_b, SYM_comma, SYM_d, SYM_f, SYM_h, SYM_j, SYM_k, SYM_l, SYM_p, SYM_period,
SYM_q, SYM_r, SYM_t, SYM_v, SYM_y,
};
use i4config::theme::{get_title_height, set_title_color, set_title_height, Color};
use i4config::Axis::{Horizontal, Vertical};
use i4config::Direction::{Down, Left, Right, Up};
use i4config::{config, create_seat, input_devices, on_new_input_device, quit, Command, Seat};
use jay_config::theme::{get_title_height, set_title_color, set_title_height, Color};
use jay_config::Axis::{Horizontal, Vertical};
use jay_config::Direction::{Down, Left, Right, Up};
use jay_config::{config, create_seat, input_devices, on_new_input_device, quit, Command, Seat};
use rand::Rng;
const MOD: Modifiers = ALT;

View file

@ -1,5 +1,5 @@
[package]
name = "i4config"
name = "jay-config"
version = "0.1.0"
edition = "2021"

View file

@ -11,7 +11,6 @@ use crate::ErrorFmt;
use bstr::ByteSlice;
use std::cell::Cell;
use std::rc::Rc;
use std::time::Instant;
use uapi::{c, OwnedFd};
const DRM: &[u8] = b"drm";
@ -91,7 +90,6 @@ impl MetalBackend {
}
fn handle_input_device_resume(self: &Rc<Self>, dev: &Rc<MetalInputDevice>, fd: Rc<OwnedFd>) {
let start = Instant::now();
log::info!("Device resumed: {}", dev.devnode.to_bytes().as_bstr());
if let Some(old) = dev.fd.set(Some(fd)) {
self.state.fdcloser.close(old);
@ -100,7 +98,6 @@ impl MetalBackend {
Ok(d) => d,
Err(_) => return,
};
log::info!("took {:?}", start.elapsed());
inputdev.device().set_slot(dev.slot);
dev.inputdev.set(Some(inputdev));
}

View file

@ -847,7 +847,7 @@ impl MetalBackend {
mode.hdisplay as _,
mode.vdisplay as _,
)?)
},
}
};
changes.change_object(primary_plane.id, |c| {
c.change(primary_plane.fb_id, buffers[0].drm.id().0 as _);

View file

@ -418,7 +418,7 @@ impl XorgBackend {
images,
});
{
let class = "i4\0i4\0";
let class = "jay\0jay\0";
let cookie = con.xcb.xcb_change_property_checked(
con.c,
ffi::XCB_PROP_MODE_REPLACE as _,

View file

@ -5,10 +5,10 @@ use crate::config::handler::ConfigProxyHandler;
use crate::ifs::wl_seat::SeatId;
use crate::utils::ptr_ext::PtrExt;
use crate::{NumCell, State};
use i4config::_private::ipc::{InitMessage, ServerMessage, V1InitMessage};
use i4config::_private::{bincode_ops, ConfigEntry, VERSION};
use i4config::keyboard::ModifiedKeySym;
use i4config::{InputDevice, Seat};
use jay_config::_private::ipc::{InitMessage, ServerMessage, V1InitMessage};
use jay_config::_private::{bincode_ops, ConfigEntry, VERSION};
use jay_config::keyboard::ModifiedKeySym;
use jay_config::{InputDevice, Seat};
use libloading::Library;
use std::cell::Cell;
use std::ptr;
@ -68,7 +68,7 @@ unsafe extern "C" fn default_client_init(
extern "C" fn configure() {
default_config::configure();
}
i4config::_private::client::init(srv_data, srv_unref, srv_handler, msg, size, configure)
jay_config::_private::client::init(srv_data, srv_unref, srv_handler, msg, size, configure)
}
impl ConfigProxy {
@ -106,8 +106,8 @@ impl ConfigProxy {
let entry = ConfigEntry {
version: VERSION,
init: default_client_init,
unref: i4config::_private::client::unref,
handle_msg: i4config::_private::client::handle_msg,
unref: jay_config::_private::client::unref,
handle_msg: jay_config::_private::client::handle_msg,
};
Self::new(None, &entry, state)
}

View file

@ -9,12 +9,12 @@ use crate::utils::stack::Stack;
use crate::xkbcommon::XkbKeymap;
use crate::{backend, ErrorFmt, NumCell, State};
use bincode::error::DecodeError;
use i4config::_private::bincode_ops;
use i4config::_private::ipc::{ClientMessage, Response, ServerMessage};
use i4config::keyboard::keymap::Keymap;
use i4config::keyboard::mods::Modifiers;
use i4config::keyboard::syms::KeySym;
use i4config::{Axis, Direction, InputDevice, LogLevel, Seat};
use jay_config::_private::bincode_ops;
use jay_config::_private::ipc::{ClientMessage, Response, ServerMessage};
use jay_config::keyboard::keymap::Keymap;
use jay_config::keyboard::mods::Modifiers;
use jay_config::keyboard::syms::KeySym;
use jay_config::{Axis, Direction, InputDevice, LogLevel, Seat};
use libloading::Library;
use log::Level;
use std::cell::Cell;
@ -397,20 +397,20 @@ impl ConfigProxyHandler {
Ok(())
}
fn handle_set_title_color(&self, color: i4config::theme::Color) {
fn handle_set_title_color(&self, color: jay_config::theme::Color) {
self.state.theme.title_color.set(color.into());
self.colors_change();
}
fn handle_set_border_color(&self, color: i4config::theme::Color) {
fn handle_set_border_color(&self, color: jay_config::theme::Color) {
self.state.theme.border_color.set(color.into());
}
fn handle_set_background_color(&self, color: i4config::theme::Color) {
fn handle_set_background_color(&self, color: jay_config::theme::Color) {
self.state.theme.background_color.set(color.into());
}
fn handle_set_title_underline_color(&self, color: i4config::theme::Color) {
fn handle_set_title_underline_color(&self, color: jay_config::theme::Color) {
self.state.theme.underline_color.set(color.into());
}

View file

@ -9,7 +9,7 @@ use crate::utils::copyhashmap::CopyHashMap;
use crate::{xwayland, AsyncEngine, AsyncQueue, ErrorFmt, EventLoop, NumCell, State, Wheel};
use bincode::error::{DecodeError, EncodeError};
use bincode::{Decode, Encode};
use i4config::_private::bincode_ops;
use jay_config::_private::bincode_ops;
use log::Level;
use std::cell::{Cell, RefCell};
use std::env;

View file

@ -6,7 +6,7 @@ use crate::async_engine::AsyncFd;
use crate::utils::buffd::{BufFdIn, BufFdOut};
use crate::utils::vec_ext::VecExt;
use crate::ForkerError;
use i4config::_private::bincode_ops;
use jay_config::_private::bincode_ops;
use uapi::OwnedFd;
pub struct IoIn {

View file

@ -175,8 +175,8 @@ impl WlOutput {
physical_width: pos.width(),
physical_height: pos.height(),
subpixel: SP_UNKNOWN,
make: "i4",
model: "i4",
make: "jay",
model: "jay",
transform: TF_NORMAL,
};
self.client.event(event);

View file

@ -41,8 +41,8 @@ use crate::xkbcommon::{XkbKeymap, XkbState};
use crate::{ErrorFmt, NumCell, State};
use ahash::{AHashMap, AHashSet};
pub use event_handling::NodeSeatState;
use i4config::keyboard::mods::Modifiers;
use i4config::Direction;
use jay_config::keyboard::mods::Modifiers;
use jay_config::Direction;
use std::cell::{Cell, RefCell};
use std::collections::hash_map::Entry;
use std::mem;

View file

@ -16,9 +16,9 @@ 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 i4config::keyboard::mods::Modifiers;
use i4config::keyboard::syms::KeySym;
use i4config::keyboard::ModifiedKeySym;
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;

View file

@ -30,7 +30,7 @@ use crate::wire::{WlOutputId, WlSurfaceId};
use crate::xkbcommon::ModifierState;
use crate::NumCell;
use ahash::AHashMap;
use i4config::Direction;
use jay_config::Direction;
use std::cell::{Cell, RefCell};
use std::fmt::{Debug, Formatter};
use std::mem;

View file

@ -21,7 +21,7 @@ use crate::utils::smallmap::SmallMap;
use crate::wire::xdg_surface::*;
use crate::wire::{WlSurfaceId, XdgPopupId, XdgSurfaceId};
use crate::NumCell;
use i4config::Direction;
use jay_config::Direction;
use std::cell::Cell;
use std::fmt::Debug;
use std::rc::Rc;

View file

@ -20,7 +20,7 @@ use crate::wire::xdg_toplevel::*;
use crate::wire::XdgToplevelId;
use crate::{bugs, NumCell};
use ahash::{AHashMap, AHashSet};
use i4config::Direction;
use jay_config::Direction;
use num_derive::FromPrimitive;
use std::cell::{Cell, RefCell};
use std::fmt::{Debug, Formatter};

View file

@ -13,7 +13,7 @@ use crate::utils::smallmap::SmallMap;
use crate::wire::WlSurfaceId;
use crate::xwayland::XWaylandEvent;
use crate::{AsyncQueue, CloneCell, State};
use i4config::Direction;
use jay_config::Direction;
use std::cell::{Cell, RefCell};
use std::rc::Rc;
use thiserror::Error;

View file

@ -40,6 +40,7 @@ use crate::tree::{
use crate::udev::Udev;
use crate::utils::clonecell::CloneCell;
use crate::utils::errorfmt::ErrorFmt;
use crate::utils::fdcloser::FdCloser;
use crate::utils::numcell::NumCell;
use crate::utils::queue::AsyncQueue;
use crate::utils::run_toplevel::RunToplevel;
@ -55,7 +56,6 @@ use std::ops::Deref;
use std::rc::Rc;
use thiserror::Error;
use wheel::Wheel;
use crate::utils::fdcloser::FdCloser;
#[macro_use]
mod macros;

View file

@ -20,6 +20,7 @@ use crate::tree::{
};
use crate::utils::clonecell::CloneCell;
use crate::utils::copyhashmap::CopyHashMap;
use crate::utils::fdcloser::FdCloser;
use crate::utils::linkedlist::LinkedList;
use crate::utils::numcell::NumCell;
use crate::utils::queue::AsyncQueue;
@ -29,7 +30,6 @@ use ahash::AHashMap;
use std::cell::{Cell, RefCell};
use std::rc::Rc;
use std::sync::Arc;
use crate::utils::fdcloser::FdCloser;
pub struct State {
pub xkb_ctx: XkbContext,

View file

@ -36,8 +36,8 @@ impl Color {
}
}
impl From<i4config::theme::Color> for Color {
fn from(f: i4config::theme::Color) -> Self {
impl From<jay_config::theme::Color> for Color {
fn from(f: jay_config::theme::Color) -> Self {
Self {
r: to_f32(f.r),
g: to_f32(f.g),

View file

@ -11,7 +11,7 @@ use crate::utils::clonecell::CloneCell;
use crate::utils::linkedlist::{LinkedList, LinkedNode, NodeRef};
use crate::{text, ErrorFmt, NumCell, State};
use ahash::AHashMap;
use i4config::{Axis, Direction};
use jay_config::{Axis, Direction};
use std::cell::{Cell, RefCell};
use std::fmt::{Debug, Formatter};

View file

@ -14,7 +14,7 @@ use crate::xkbcommon::ModifierState;
use crate::NumCell;
pub use container::*;
pub use float::*;
use i4config::Direction;
use jay_config::Direction;
pub use output::*;
use std::fmt::{Debug, Display};
use std::ops::Deref;

View file

@ -1,7 +1,7 @@
use parking_lot::{Condvar, Mutex};
use std::mem;
use std::rc::Rc;
use std::sync::Arc;
use parking_lot::{Condvar, Mutex};
use uapi::OwnedFd;
pub struct FdCloser {
@ -38,7 +38,7 @@ impl FdCloser {
Ok(fd) => {
self.fds.lock().push(fd);
self.cv.notify_all();
},
}
Err(_e) => {
log::warn!("Could not close file descriptor in separate thread. There are still references.");
}

View file

@ -7,6 +7,7 @@ pub mod clonecell;
pub mod copyhashmap;
pub mod debug_fn;
pub mod errorfmt;
pub mod fdcloser;
pub mod hex;
pub mod linkedlist;
pub mod nonblock;
@ -22,4 +23,3 @@ pub mod tri;
pub mod vasprintf;
pub mod vec_ext;
pub mod vecstorage;
pub mod fdcloser;