From 46e31b17e668a43a6a1a0bdba8794d0486dcd0f0 Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Tue, 26 Aug 2025 13:28:45 +0300 Subject: [PATCH] Start researching Linux overdraws Co-authored-by: Kate --- crates/gpui/src/platform/linux/x11/window.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/gpui/src/platform/linux/x11/window.rs b/crates/gpui/src/platform/linux/x11/window.rs index 6af943b317..08a2e94a6f 100644 --- a/crates/gpui/src/platform/linux/x11/window.rs +++ b/crates/gpui/src/platform/linux/x11/window.rs @@ -27,6 +27,7 @@ use x11rb::{ xcb_ffi::XCBConnection, }; +use std::sync::atomic::AtomicUsize; use std::{ cell::RefCell, ffi::c_void, fmt::Display, num::NonZeroU32, ops::Div, ptr::NonNull, rc::Rc, sync::Arc, @@ -1432,6 +1433,11 @@ impl PlatformWindow for X11Window { } fn draw(&self, scene: &Scene) { + static counter: AtomicUsize = AtomicUsize::new(0); + dbg!( + "refresh!", + counter.fetch_add(1, std::sync::atomic::Ordering::Release) + 1 + ); let mut inner = self.0.state.borrow_mut(); inner.renderer.draw(scene); }