Skip to content

Commit

Permalink
feat(borders): clean up render targets on destroy
Browse files Browse the repository at this point in the history
  • Loading branch information
LGUG2Z committed Nov 17, 2024
1 parent 47cb19e commit 3857d1a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
5 changes: 2 additions & 3 deletions komorebi/src/border_manager/border.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ use std::ops::Deref;
use std::sync::atomic::Ordering;
use std::sync::mpsc;
use std::sync::LazyLock;
use std::time::Duration;
use windows::Foundation::Numerics::Matrix3x2;
use windows::Win32::Foundation::BOOL;
use windows::Win32::Foundation::FALSE;
Expand Down Expand Up @@ -141,8 +140,6 @@ impl Border {
let _ = TranslateMessage(&msg);
DispatchMessageW(&msg);
}

std::thread::sleep(Duration::from_millis(1))
}

Ok(())
Expand Down Expand Up @@ -201,6 +198,8 @@ impl Border {
}

pub fn destroy(&self) -> color_eyre::Result<()> {
let mut render_targets = RENDER_TARGETS.lock();
render_targets.remove(&self.hwnd);
WindowsApi::close_window(self.hwnd)
}

Expand Down
1 change: 1 addition & 0 deletions komorebi/src/border_manager/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ pub fn destroy_all_borders() -> color_eyre::Result<()> {
borders.clear();
BORDERS_MONITORS.lock().clear();
FOCUS_STATE.lock().clear();
RENDER_TARGETS.lock().clear();

let mut remaining_hwnds = vec![];

Expand Down

0 comments on commit 3857d1a

Please sign in to comment.