Repository: alacritty/alacritty
File: alacritty/src/display/window.rs (Rust)

Code before:
        let nspot_x = f64::from(size.padding_x() + point.column.0 as f32 * size.cell_width());
        let nspot_y = f64::from(size.padding_y() + (point.line.0 + 1) as f32 * size.cell_height());

        self.window().set_ime_position(PhysicalPosition::new(nspot_x, nspot_y));
    }

    pub fn swap_buffers(&self) {
        self.windowed_context.swap_buffers().expect("swap buffers");
    }

    pub fn swap_buffers_with_damage(&self, damage: &[Rect]) {
        self.windowed_context.swap_buffers_with_damage(damage).expect("swap buffes with damage");
    }

    #[cfg(any(target_os = "macos", windows))]
    pub fn swap_buffers_with_damage_supported(&self) -> bool {
        // Disable damage tracking on macOS/Windows since there's no observation of it working
        false
    }

    #[cfg(not(any(target_os = "macos", windows)))]
    pub fn swap_buffers_with_damage_supported(&self) -> bool {
        // On X11 damage tracking is behaving in unexpected way on some NVIDIA systems. Given that
        // there're no compositors supporting damage tracking and there's no such thing on GLX,
        // which is used by default, disabling it.
        //
        // For more see https://github.com/alacritty/alacritty/issues/6051.
        #[cfg(all(feature = "x11", not(any(target_os = "macos", windows))))]
        if self.window().xlib_window().is_some() {
            return false;
        }

        self.windowed_context.swap_buffers_with_damage_supported()
    }

    pub fn resize(&self, size: PhysicalSize<u32>) {
        self.windowed_context.resize(size);
    }

    pub fn make_current(&mut self) {
        if !self.windowed_context.is_current() {
            self.windowed_context
                .replace_with(|context| unsafe { context.make_current().expect("context swap") });
        }
    }

    /// Disable macOS window shadows.
    ///
    /// This prevents rendering artifacts from showing up when the window is transparent.
    #[cfg(target_os = "macos")]
    pub fn set_has_shadow(&self, has_shadows: bool) {

Review comment (suggestion):
```suggestion
        // On X11 damage tracking is behaving in unexpected ways on some NVIDIA systems. Since there's no compositor supporting it, damage tracking is disabled on X11.
        //
        // For more see https://github.com/alacritty/alacritty/issues/6051.
```

I think we can omit the GLX part, since the relevant portion would still be the compositor support. That way it reads a little nicer.

Code after:
        let nspot_x = f64::from(size.padding_x() + point.column.0 as f32 * size.cell_width());
        let nspot_y = f64::from(size.padding_y() + (point.line.0 + 1) as f32 * size.cell_height());

        self.window().set_ime_position(PhysicalPosition::new(nspot_x, nspot_y));
    }

    pub fn swap_buffers(&self) {
        self.windowed_context.swap_buffers().expect("swap buffers");
    }

    pub fn swap_buffers_with_damage(&self, damage: &[Rect]) {
        self.windowed_context.swap_buffers_with_damage(damage).expect("swap buffes with damage");
    }

    #[cfg(any(target_os = "macos", windows))]
    pub fn swap_buffers_with_damage_supported(&self) -> bool {
        // Disable damage tracking on macOS/Windows since there's no observation of it working.
        false
    }

    #[cfg(not(any(target_os = "macos", windows)))]
    pub fn swap_buffers_with_damage_supported(&self) -> bool {
        // On X11 damage tracking is behaving in unexpected ways on some NVIDIA systems. Since
        // there's no compositor supporting it, damage tracking is disabled on X11.
        //
        // For more see https://github.com/alacritty/alacritty/issues/6051.
        #[cfg(all(feature = "x11", not(any(target_os = "macos", windows))))]
        if self.window().xlib_window().is_some() {
            return false;
        }

        self.windowed_context.swap_buffers_with_damage_supported()
    }

    pub fn resize(&self, size: PhysicalSize<u32>) {
        self.windowed_context.resize(size);
    }

    pub fn make_current(&mut self) {
        if !self.windowed_context.is_current() {
            self.windowed_context
                .replace_with(|context| unsafe { context.make_current().expect("context swap") });
        }
    }

    /// Disable macOS window shadows.
    ///
    /// This prevents rendering artifacts from showing up when the window is transparent.
    #[cfg(target_os = "macos")]
    pub fn set_has_shadow(&self, has_shadows: bool) {
        let raw_window = match self.window().raw_window_handle() {