From 259228d8d257ae6a6ce049e640101025c7c0c6dc Mon Sep 17 00:00:00 2001 From: 0GreenClover0 Date: Wed, 2 Aug 2023 03:40:51 +0200 Subject: [PATCH] Spreadsheet: Set Help window mode to Modeless in the constructor And don't try to do it every time the Help button is clicked. This fixes a crash when clicking the Help button twice (setting window mode on an already visible window is not supported). This also fixes a situation where when opening the Help window with an action, we didn't set its mode to "Modeless". --- Userland/Applications/Spreadsheet/HelpWindow.cpp | 1 + Userland/Applications/Spreadsheet/SpreadsheetWidget.cpp | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Applications/Spreadsheet/HelpWindow.cpp b/Userland/Applications/Spreadsheet/HelpWindow.cpp index 013b15569a0..9e30e316a94 100644 --- a/Userland/Applications/Spreadsheet/HelpWindow.cpp +++ b/Userland/Applications/Spreadsheet/HelpWindow.cpp @@ -66,6 +66,7 @@ HelpWindow::HelpWindow(GUI::Window* parent) resize(530, 365); set_title("Spreadsheet Functions Help"); set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/app-help.png"sv).release_value_but_fixme_should_propagate_errors()); + set_window_mode(GUI::WindowMode::Modeless); auto widget = set_main_widget().release_value_but_fixme_should_propagate_errors(); widget->set_layout(); diff --git a/Userland/Applications/Spreadsheet/SpreadsheetWidget.cpp b/Userland/Applications/Spreadsheet/SpreadsheetWidget.cpp index 5a24173ed80..d771f5cd2a6 100644 --- a/Userland/Applications/Spreadsheet/SpreadsheetWidget.cpp +++ b/Userland/Applications/Spreadsheet/SpreadsheetWidget.cpp @@ -55,7 +55,6 @@ SpreadsheetWidget::SpreadsheetWidget(GUI::Window& parent_window, Vectorgather_documentation(); auto help_window = HelpWindow::the(window()); help_window->set_docs(move(docs)); - help_window->set_window_mode(GUI::WindowMode::Modeless); help_window->show(); } };