git.lucas.co / cce-cloud
cloud storage client
git clone https://git.lucas.co/cce-cloud.git

commit681c2825a3542ca00dc9b991439c3bdfd7507011
parent8029da41ed
authorLucas Galante <[email protected]>
date2026-05-25 00:09
Set wl_surface buffer scale to align with HiDPI display scale factor

 src/main.rs | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/main.rs b/src/main.rs
index 7186528..75904bc 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -418,6 +418,7 @@ impl State {
         let lh = height as f32;
 
         let wl_surface = compositor_state.create_surface(qh);
+        wl_surface.set_buffer_scale(scale as i32);
         let window = layer_shell_state.create_layer_surface(
             qh,
             wl_surface.clone(),
@@ -803,6 +804,7 @@ impl CompositorHandler for AppState {
     ) {
         if let Some(state) = &mut self.state {
             state.scale = scale_factor as f64;
+            state.wl_surface.set_buffer_scale(scale_factor);
             let pw = (state.width as f64 * state.scale) as u32;
             let ph = (state.height as f64 * state.scale) as u32;
             state.resize(pw, ph);