LibGUI+FileSystemAccessServer: Avoid using dummy windows

Creates two new gatekept helpers for FilePicker and MessageBox to be
used by FSAS to replace the "dummy window" approach to centering
Dialogs. There was a slight delay in creating two windows, one a
transparent intermediary hidden behind the second, to display FSAS
Dialogs. Now we only need to make the window we actually see.
This commit is contained in:
thankyouverycool 2023-05-13 05:07:41 -04:00 committed by Andreas Kling
commit 7323a54e59
Notes: sideshowbarker 2024-07-17 14:36:19 +09:00
6 changed files with 58 additions and 26 deletions

View file

@ -10,6 +10,12 @@
#include <AK/Time.h>
#include <LibGUI/Dialog.h>
namespace FileSystemAccessServer {
class ConnectionFromClient;
}
namespace GUI {
class MessageBox : public Dialog {
@ -36,6 +42,7 @@ public:
static ExecResult show_error(Window* parent_window, StringView text);
static ExecResult ask_about_unsaved_changes(Window* parent_window, StringView path, Optional<Time> last_unmodified_timestamp = {});
static ErrorOr<ExecResult> try_show(Badge<FileSystemAccessServer::ConnectionFromClient>, i32 window_server_client_id, i32 parent_window_id, StringView text, StringView title);
static ErrorOr<ExecResult> try_show(Window* parent_window, StringView text, StringView title, Type type = Type::None, InputType input_type = InputType::OK);
static ErrorOr<ExecResult> try_show_error(Window* parent_window, StringView text);
static ErrorOr<ExecResult> try_ask_about_unsaved_changes(Window* parent_window, StringView path, Optional<Time> last_unmodified_timestamp = {});