From 41ebb12c9ef58cc31a0bb6384892df265487124e Mon Sep 17 00:00:00 2001 From: Aziz Berkay Yesilyurt Date: Tue, 13 Jul 2021 23:43:19 +0200 Subject: [PATCH] ImageViewer: Do not resize the window if the image fits into the window --- Userland/Applications/ImageViewer/ViewWidget.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Userland/Applications/ImageViewer/ViewWidget.cpp b/Userland/Applications/ImageViewer/ViewWidget.cpp index 5524279a4a..c37fe46555 100644 --- a/Userland/Applications/ImageViewer/ViewWidget.cpp +++ b/Userland/Applications/ImageViewer/ViewWidget.cpp @@ -277,7 +277,12 @@ void ViewWidget::drop_event(GUI::DropEvent& event) void ViewWidget::resize_window() { - if (window()->is_fullscreen()) + if (window()->is_fullscreen() || window()->is_maximized()) + return; + + auto absolute_bitmap_rect = m_bitmap_rect; + absolute_bitmap_rect.translate_by(window()->rect().top_left()); + if (window()->rect().contains(absolute_bitmap_rect)) return; if (!m_bitmap)