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

Code before:
        info!("Cell Size: {} x {}", cell_width, cell_height);
        info!("Padding: {} x {}", padding_x, padding_y);

        // Create new size with at least one column and row
        let size_info = SizeInfo {
            dpr,
            width: (viewport_size.width as f32).max(cell_width + 2. * padding_x),
            height: (viewport_size.height as f32).max(cell_height + 2. * padding_y),
            cell_width,
            cell_height,
            padding_x,
            padding_y,
        };

        // Update OpenGL projection
        renderer.resize(&size_info);

        // Call `clear` before showing the window, to make sure the surface is initialized.
        let background_color = config.colors.primary.background;
        renderer.with_api(&config, &size_info, |api| {
            api.clear(background_color);
        });

        #[cfg(not(any(target_os = "macos", windows)))]
        {
            // Setup and perform platform specific helpers
            if event_loop.is_x11() {
                // On Wayland we can safely ignore this call, since the window isn't visible until
                // you actually draw something into it.
                window.swap_buffers()
            }
        }

        window.set_visible(true);

        // Set window position
        //
        // TODO: replace `set_position` with `with_position` once available
        // Upstream issue: https://github.com/rust-windowing/winit/issues/806
        if let Some(position) = config.window.position {
            window.set_outer_position(PhysicalPosition::from((position.x, position.y)));
        }

        #[allow(clippy::single_match)]
        match config.window.startup_mode() {
            StartupMode::Fullscreen => window.set_fullscreen(true),
            #[cfg(target_os = "macos")]
            StartupMode::SimpleFullscreen => window.set_simple_fullscreen(true),
            #[cfg(not(any(target_os = "macos", windows)))]
            StartupMode::Maximized => window.set_maximized(true),
            _ => (),

Review comment (suggestion):
```suggestion
```

I don't think this is needed. Especially since it's just one X11 thing.

Code after:

        info!("Cell Size: {} x {}", cell_width, cell_height);
        info!("Padding: {} x {}", padding_x, padding_y);

        // Create new size with at least one column and row.
        let size_info = SizeInfo {
            dpr,
            width: (viewport_size.width as f32).max(cell_width + 2. * padding_x),
            height: (viewport_size.height as f32).max(cell_height + 2. * padding_y),
            cell_width,
            cell_height,
            padding_x,
            padding_y,
        };

        // Update OpenGL projection.
        renderer.resize(&size_info);

        // Call `clear` before showing the window, to make sure the surface is initialized.
        let background_color = config.colors.primary.background;
        renderer.with_api(&config, &size_info, |api| {
            api.clear(background_color);
        });

        #[cfg(not(any(target_os = "macos", windows)))]
        let is_x11 = event_loop.is_x11();

        #[cfg(not(any(target_os = "macos", windows)))]
        {
            // On Wayland we can safely ignore this call, since the window isn't visible until you
            // actually draw something into it and commit those changes.
            if is_x11 {
                window.swap_buffers();
                renderer.with_api(&config, &size_info, |api| {
                    api.finish();
                });
            }
        }

        window.set_visible(true);

        // Set window position.
        //
        // TODO: replace `set_position` with `with_position` once available
        // Upstream issue: https://github.com/rust-windowing/winit/issues/806.
        if let Some(position) = config.window.position {
            window.set_outer_position(PhysicalPosition::from((position.x, position.y)));
        }

        #[allow(clippy::single_match)]
        match config.window.startup_mode() {