mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-07-09 06:25:23 +02:00
feat(borders): clean up render targets on destroy
This commit is contained in:
@@ -15,7 +15,6 @@ use std::ops::Deref;
|
|||||||
use std::sync::atomic::Ordering;
|
use std::sync::atomic::Ordering;
|
||||||
use std::sync::mpsc;
|
use std::sync::mpsc;
|
||||||
use std::sync::LazyLock;
|
use std::sync::LazyLock;
|
||||||
use std::time::Duration;
|
|
||||||
use windows::Foundation::Numerics::Matrix3x2;
|
use windows::Foundation::Numerics::Matrix3x2;
|
||||||
use windows::Win32::Foundation::BOOL;
|
use windows::Win32::Foundation::BOOL;
|
||||||
use windows::Win32::Foundation::FALSE;
|
use windows::Win32::Foundation::FALSE;
|
||||||
@@ -141,8 +140,6 @@ impl Border {
|
|||||||
let _ = TranslateMessage(&msg);
|
let _ = TranslateMessage(&msg);
|
||||||
DispatchMessageW(&msg);
|
DispatchMessageW(&msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::thread::sleep(Duration::from_millis(1))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
@@ -201,6 +198,8 @@ impl Border {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn destroy(&self) -> color_eyre::Result<()> {
|
pub fn destroy(&self) -> color_eyre::Result<()> {
|
||||||
|
let mut render_targets = RENDER_TARGETS.lock();
|
||||||
|
render_targets.remove(&self.hwnd);
|
||||||
WindowsApi::close_window(self.hwnd)
|
WindowsApi::close_window(self.hwnd)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -100,6 +100,7 @@ pub fn destroy_all_borders() -> color_eyre::Result<()> {
|
|||||||
borders.clear();
|
borders.clear();
|
||||||
BORDERS_MONITORS.lock().clear();
|
BORDERS_MONITORS.lock().clear();
|
||||||
FOCUS_STATE.lock().clear();
|
FOCUS_STATE.lock().clear();
|
||||||
|
RENDER_TARGETS.lock().clear();
|
||||||
|
|
||||||
let mut remaining_hwnds = vec![];
|
let mut remaining_hwnds = vec![];
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user