mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-03-03 01:10:02 +01:00
Compare commits
1 Commits
feature/st
...
feature/cm
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8176849dc3 |
@@ -17,7 +17,6 @@ use komorebi_core::Rect;
|
|||||||
|
|
||||||
use std::sync::atomic::Ordering;
|
use std::sync::atomic::Ordering;
|
||||||
use std::sync::mpsc;
|
use std::sync::mpsc;
|
||||||
use std::time::Duration;
|
|
||||||
use windows::core::PCWSTR;
|
use windows::core::PCWSTR;
|
||||||
use windows::Win32::Foundation::BOOL;
|
use windows::Win32::Foundation::BOOL;
|
||||||
use windows::Win32::Foundation::COLORREF;
|
use windows::Win32::Foundation::COLORREF;
|
||||||
@@ -104,7 +103,6 @@ impl Border {
|
|||||||
while GetMessageW(&mut message, HWND(hwnd), 0, 0).into() {
|
while GetMessageW(&mut message, HWND(hwnd), 0, 0).into() {
|
||||||
TranslateMessage(&message);
|
TranslateMessage(&message);
|
||||||
DispatchMessageW(&message);
|
DispatchMessageW(&message);
|
||||||
std::thread::sleep(Duration::from_millis(10));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -78,23 +78,34 @@ use crate::WORKSPACE_RULES;
|
|||||||
|
|
||||||
#[tracing::instrument]
|
#[tracing::instrument]
|
||||||
pub fn listen_for_commands(wm: Arc<Mutex<WindowManager>>) {
|
pub fn listen_for_commands(wm: Arc<Mutex<WindowManager>>) {
|
||||||
let listener = wm
|
std::thread::spawn(move || loop {
|
||||||
.lock()
|
let listener = wm
|
||||||
.command_listener
|
.lock()
|
||||||
.try_clone()
|
.command_listener
|
||||||
.expect("could not clone unix listener");
|
.try_clone()
|
||||||
|
.expect("could not clone unix listener");
|
||||||
|
|
||||||
std::thread::spawn(move || {
|
|
||||||
tracing::info!("listening on komorebi.sock");
|
tracing::info!("listening on komorebi.sock");
|
||||||
|
|
||||||
|
// client is unique for every komorebic command
|
||||||
for client in listener.incoming() {
|
for client in listener.incoming() {
|
||||||
match client {
|
match client {
|
||||||
Ok(stream) => match read_commands_uds(&wm, stream) {
|
Ok(stream) => match read_commands_uds(&wm, stream) {
|
||||||
Ok(()) => {}
|
Ok(()) => {}
|
||||||
Err(error) => tracing::error!("{}", error),
|
Err(error) => {
|
||||||
|
if cfg!(debug_assertions) {
|
||||||
|
tracing::error!("{:?}", error)
|
||||||
|
} else {
|
||||||
|
tracing::error!("{}", error)
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
Err(error) => {
|
Err(error) => {
|
||||||
tracing::error!("{}", error);
|
if cfg!(debug_assertions) {
|
||||||
break;
|
tracing::error!("{:?}", error)
|
||||||
|
} else {
|
||||||
|
tracing::error!("{}", error)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,20 +35,17 @@ use crate::TRAY_AND_MULTI_WINDOW_IDENTIFIERS;
|
|||||||
|
|
||||||
#[tracing::instrument]
|
#[tracing::instrument]
|
||||||
pub fn listen_for_events(wm: Arc<Mutex<WindowManager>>) {
|
pub fn listen_for_events(wm: Arc<Mutex<WindowManager>>) {
|
||||||
let receiver = wm.lock().incoming_events.clone();
|
std::thread::spawn(move || loop {
|
||||||
|
|
||||||
std::thread::spawn(move || {
|
|
||||||
tracing::info!("listening");
|
tracing::info!("listening");
|
||||||
loop {
|
let receiver = wm.lock().incoming_events.clone();
|
||||||
if let Ok(event) = receiver.recv() {
|
for event in receiver {
|
||||||
match wm.lock().process_event(event) {
|
match wm.lock().process_event(event) {
|
||||||
Ok(()) => {}
|
Ok(()) => {}
|
||||||
Err(error) => {
|
Err(error) => {
|
||||||
if cfg!(debug_assertions) {
|
if cfg!(debug_assertions) {
|
||||||
tracing::error!("{:?}", error)
|
tracing::error!("{:?}", error)
|
||||||
} else {
|
} else {
|
||||||
tracing::error!("{}", error)
|
tracing::error!("{}", error)
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
use std::collections::VecDeque;
|
use std::collections::VecDeque;
|
||||||
use std::sync::atomic::Ordering;
|
use std::sync::atomic::Ordering;
|
||||||
use std::time::Duration;
|
|
||||||
|
|
||||||
use color_eyre::eyre::Result;
|
use color_eyre::eyre::Result;
|
||||||
use schemars::JsonSchema;
|
use schemars::JsonSchema;
|
||||||
@@ -163,7 +162,6 @@ impl Stackbar {
|
|||||||
while GetMessageW(&mut msg, hwnd, 0, 0).into() {
|
while GetMessageW(&mut msg, hwnd, 0, 0).into() {
|
||||||
TranslateMessage(&msg);
|
TranslateMessage(&msg);
|
||||||
DispatchMessageW(&msg);
|
DispatchMessageW(&msg);
|
||||||
std::thread::sleep(Duration::from_millis(10));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user