1
0
Fork 0
mirror of https://github.com/Zedfrigg/ironbar.git synced 2025-08-18 07:11:04 +02:00

refactor: begin restructuring core code to better encapsulate

This is a first pass towards trying to structure things a bit better, with data generally encapsulated under a single hierarchical tree, rather than lots of globals all over the place. Lots of work is still required.

The plan is that with this and some more work, #291 should become a lot easier to sort.
This commit is contained in:
Jake Stanger 2023-12-08 22:39:27 +00:00
parent 08e354e019
commit b2fa19ab6c
No known key found for this signature in database
GPG key ID: C51FC8F9CB0BEA61
14 changed files with 490 additions and 415 deletions

View file

@ -7,8 +7,7 @@ use self::device::{DataControlDeviceDataExt, DataControlDeviceHandler};
use self::offer::{DataControlDeviceOffer, DataControlOfferHandler, SelectionOffer};
use self::source::DataControlSourceHandler;
use crate::clients::wayland::Environment;
use crate::unique_id::get_unique_usize;
use crate::{lock, send};
use crate::{lock, send, Ironbar};
use device::DataControlDevice;
use glib::Bytes;
use nix::fcntl::{fcntl, F_GETPIPE_SZ, F_SETPIPE_SZ};
@ -145,7 +144,7 @@ impl Environment {
};
Ok(ClipboardItem {
id: get_unique_usize(),
id: Ironbar::unique_id(),
value,
mime_type: mime_type.value.clone(),
})

View file

@ -1,6 +1,5 @@
use super::manager::ToplevelManagerState;
use crate::lock;
use crate::unique_id::get_unique_usize;
use crate::{lock, Ironbar};
use std::collections::HashSet;
use std::sync::{Arc, Mutex};
use tracing::trace;
@ -68,7 +67,7 @@ pub struct ToplevelInfo {
impl Default for ToplevelInfo {
fn default() -> Self {
Self {
id: get_unique_usize(),
id: Ironbar::unique_id(),
app_id: String::new(),
title: String::new(),
fullscreen: false,