mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-04-20 07:41:25 +02:00
feat(wm): reconcile monitor state
When monitors turn on and off, they do not retain their hmonitor id, therefore this commit introduces an initial attempt to reconcile invalid and valid hmonitors after monitor changes based on the windows that are assigned to them. If a monitor has at least one window, and has been assigned a new hmonitor id, komorebi will look up the current hmonitor of that window's hwnd and update Monitor.id in-place. When reconciling monitors, any monitor marked as invalid will be purged from the window manager state. This commit also applies some of the new clippy lints that come along with the latest nightly release of Rust. resolve #31
This commit is contained in:
@@ -2,7 +2,7 @@ use serde::Serialize;
|
||||
|
||||
use bindings::Windows::Win32::Foundation::RECT;
|
||||
|
||||
#[derive(Debug, Clone, Copy, Serialize, Eq, PartialEq)]
|
||||
#[derive(Debug, Default, Clone, Copy, Serialize, Eq, PartialEq)]
|
||||
pub struct Rect {
|
||||
pub left: i32,
|
||||
pub top: i32,
|
||||
@@ -10,17 +10,6 @@ pub struct Rect {
|
||||
pub bottom: i32,
|
||||
}
|
||||
|
||||
impl Default for Rect {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
left: 0,
|
||||
top: 0,
|
||||
right: 0,
|
||||
bottom: 0,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<RECT> for Rect {
|
||||
fn from(rect: RECT) -> Self {
|
||||
Self {
|
||||
|
||||
Reference in New Issue
Block a user