Repository: electron/electron
File: shell/browser/ui/electron_desktop_window_tree_host_linux.cc (C++)

Code before:
         !native_window_view_->IsMinimized();
}

void ElectronDesktopWindowTreeHostLinux::SetWindowIcons(
    const gfx::ImageSkia& window_icon,
    const gfx::ImageSkia& app_icon) {
  DesktopWindowTreeHostLinux::SetWindowIcons(window_icon, app_icon);

  auto* wayland_extension = ui::GetWaylandToplevelExtension(*platform_window());
  if (!wayland_extension) {
    return;
  }

  saved_window_icon_ = window_icon;
}

void ElectronDesktopWindowTreeHostLinux::Show(
    ui::mojom::WindowShowState show_state,
    const gfx::Rect& restore_bounds) {
  DesktopWindowTreeHostLinux::Show(show_state, restore_bounds);

  if (saved_window_icon_.isNull()) {
    return;
  }

  DesktopWindowTreeHostLinux::SetWindowIcons(saved_window_icon_, {});
}

gfx::Insets ElectronDesktopWindowTreeHostLinux::CalculateInsetsInDIP(
    ui::PlatformWindowState window_state) const {
  // If we are not showing frame, the insets should be zero.
  if (!IsShowingFrame()) {
    return gfx::Insets();
  }

  auto* const view = native_window_view_->GetClientFrameViewLinux();
  if (!view)
    return {};

  gfx::Insets insets = view->RestoredMirroredFrameBorderInsets();
  if (base::i18n::IsRTL())
    insets.set_left_right(insets.right(), insets.left());
  return insets;
}

void ElectronDesktopWindowTreeHostLinux::OnBoundsChanged(
    const BoundsChange& change) {
  views::DesktopWindowTreeHostLinux::OnBoundsChanged(change);
  UpdateFrameHints();

  if (x11_util::IsX11()) {

Review comment (suggestion):
```suggestion
  if (!saved_window_icon_.isNull())
    DesktopWindowTreeHostLinux::SetWindowIcons(saved_window_icon_, {});
```

Code after:
         !native_window_view_->IsMinimized();
}

void ElectronDesktopWindowTreeHostLinux::SetWindowIcons(
    const gfx::ImageSkia& window_icon,
    const gfx::ImageSkia& app_icon) {
  DesktopWindowTreeHostLinux::SetWindowIcons(window_icon, app_icon);

  if (ui::GetWaylandToplevelExtension(*platform_window()))
    saved_window_icon_ = window_icon;
}

void ElectronDesktopWindowTreeHostLinux::Show(
    ui::mojom::WindowShowState show_state,
    const gfx::Rect& restore_bounds) {
  DesktopWindowTreeHostLinux::Show(show_state, restore_bounds);

  if (!saved_window_icon_.isNull())
    DesktopWindowTreeHostLinux::SetWindowIcons(saved_window_icon_, {});
}

gfx::Insets ElectronDesktopWindowTreeHostLinux::CalculateInsetsInDIP(
    ui::PlatformWindowState window_state) const {
  // If we are not showing frame, the insets should be zero.
  if (!IsShowingFrame()) {
    return gfx::Insets();
  }

  auto* const view = native_window_view_->GetClientFrameViewLinux();
  if (!view)
    return {};

  gfx::Insets insets = view->RestoredMirroredFrameBorderInsets();
  if (base::i18n::IsRTL())
    insets.set_left_right(insets.right(), insets.left());
  return insets;
}

void ElectronDesktopWindowTreeHostLinux::OnBoundsChanged(
    const BoundsChange& change) {
  views::DesktopWindowTreeHostLinux::OnBoundsChanged(change);
  UpdateFrameHints();

  if (x11_util::IsX11()) {
    // The OnWindowStateChanged should receive all updates but currently under
    // X11 it doesn't receive changes to the fullscreen status because chromium
    // is handling the fullscreen state changes synchronously, see
    // X11Window::ToggleFullscreen in ui/ozone/platform/x11/x11_window.cc.
    UpdateWindowState(platform_window()->GetPlatformWindowState());
  }
}