From 935d0239676a6d71e3f7fc4d7e37c15d4b1fa6f5 Mon Sep 17 00:00:00 2001 From: Itamar Date: Fri, 25 Feb 2022 12:39:33 +0200 Subject: [PATCH] Userland: Rename WindowServerConnection=>ConnectionToWindowServer This was done with CLion's automatic rename feature. --- Documentation/Patterns.md | 2 +- .../BackgroundSettingsWidget.cpp | 2 +- .../DisplaySettings/DesktopSettingsWidget.cpp | 4 +- .../DisplaySettings/FontSettingsWidget.cpp | 4 +- .../DisplaySettings/MonitorSettingsWidget.cpp | 14 ++-- .../Magnifier/MagnifierWidget.cpp | 4 +- .../MouseSettings/MouseWidget.cpp | 18 ++--- .../MouseSettings/ThemeWidget.cpp | 6 +- .../SpaceAnalyzer/TreeMapWidget.cpp | 4 +- .../Applications/TerminalSettings/main.cpp | 2 +- Userland/Demos/Mouse/main.cpp | 4 +- Userland/Demos/WidgetGallery/GalleryModels.h | 4 +- .../LibFileSystemAccessClient/Client.cpp | 26 +++--- Userland/Libraries/LibGUI/Application.cpp | 8 +- Userland/Libraries/LibGUI/Application.h | 2 +- Userland/Libraries/LibGUI/CMakeLists.txt | 2 +- Userland/Libraries/LibGUI/ColorPicker.cpp | 4 +- ...ction.cpp => ConnectionToWindowServer.cpp} | 80 +++++++++---------- ...onnection.h => ConnectionToWindowServer.h} | 8 +- Userland/Libraries/LibGUI/Desktop.cpp | 14 ++-- Userland/Libraries/LibGUI/Desktop.h | 2 +- Userland/Libraries/LibGUI/DisplayLink.cpp | 8 +- Userland/Libraries/LibGUI/DisplayLink.h | 2 +- Userland/Libraries/LibGUI/DragOperation.cpp | 8 +- Userland/Libraries/LibGUI/DragOperation.h | 4 +- Userland/Libraries/LibGUI/Event.h | 2 +- Userland/Libraries/LibGUI/Forward.h | 2 +- Userland/Libraries/LibGUI/Menu.cpp | 20 ++--- Userland/Libraries/LibGUI/Menu.h | 2 +- Userland/Libraries/LibGUI/MenuItem.cpp | 4 +- Userland/Libraries/LibGUI/MouseTracker.cpp | 8 +- Userland/Libraries/LibGUI/MouseTracker.h | 2 +- Userland/Libraries/LibGUI/Widget.cpp | 2 +- Userland/Libraries/LibGUI/Window.cpp | 80 +++++++++---------- Userland/Libraries/LibGUI/Window.h | 6 +- .../ConnectionFromClient.cpp | 8 +- Userland/Services/Taskbar/TaskbarButton.cpp | 2 +- Userland/Services/Taskbar/TaskbarWindow.cpp | 4 +- Userland/Services/Taskbar/main.cpp | 6 +- .../Services/WindowServer/WindowManager.cpp | 2 +- Userland/Utilities/chres.cpp | 8 +- Userland/Utilities/shot.cpp | 4 +- Userland/Utilities/wsctl.cpp | 4 +- 43 files changed, 201 insertions(+), 201 deletions(-) rename Userland/Libraries/LibGUI/{WindowServerConnection.cpp => ConnectionToWindowServer.cpp} (75%) rename Userland/Libraries/LibGUI/{WindowServerConnection.h => ConnectionToWindowServer.h} (92%) diff --git a/Documentation/Patterns.md b/Documentation/Patterns.md index 6cb26289979..4e9d8bb76c1 100644 --- a/Documentation/Patterns.md +++ b/Documentation/Patterns.md @@ -30,7 +30,7 @@ ErrorOr> Window::try_add_menu(String name) auto menu = TRY(m_menubar->try_add_menu({}, move(name))); if (m_window_id) { menu->realize_menu_if_needed(); - WindowServerConnection::the().async_add_menu(m_window_id, menu->menu_id()); + ConnectionToWindowServer::the().async_add_menu(m_window_id, menu->menu_id()); } return menu; } diff --git a/Userland/Applications/DisplaySettings/BackgroundSettingsWidget.cpp b/Userland/Applications/DisplaySettings/BackgroundSettingsWidget.cpp index 0a7e222cc6d..d4c9fdc060c 100644 --- a/Userland/Applications/DisplaySettings/BackgroundSettingsWidget.cpp +++ b/Userland/Applications/DisplaySettings/BackgroundSettingsWidget.cpp @@ -16,13 +16,13 @@ #include #include #include +#include #include #include #include #include #include #include -#include #include #include diff --git a/Userland/Applications/DisplaySettings/DesktopSettingsWidget.cpp b/Userland/Applications/DisplaySettings/DesktopSettingsWidget.cpp index 0585bd98ac9..d0d5b8df70f 100644 --- a/Userland/Applications/DisplaySettings/DesktopSettingsWidget.cpp +++ b/Userland/Applications/DisplaySettings/DesktopSettingsWidget.cpp @@ -7,11 +7,11 @@ #include "DesktopSettingsWidget.h" #include #include +#include #include #include #include #include -#include namespace DisplaySettings { @@ -42,7 +42,7 @@ void DesktopSettingsWidget::apply_settings() auto workspace_columns = (unsigned)m_workspace_columns_spinbox->value(); auto& desktop = GUI::Desktop::the(); if (workspace_rows != desktop.workspace_rows() || workspace_columns != desktop.workspace_columns()) { - if (!GUI::WindowServerConnection::the().apply_workspace_settings(workspace_rows, workspace_columns, true)) { + if (!GUI::ConnectionToWindowServer::the().apply_workspace_settings(workspace_rows, workspace_columns, true)) { GUI::MessageBox::show(window(), String::formatted("Error applying workspace settings"), "Workspace settings", GUI::MessageBox::Type::Error); } diff --git a/Userland/Applications/DisplaySettings/FontSettingsWidget.cpp b/Userland/Applications/DisplaySettings/FontSettingsWidget.cpp index 433e838e60f..92041a1223a 100644 --- a/Userland/Applications/DisplaySettings/FontSettingsWidget.cpp +++ b/Userland/Applications/DisplaySettings/FontSettingsWidget.cpp @@ -9,8 +9,8 @@ #include "FontSettingsWidget.h" #include #include +#include #include -#include #include namespace DisplaySettings { @@ -54,7 +54,7 @@ static void update_label_with_font(GUI::Label& label, Gfx::Font const& font) void FontSettingsWidget::apply_settings() { - GUI::WindowServerConnection::the().set_system_fonts(m_default_font_label->font().qualified_name(), m_fixed_width_font_label->font().qualified_name()); + GUI::ConnectionToWindowServer::the().set_system_fonts(m_default_font_label->font().qualified_name(), m_fixed_width_font_label->font().qualified_name()); } } diff --git a/Userland/Applications/DisplaySettings/MonitorSettingsWidget.cpp b/Userland/Applications/DisplaySettings/MonitorSettingsWidget.cpp index 335859121a8..e3de3f80292 100644 --- a/Userland/Applications/DisplaySettings/MonitorSettingsWidget.cpp +++ b/Userland/Applications/DisplaySettings/MonitorSettingsWidget.cpp @@ -10,11 +10,11 @@ #include #include #include +#include #include #include #include #include -#include #include namespace DisplaySettings { @@ -140,7 +140,7 @@ static String display_name_from_edid(EDID::Parser const& edid) void MonitorSettingsWidget::load_current_settings() { - m_screen_layout = GUI::WindowServerConnection::the().get_screen_layout(); + m_screen_layout = GUI::ConnectionToWindowServer::the().get_screen_layout(); m_screens.clear(); m_screen_edids.clear(); @@ -214,9 +214,9 @@ void MonitorSettingsWidget::apply_settings() { // Fetch the latest configuration again, in case it has been changed by someone else. // This isn't technically race free, but if the user automates changing settings we can't help... - auto current_layout = GUI::WindowServerConnection::the().get_screen_layout(); + auto current_layout = GUI::ConnectionToWindowServer::the().get_screen_layout(); if (m_screen_layout != current_layout) { - auto result = GUI::WindowServerConnection::the().set_screen_layout(m_screen_layout, false); + auto result = GUI::ConnectionToWindowServer::the().set_screen_layout(m_screen_layout, false); if (result.success()) { load_current_settings(); // Refresh @@ -243,13 +243,13 @@ void MonitorSettingsWidget::apply_settings() // If the user selects "No", closes the window or the window gets closed by the 10 seconds timer, revert the changes. if (box->exec() == GUI::MessageBox::ExecYes) { - auto save_result = GUI::WindowServerConnection::the().save_screen_layout(); + auto save_result = GUI::ConnectionToWindowServer::the().save_screen_layout(); if (!save_result.success()) { GUI::MessageBox::show(window(), String::formatted("Error saving settings: {}", save_result.error_msg()), "Unable to save setting", GUI::MessageBox::Type::Error); } } else { - auto restore_result = GUI::WindowServerConnection::the().set_screen_layout(current_layout, false); + auto restore_result = GUI::ConnectionToWindowServer::the().set_screen_layout(current_layout, false); if (!restore_result.success()) { GUI::MessageBox::show(window(), String::formatted("Error restoring settings: {}", restore_result.error_msg()), "Unable to restore setting", GUI::MessageBox::Type::Error); @@ -269,7 +269,7 @@ void MonitorSettingsWidget::show_screen_numbers(bool show) if (m_showing_screen_numbers == show) return; m_showing_screen_numbers = show; - GUI::WindowServerConnection::the().async_show_screen_numbers(show); + GUI::ConnectionToWindowServer::the().async_show_screen_numbers(show); } void MonitorSettingsWidget::show_event(GUI::ShowEvent&) diff --git a/Userland/Applications/Magnifier/MagnifierWidget.cpp b/Userland/Applications/Magnifier/MagnifierWidget.cpp index b60bcc25e68..3595ece21e6 100644 --- a/Userland/Applications/Magnifier/MagnifierWidget.cpp +++ b/Userland/Applications/Magnifier/MagnifierWidget.cpp @@ -6,10 +6,10 @@ */ #include "MagnifierWidget.h" +#include #include #include #include -#include #include MagnifierWidget::MagnifierWidget() @@ -53,7 +53,7 @@ void MagnifierWidget::sync() auto size = frame_inner_rect().size(); Gfx::IntSize grab_size { size.width() / m_scale_factor, size.height() / m_scale_factor }; - m_grabbed_bitmap = GUI::WindowServerConnection::the().get_screen_bitmap_around_cursor(grab_size).bitmap(); + m_grabbed_bitmap = GUI::ConnectionToWindowServer::the().get_screen_bitmap_around_cursor(grab_size).bitmap(); m_grabbed_bitmaps.enqueue(m_grabbed_bitmap); update(); } diff --git a/Userland/Applications/MouseSettings/MouseWidget.cpp b/Userland/Applications/MouseSettings/MouseWidget.cpp index 045510f9047..c73c66be04a 100644 --- a/Userland/Applications/MouseSettings/MouseWidget.cpp +++ b/Userland/Applications/MouseSettings/MouseWidget.cpp @@ -7,10 +7,10 @@ #include "MouseWidget.h" #include +#include #include #include #include -#include #include #include @@ -28,12 +28,12 @@ MouseWidget::MouseWidget() m_speed_slider->on_change = [&](int value) { m_speed_label->set_text(String::formatted("{} %", value)); }; - int const slider_value = float { speed_slider_scale } * GUI::WindowServerConnection::the().get_mouse_acceleration(); + int const slider_value = float { speed_slider_scale } * GUI::ConnectionToWindowServer::the().get_mouse_acceleration(); m_speed_slider->set_value(slider_value); m_scroll_length_spinbox = *find_descendant_of_type_named("scroll_length_spinbox"); m_scroll_length_spinbox->set_min(WindowServer::scroll_step_size_min); - m_scroll_length_spinbox->set_value(GUI::WindowServerConnection::the().get_scroll_step_size()); + m_scroll_length_spinbox->set_value(GUI::ConnectionToWindowServer::the().get_scroll_step_size()); m_double_click_arrow_widget = *find_descendant_of_type_named("double_click_arrow_widget"); m_double_click_speed_label = *find_descendant_of_type_named("double_click_speed_label"); @@ -44,18 +44,18 @@ MouseWidget::MouseWidget() m_double_click_arrow_widget->set_double_click_speed(speed); m_double_click_speed_label->set_text(String::formatted("{} ms", speed)); }; - m_double_click_speed_slider->set_value(GUI::WindowServerConnection::the().get_double_click_speed()); + m_double_click_speed_slider->set_value(GUI::ConnectionToWindowServer::the().get_double_click_speed()); m_switch_buttons_checkbox = *find_descendant_of_type_named("switch_buttons_input"); - m_switch_buttons_checkbox->set_checked(GUI::WindowServerConnection::the().get_buttons_switched()); + m_switch_buttons_checkbox->set_checked(GUI::ConnectionToWindowServer::the().get_buttons_switched()); } void MouseWidget::apply_settings() { float const factor = m_speed_slider->value() / speed_slider_scale; - GUI::WindowServerConnection::the().async_set_mouse_acceleration(factor); - GUI::WindowServerConnection::the().async_set_scroll_step_size(m_scroll_length_spinbox->value()); - GUI::WindowServerConnection::the().async_set_double_click_speed(m_double_click_speed_slider->value()); - GUI::WindowServerConnection::the().async_set_buttons_switched(m_switch_buttons_checkbox->is_checked()); + GUI::ConnectionToWindowServer::the().async_set_mouse_acceleration(factor); + GUI::ConnectionToWindowServer::the().async_set_scroll_step_size(m_scroll_length_spinbox->value()); + GUI::ConnectionToWindowServer::the().async_set_double_click_speed(m_double_click_speed_slider->value()); + GUI::ConnectionToWindowServer::the().async_set_buttons_switched(m_switch_buttons_checkbox->is_checked()); } void MouseWidget::reset_default_values() diff --git a/Userland/Applications/MouseSettings/ThemeWidget.cpp b/Userland/Applications/MouseSettings/ThemeWidget.cpp index 6fc7749d902..22e83a6f085 100644 --- a/Userland/Applications/MouseSettings/ThemeWidget.cpp +++ b/Userland/Applications/MouseSettings/ThemeWidget.cpp @@ -11,9 +11,9 @@ #include #include #include +#include #include #include -#include String MouseCursorModel::column_name(int column_index) const { @@ -115,7 +115,7 @@ ThemeWidget::ThemeWidget() m_cursors_tableview->set_column_width(0, 25); m_cursors_tableview->model()->invalidate(); - m_theme_name = GUI::WindowServerConnection::the().get_cursor_theme(); + m_theme_name = GUI::ConnectionToWindowServer::the().get_cursor_theme(); mouse_cursor_model->change_theme(m_theme_name); m_theme_name_box = find_descendant_of_type_named("theme_name_box"); @@ -130,7 +130,7 @@ ThemeWidget::ThemeWidget() void ThemeWidget::apply_settings() { - GUI::WindowServerConnection::the().async_apply_cursor_theme(m_theme_name_box->text()); + GUI::ConnectionToWindowServer::the().async_apply_cursor_theme(m_theme_name_box->text()); } void ThemeWidget::reset_default_values() diff --git a/Userland/Applications/SpaceAnalyzer/TreeMapWidget.cpp b/Userland/Applications/SpaceAnalyzer/TreeMapWidget.cpp index c8d7b10ec1e..ea65abc774b 100644 --- a/Userland/Applications/SpaceAnalyzer/TreeMapWidget.cpp +++ b/Userland/Applications/SpaceAnalyzer/TreeMapWidget.cpp @@ -6,8 +6,8 @@ #include "TreeMapWidget.h" #include +#include #include -#include #include #include @@ -309,7 +309,7 @@ void TreeMapWidget::mousewheel_event(GUI::MouseEvent& event) { int delta = event.wheel_delta_y(); // FIXME: The wheel_delta_y is premultiplied in the window server, we actually want a raw value here. - int step_size = GUI::WindowServerConnection::the().get_scroll_step_size(); + int step_size = GUI::ConnectionToWindowServer::the().get_scroll_step_size(); if (delta > 0) { size_t step_back = delta / step_size; if (step_back > m_viewpoint) diff --git a/Userland/Applications/TerminalSettings/main.cpp b/Userland/Applications/TerminalSettings/main.cpp index 6da08a039f2..865a08d085e 100644 --- a/Userland/Applications/TerminalSettings/main.cpp +++ b/Userland/Applications/TerminalSettings/main.cpp @@ -7,8 +7,8 @@ #include "TerminalSettingsWidget.h" #include #include +#include #include -#include #include // Including this after to avoid LibIPC errors diff --git a/Userland/Demos/Mouse/main.cpp b/Userland/Demos/Mouse/main.cpp index 1a739e8e78b..8ae5d9225fe 100644 --- a/Userland/Demos/Mouse/main.cpp +++ b/Userland/Demos/Mouse/main.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -17,7 +18,6 @@ #include #include #include -#include #include #include #include @@ -74,7 +74,7 @@ public: painter.stroke_path(path, Color::Black, 1); - auto primary_secondary_switched = GUI::WindowServerConnection::the().get_buttons_switched(); + auto primary_secondary_switched = GUI::ConnectionToWindowServer::the().get_buttons_switched(); auto primary_pressed = m_buttons & GUI::MouseButton::Primary; auto secondary_pressed = m_buttons & GUI::MouseButton::Secondary; diff --git a/Userland/Demos/WidgetGallery/GalleryModels.h b/Userland/Demos/WidgetGallery/GalleryModels.h index 8f0f61a3037..a9b2142c988 100644 --- a/Userland/Demos/WidgetGallery/GalleryModels.h +++ b/Userland/Demos/WidgetGallery/GalleryModels.h @@ -10,8 +10,8 @@ #include #include #include +#include #include -#include #include class MouseCursorModel final : public GUI::Model { @@ -60,7 +60,7 @@ public: { m_cursors.clear(); - Core::DirIterator iterator(String::formatted("/res/cursor-themes/{}", GUI::WindowServerConnection::the().get_cursor_theme()), Core::DirIterator::Flags::SkipDots); + Core::DirIterator iterator(String::formatted("/res/cursor-themes/{}", GUI::ConnectionToWindowServer::the().get_cursor_theme()), Core::DirIterator::Flags::SkipDots); while (iterator.has_next()) { auto path = iterator.next_full_path(); diff --git a/Userland/Libraries/LibFileSystemAccessClient/Client.cpp b/Userland/Libraries/LibFileSystemAccessClient/Client.cpp index cdf9cc3bd6d..4c2bedea014 100644 --- a/Userland/Libraries/LibFileSystemAccessClient/Client.cpp +++ b/Userland/Libraries/LibFileSystemAccessClient/Client.cpp @@ -7,7 +7,7 @@ // FIXME: LibIPC Decoder and Encoder are sensitive to include order here // clang-format off -#include +#include // clang-format on #include #include @@ -31,14 +31,14 @@ Result Client::try_request_file_read_only_approved(GUI::Window* parent_window, S m_promise = Core::Promise::construct(); m_parent_window = parent_window; - auto parent_window_server_client_id = GUI::WindowServerConnection::the().expose_client_id(); + auto parent_window_server_client_id = GUI::ConnectionToWindowServer::the().expose_client_id(); auto child_window_server_client_id = expose_window_server_client_id(); auto parent_window_id = parent_window->window_id(); - GUI::WindowServerConnection::the().async_add_window_stealing_for_client(child_window_server_client_id, parent_window_id); + GUI::ConnectionToWindowServer::the().async_add_window_stealing_for_client(child_window_server_client_id, parent_window_id); ScopeGuard guard([parent_window_id, child_window_server_client_id] { - GUI::WindowServerConnection::the().async_remove_window_stealing_for_client(child_window_server_client_id, parent_window_id); + GUI::ConnectionToWindowServer::the().async_remove_window_stealing_for_client(child_window_server_client_id, parent_window_id); }); if (path.starts_with('/')) { @@ -56,14 +56,14 @@ Result Client::try_request_file(GUI::Window* parent_window, String const& path, m_promise = Core::Promise::construct(); m_parent_window = parent_window; - auto parent_window_server_client_id = GUI::WindowServerConnection::the().expose_client_id(); + auto parent_window_server_client_id = GUI::ConnectionToWindowServer::the().expose_client_id(); auto child_window_server_client_id = expose_window_server_client_id(); auto parent_window_id = parent_window->window_id(); - GUI::WindowServerConnection::the().async_add_window_stealing_for_client(child_window_server_client_id, parent_window_id); + GUI::ConnectionToWindowServer::the().async_add_window_stealing_for_client(child_window_server_client_id, parent_window_id); ScopeGuard guard([parent_window_id, child_window_server_client_id] { - GUI::WindowServerConnection::the().async_remove_window_stealing_for_client(child_window_server_client_id, parent_window_id); + GUI::ConnectionToWindowServer::the().async_remove_window_stealing_for_client(child_window_server_client_id, parent_window_id); }); if (path.starts_with('/')) { @@ -81,14 +81,14 @@ Result Client::try_open_file(GUI::Window* parent_window, String const& window_ti m_promise = Core::Promise::construct(); m_parent_window = parent_window; - auto parent_window_server_client_id = GUI::WindowServerConnection::the().expose_client_id(); + auto parent_window_server_client_id = GUI::ConnectionToWindowServer::the().expose_client_id(); auto child_window_server_client_id = expose_window_server_client_id(); auto parent_window_id = parent_window->window_id(); - GUI::WindowServerConnection::the().async_add_window_stealing_for_client(child_window_server_client_id, parent_window_id); + GUI::ConnectionToWindowServer::the().async_add_window_stealing_for_client(child_window_server_client_id, parent_window_id); ScopeGuard guard([parent_window_id, child_window_server_client_id] { - GUI::WindowServerConnection::the().async_remove_window_stealing_for_client(child_window_server_client_id, parent_window_id); + GUI::ConnectionToWindowServer::the().async_remove_window_stealing_for_client(child_window_server_client_id, parent_window_id); }); async_prompt_open_file(parent_window_server_client_id, parent_window_id, window_title, path, requested_access); @@ -101,14 +101,14 @@ Result Client::try_save_file(GUI::Window* parent_window, String const& name, Str m_promise = Core::Promise::construct(); m_parent_window = parent_window; - auto parent_window_server_client_id = GUI::WindowServerConnection::the().expose_client_id(); + auto parent_window_server_client_id = GUI::ConnectionToWindowServer::the().expose_client_id(); auto child_window_server_client_id = expose_window_server_client_id(); auto parent_window_id = parent_window->window_id(); - GUI::WindowServerConnection::the().async_add_window_stealing_for_client(child_window_server_client_id, parent_window_id); + GUI::ConnectionToWindowServer::the().async_add_window_stealing_for_client(child_window_server_client_id, parent_window_id); ScopeGuard guard([parent_window_id, child_window_server_client_id] { - GUI::WindowServerConnection::the().async_remove_window_stealing_for_client(child_window_server_client_id, parent_window_id); + GUI::ConnectionToWindowServer::the().async_remove_window_stealing_for_client(child_window_server_client_id, parent_window_id); }); async_prompt_save_file(parent_window_server_client_id, parent_window_id, name.is_null() ? "Untitled" : name, ext.is_null() ? "txt" : ext, Core::StandardPaths::home_directory(), requested_access); diff --git a/Userland/Libraries/LibGUI/Application.cpp b/Userland/Libraries/LibGUI/Application.cpp index 5b5b7554a60..1ab1ad8bec2 100644 --- a/Userland/Libraries/LibGUI/Application.cpp +++ b/Userland/Libraries/LibGUI/Application.cpp @@ -9,12 +9,12 @@ #include #include #include +#include #include #include #include #include #include -#include #include #include @@ -73,7 +73,7 @@ Application::Application(int argc, char** argv, Core::EventLoop::MakeInspectable VERIFY(!*s_the); *s_the = *this; m_event_loop = make(make_inspectable); - WindowServerConnection::the(); + ConnectionToWindowServer::the(); Clipboard::initialize({}); if (argc > 0) m_invoked_as = argv[0]; @@ -222,7 +222,7 @@ void Application::request_tooltip_show() Gfx::IntRect desktop_rect = Desktop::the().rect(); const int margin = 30; - Gfx::IntPoint adjusted_pos = WindowServerConnection::the().get_global_cursor_position(); + Gfx::IntPoint adjusted_pos = ConnectionToWindowServer::the().get_global_cursor_position(); adjusted_pos.translate_by(0, 18); @@ -293,7 +293,7 @@ void Application::set_drag_hovered_widget_impl(Widget* widget, const Gfx::IntPoi } } -void Application::notify_drag_cancelled(Badge) +void Application::notify_drag_cancelled(Badge) { set_drag_hovered_widget_impl(nullptr); } diff --git a/Userland/Libraries/LibGUI/Application.h b/Userland/Libraries/LibGUI/Application.h index 04dcbe3b75b..f4f594d6fdf 100644 --- a/Userland/Libraries/LibGUI/Application.h +++ b/Userland/Libraries/LibGUI/Application.h @@ -79,7 +79,7 @@ public: { set_drag_hovered_widget_impl(widget, position, move(mime_types)); } - void notify_drag_cancelled(Badge); + void notify_drag_cancelled(Badge); Function on_action_enter; Function on_action_leave; diff --git a/Userland/Libraries/LibGUI/CMakeLists.txt b/Userland/Libraries/LibGUI/CMakeLists.txt index afe4b5d4eec..48fb661c9ba 100644 --- a/Userland/Libraries/LibGUI/CMakeLists.txt +++ b/Userland/Libraries/LibGUI/CMakeLists.txt @@ -112,7 +112,7 @@ set(SOURCES VimEditingEngine.cpp Widget.cpp Window.cpp - WindowServerConnection.cpp + ConnectionToWindowServer.cpp ConnectionToWindowMangerServer.cpp Wizards/WizardDialog.cpp Wizards/AbstractWizardPage.cpp diff --git a/Userland/Libraries/LibGUI/ColorPicker.cpp b/Userland/Libraries/LibGUI/ColorPicker.cpp index 1a975b6dc33..4736c451e26 100644 --- a/Userland/Libraries/LibGUI/ColorPicker.cpp +++ b/Userland/Libraries/LibGUI/ColorPicker.cpp @@ -7,13 +7,13 @@ #include #include #include +#include #include #include #include #include #include #include -#include #include namespace GUI { @@ -158,7 +158,7 @@ private: virtual void mousedown_event(GUI::MouseEvent&) override { m_event_loop->quit(1); } virtual void mousemove_event(GUI::MouseEvent&) override { - auto new_col = WindowServerConnection::the().get_color_under_cursor(); + auto new_col = ConnectionToWindowServer::the().get_color_under_cursor(); if (!new_col.has_value()) return; if (new_col == m_col) diff --git a/Userland/Libraries/LibGUI/WindowServerConnection.cpp b/Userland/Libraries/LibGUI/ConnectionToWindowServer.cpp similarity index 75% rename from Userland/Libraries/LibGUI/WindowServerConnection.cpp rename to Userland/Libraries/LibGUI/ConnectionToWindowServer.cpp index aa5094c9f53..6511a39a27d 100644 --- a/Userland/Libraries/LibGUI/WindowServerConnection.cpp +++ b/Userland/Libraries/LibGUI/ConnectionToWindowServer.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -19,7 +20,6 @@ #include #include #include -#include #include #include #include @@ -27,11 +27,11 @@ namespace GUI { -WindowServerConnection& WindowServerConnection::the() +ConnectionToWindowServer& ConnectionToWindowServer::the() { - static RefPtr s_connection = nullptr; + static RefPtr s_connection = nullptr; if (!s_connection) - s_connection = WindowServerConnection::try_create().release_value_but_fixme_should_propagate_errors(); + s_connection = ConnectionToWindowServer::try_create().release_value_but_fixme_should_propagate_errors(); return *s_connection; } @@ -41,7 +41,7 @@ static void set_system_theme_from_anonymous_buffer(Core::AnonymousBuffer buffer) Application::the()->set_system_palette(buffer); } -WindowServerConnection::WindowServerConnection(NonnullOwnPtr socket) +ConnectionToWindowServer::ConnectionToWindowServer(NonnullOwnPtr socket) : IPC::ConnectionToServer(*this, move(socket)) { // NOTE: WindowServer automatically sends a "fast_greet" message to us when we connect. @@ -54,12 +54,12 @@ WindowServerConnection::WindowServerConnection(NonnullOwnPtrclient_id(); } -void WindowServerConnection::fast_greet(Vector const&, u32, u32, u32, Core::AnonymousBuffer const&, String const&, String const&, i32) +void ConnectionToWindowServer::fast_greet(Vector const&, u32, u32, u32, Core::AnonymousBuffer const&, String const&, String const&, i32) { // NOTE: This message is handled in the constructor. } -void WindowServerConnection::update_system_theme(Core::AnonymousBuffer const& theme_buffer) +void ConnectionToWindowServer::update_system_theme(Core::AnonymousBuffer const& theme_buffer) { set_system_theme_from_anonymous_buffer(theme_buffer); Window::update_all_windows({}); @@ -68,7 +68,7 @@ void WindowServerConnection::update_system_theme(Core::AnonymousBuffer const& th }); } -void WindowServerConnection::update_system_fonts(const String& default_font_query, const String& fixed_width_font_query) +void ConnectionToWindowServer::update_system_fonts(const String& default_font_query, const String& fixed_width_font_query) { Gfx::FontDatabase::set_default_font_query(default_font_query); Gfx::FontDatabase::set_fixed_width_font_query(fixed_width_font_query); @@ -78,56 +78,56 @@ void WindowServerConnection::update_system_fonts(const String& default_font_quer }); } -void WindowServerConnection::paint(i32 window_id, Gfx::IntSize const& window_size, Vector const& rects) +void ConnectionToWindowServer::paint(i32 window_id, Gfx::IntSize const& window_size, Vector const& rects) { if (auto* window = Window::from_window_id(window_id)) Core::EventLoop::current().post_event(*window, make(rects, window_size)); } -void WindowServerConnection::window_resized(i32 window_id, Gfx::IntRect const& new_rect) +void ConnectionToWindowServer::window_resized(i32 window_id, Gfx::IntRect const& new_rect) { if (auto* window = Window::from_window_id(window_id)) { Core::EventLoop::current().post_event(*window, make(new_rect.size())); } } -void WindowServerConnection::window_activated(i32 window_id) +void ConnectionToWindowServer::window_activated(i32 window_id) { if (auto* window = Window::from_window_id(window_id)) Core::EventLoop::current().post_event(*window, make(Event::WindowBecameActive)); } -void WindowServerConnection::window_deactivated(i32 window_id) +void ConnectionToWindowServer::window_deactivated(i32 window_id) { if (auto* window = Window::from_window_id(window_id)) Core::EventLoop::current().post_event(*window, make(Event::WindowBecameInactive)); } -void WindowServerConnection::window_input_entered(i32 window_id) +void ConnectionToWindowServer::window_input_entered(i32 window_id) { if (auto* window = Window::from_window_id(window_id)) Core::EventLoop::current().post_event(*window, make(Event::WindowInputEntered)); } -void WindowServerConnection::window_input_left(i32 window_id) +void ConnectionToWindowServer::window_input_left(i32 window_id) { if (auto* window = Window::from_window_id(window_id)) Core::EventLoop::current().post_event(*window, make(Event::WindowInputLeft)); } -void WindowServerConnection::window_close_request(i32 window_id) +void ConnectionToWindowServer::window_close_request(i32 window_id) { if (auto* window = Window::from_window_id(window_id)) Core::EventLoop::current().post_event(*window, make(Event::WindowCloseRequest)); } -void WindowServerConnection::window_entered(i32 window_id) +void ConnectionToWindowServer::window_entered(i32 window_id) { if (auto* window = Window::from_window_id(window_id)) Core::EventLoop::current().post_event(*window, make(Event::WindowEntered)); } -void WindowServerConnection::window_left(i32 window_id) +void ConnectionToWindowServer::window_left(i32 window_id) { if (auto* window = Window::from_window_id(window_id)) Core::EventLoop::current().post_event(*window, make(Event::WindowLeft)); @@ -163,7 +163,7 @@ static Action* action_for_key_event(Window& window, KeyEvent const& event) return nullptr; } -void WindowServerConnection::key_down(i32 window_id, u32 code_point, u32 key, u32 modifiers, u32 scancode) +void ConnectionToWindowServer::key_down(i32 window_id, u32 code_point, u32 key, u32 modifiers, u32 scancode) { auto* window = Window::from_window_id(window_id); if (!window) @@ -215,7 +215,7 @@ void WindowServerConnection::key_down(i32 window_id, u32 code_point, u32 key, u3 Core::EventLoop::current().post_event(*window, move(key_event)); } -void WindowServerConnection::key_up(i32 window_id, u32 code_point, u32 key, u32 modifiers, u32 scancode) +void ConnectionToWindowServer::key_up(i32 window_id, u32 code_point, u32 key, u32 modifiers, u32 scancode) { auto* window = Window::from_window_id(window_id); if (!window) @@ -246,19 +246,19 @@ static MouseButton to_mouse_button(u32 button) } } -void WindowServerConnection::mouse_down(i32 window_id, Gfx::IntPoint const& mouse_position, u32 button, u32 buttons, u32 modifiers, i32 wheel_delta_x, i32 wheel_delta_y) +void ConnectionToWindowServer::mouse_down(i32 window_id, Gfx::IntPoint const& mouse_position, u32 button, u32 buttons, u32 modifiers, i32 wheel_delta_x, i32 wheel_delta_y) { if (auto* window = Window::from_window_id(window_id)) Core::EventLoop::current().post_event(*window, make(Event::MouseDown, mouse_position, buttons, to_mouse_button(button), modifiers, wheel_delta_x, wheel_delta_y)); } -void WindowServerConnection::mouse_up(i32 window_id, Gfx::IntPoint const& mouse_position, u32 button, u32 buttons, u32 modifiers, i32 wheel_delta_x, i32 wheel_delta_y) +void ConnectionToWindowServer::mouse_up(i32 window_id, Gfx::IntPoint const& mouse_position, u32 button, u32 buttons, u32 modifiers, i32 wheel_delta_x, i32 wheel_delta_y) { if (auto* window = Window::from_window_id(window_id)) Core::EventLoop::current().post_event(*window, make(Event::MouseUp, mouse_position, buttons, to_mouse_button(button), modifiers, wheel_delta_x, wheel_delta_y)); } -void WindowServerConnection::mouse_move(i32 window_id, Gfx::IntPoint const& mouse_position, u32 button, u32 buttons, u32 modifiers, i32 wheel_delta_x, i32 wheel_delta_y, bool is_drag, Vector const& mime_types) +void ConnectionToWindowServer::mouse_move(i32 window_id, Gfx::IntPoint const& mouse_position, u32 button, u32 buttons, u32 modifiers, i32 wheel_delta_x, i32 wheel_delta_y, bool is_drag, Vector const& mime_types) { if (auto* window = Window::from_window_id(window_id)) { if (is_drag) @@ -268,19 +268,19 @@ void WindowServerConnection::mouse_move(i32 window_id, Gfx::IntPoint const& mous } } -void WindowServerConnection::mouse_double_click(i32 window_id, Gfx::IntPoint const& mouse_position, u32 button, u32 buttons, u32 modifiers, i32 wheel_delta_x, i32 wheel_delta_y) +void ConnectionToWindowServer::mouse_double_click(i32 window_id, Gfx::IntPoint const& mouse_position, u32 button, u32 buttons, u32 modifiers, i32 wheel_delta_x, i32 wheel_delta_y) { if (auto* window = Window::from_window_id(window_id)) Core::EventLoop::current().post_event(*window, make(Event::MouseDoubleClick, mouse_position, buttons, to_mouse_button(button), modifiers, wheel_delta_x, wheel_delta_y)); } -void WindowServerConnection::mouse_wheel(i32 window_id, Gfx::IntPoint const& mouse_position, u32 button, u32 buttons, u32 modifiers, i32 wheel_delta_x, i32 wheel_delta_y) +void ConnectionToWindowServer::mouse_wheel(i32 window_id, Gfx::IntPoint const& mouse_position, u32 button, u32 buttons, u32 modifiers, i32 wheel_delta_x, i32 wheel_delta_y) { if (auto* window = Window::from_window_id(window_id)) Core::EventLoop::current().post_event(*window, make(Event::MouseWheel, mouse_position, buttons, to_mouse_button(button), modifiers, wheel_delta_x, wheel_delta_y)); } -void WindowServerConnection::menu_visibility_did_change(i32 menu_id, bool visible) +void ConnectionToWindowServer::menu_visibility_did_change(i32 menu_id, bool visible) { auto* menu = Menu::from_menu_id(menu_id); if (!menu) { @@ -290,7 +290,7 @@ void WindowServerConnection::menu_visibility_did_change(i32 menu_id, bool visibl menu->visibility_did_change({}, visible); } -void WindowServerConnection::menu_item_activated(i32 menu_id, u32 identifier) +void ConnectionToWindowServer::menu_item_activated(i32 menu_id, u32 identifier) { auto* menu = Menu::from_menu_id(menu_id); if (!menu) { @@ -301,11 +301,11 @@ void WindowServerConnection::menu_item_activated(i32 menu_id, u32 identifier) action->activate(menu); } -void WindowServerConnection::menu_item_entered(i32 menu_id, u32 identifier) +void ConnectionToWindowServer::menu_item_entered(i32 menu_id, u32 identifier) { auto* menu = Menu::from_menu_id(menu_id); if (!menu) { - dbgln("WindowServerConnection received MenuItemEntered for invalid menu ID {}", menu_id); + dbgln("ConnectionToWindowServer received MenuItemEntered for invalid menu ID {}", menu_id); return; } auto* action = menu->action_at(identifier); @@ -317,11 +317,11 @@ void WindowServerConnection::menu_item_entered(i32 menu_id, u32 identifier) Core::EventLoop::current().post_event(*app, make(GUI::Event::ActionEnter, *action)); } -void WindowServerConnection::menu_item_left(i32 menu_id, u32 identifier) +void ConnectionToWindowServer::menu_item_left(i32 menu_id, u32 identifier) { auto* menu = Menu::from_menu_id(menu_id); if (!menu) { - dbgln("WindowServerConnection received MenuItemLeft for invalid menu ID {}", menu_id); + dbgln("ConnectionToWindowServer received MenuItemLeft for invalid menu ID {}", menu_id); return; } auto* action = menu->action_at(identifier); @@ -333,7 +333,7 @@ void WindowServerConnection::menu_item_left(i32 menu_id, u32 identifier) Core::EventLoop::current().post_event(*app, make(GUI::Event::ActionLeave, *action)); } -void WindowServerConnection::screen_rects_changed(Vector const& rects, u32 main_screen_index, u32 workspace_rows, u32 workspace_columns) +void ConnectionToWindowServer::screen_rects_changed(Vector const& rects, u32 main_screen_index, u32 workspace_rows, u32 workspace_columns) { Desktop::the().did_receive_screen_rects({}, rects, main_screen_index, workspace_rows, workspace_columns); Window::for_each_window({}, [&](auto& window) { @@ -341,19 +341,19 @@ void WindowServerConnection::screen_rects_changed(Vector const& re }); } -void WindowServerConnection::applet_area_rect_changed(Gfx::IntRect const& rect) +void ConnectionToWindowServer::applet_area_rect_changed(Gfx::IntRect const& rect) { Window::for_each_window({}, [&](auto& window) { Core::EventLoop::current().post_event(window, make(rect)); }); } -void WindowServerConnection::set_wallpaper_finished(bool) +void ConnectionToWindowServer::set_wallpaper_finished(bool) { // This is handled manually by Desktop::set_wallpaper(). } -void WindowServerConnection::drag_dropped(i32 window_id, Gfx::IntPoint const& mouse_position, String const& text, HashMap const& mime_data) +void ConnectionToWindowServer::drag_dropped(i32 window_id, Gfx::IntPoint const& mouse_position, String const& text, HashMap const& mime_data) { if (auto* window = Window::from_window_id(window_id)) { auto mime_data_obj = Core::MimeData::construct(mime_data); @@ -361,24 +361,24 @@ void WindowServerConnection::drag_dropped(i32 window_id, Gfx::IntPoint const& mo } } -void WindowServerConnection::drag_accepted() +void ConnectionToWindowServer::drag_accepted() { DragOperation::notify_accepted({}); } -void WindowServerConnection::drag_cancelled() +void ConnectionToWindowServer::drag_cancelled() { DragOperation::notify_cancelled({}); Application::the()->notify_drag_cancelled({}); } -void WindowServerConnection::window_state_changed(i32 window_id, bool minimized, bool occluded) +void ConnectionToWindowServer::window_state_changed(i32 window_id, bool minimized, bool occluded) { if (auto* window = Window::from_window_id(window_id)) window->notify_state_changed({}, minimized, occluded); } -void WindowServerConnection::display_link_notification() +void ConnectionToWindowServer::display_link_notification() { if (m_display_link_notification_pending) return; @@ -390,12 +390,12 @@ void WindowServerConnection::display_link_notification() }); } -void WindowServerConnection::track_mouse_move(Gfx::IntPoint const& mouse_position) +void ConnectionToWindowServer::track_mouse_move(Gfx::IntPoint const& mouse_position) { MouseTracker::track_mouse_move({}, mouse_position); } -void WindowServerConnection::ping() +void ConnectionToWindowServer::ping() { async_pong(); } diff --git a/Userland/Libraries/LibGUI/WindowServerConnection.h b/Userland/Libraries/LibGUI/ConnectionToWindowServer.h similarity index 92% rename from Userland/Libraries/LibGUI/WindowServerConnection.h rename to Userland/Libraries/LibGUI/ConnectionToWindowServer.h index 43fc3cd00b2..fbedf81389c 100644 --- a/Userland/Libraries/LibGUI/WindowServerConnection.h +++ b/Userland/Libraries/LibGUI/ConnectionToWindowServer.h @@ -13,16 +13,16 @@ namespace GUI { -class WindowServerConnection final +class ConnectionToWindowServer final : public IPC::ConnectionToServer , public WindowClientEndpoint { - IPC_CLIENT_CONNECTION(WindowServerConnection, "/tmp/portal/window") + IPC_CLIENT_CONNECTION(ConnectionToWindowServer, "/tmp/portal/window") public: - static WindowServerConnection& the(); + static ConnectionToWindowServer& the(); i32 expose_client_id() { return m_client_id; } private: - WindowServerConnection(NonnullOwnPtr); + ConnectionToWindowServer(NonnullOwnPtr); virtual void fast_greet(Vector const&, u32, u32, u32, Core::AnonymousBuffer const&, String const&, String const&, i32) override; virtual void paint(i32, Gfx::IntSize const&, Vector const&) override; diff --git a/Userland/Libraries/LibGUI/Desktop.cpp b/Userland/Libraries/LibGUI/Desktop.cpp index 7c42ea8a12a..81003eeae14 100644 --- a/Userland/Libraries/LibGUI/Desktop.cpp +++ b/Userland/Libraries/LibGUI/Desktop.cpp @@ -6,8 +6,8 @@ #include #include +#include #include -#include #include // Including this after to avoid LibIPC errors @@ -25,7 +25,7 @@ Desktop::Desktop() { } -void Desktop::did_receive_screen_rects(Badge, const Vector& rects, size_t main_screen_index, unsigned workspace_rows, unsigned workspace_columns) +void Desktop::did_receive_screen_rects(Badge, const Vector& rects, size_t main_screen_index, unsigned workspace_rows, unsigned workspace_columns) { m_main_screen_index = main_screen_index; m_rects = rects; @@ -46,12 +46,12 @@ void Desktop::did_receive_screen_rects(Badge, const Vect void Desktop::set_background_color(StringView background_color) { - WindowServerConnection::the().async_set_background_color(background_color); + ConnectionToWindowServer::the().async_set_background_color(background_color); } void Desktop::set_wallpaper_mode(StringView mode) { - WindowServerConnection::the().async_set_wallpaper_mode(mode); + ConnectionToWindowServer::the().async_set_wallpaper_mode(mode); } String Desktop::wallpaper_path() const @@ -61,7 +61,7 @@ String Desktop::wallpaper_path() const RefPtr Desktop::wallpaper_bitmap() const { - return WindowServerConnection::the().get_wallpaper().bitmap(); + return ConnectionToWindowServer::the().get_wallpaper().bitmap(); } bool Desktop::set_wallpaper(RefPtr wallpaper_bitmap, Optional path) @@ -70,8 +70,8 @@ bool Desktop::set_wallpaper(RefPtr wallpaper_bitmap, Optionalto_shareable_bitmap() : Gfx::ShareableBitmap {}); - auto ret_val = WindowServerConnection::the().wait_for_specific_message()->success(); + ConnectionToWindowServer::the().async_set_wallpaper(wallpaper_bitmap ? wallpaper_bitmap->to_shareable_bitmap() : Gfx::ShareableBitmap {}); + auto ret_val = ConnectionToWindowServer::the().wait_for_specific_message()->success(); if (ret_val && path.has_value()) { dbgln("Saving wallpaper path '{}' to ConfigServer", *path); diff --git a/Userland/Libraries/LibGUI/Desktop.h b/Userland/Libraries/LibGUI/Desktop.h index a80f10f4b35..788aef4785e 100644 --- a/Userland/Libraries/LibGUI/Desktop.h +++ b/Userland/Libraries/LibGUI/Desktop.h @@ -42,7 +42,7 @@ public: int taskbar_height() const { return TaskbarWindow::taskbar_height(); } - void did_receive_screen_rects(Badge, const Vector&, size_t, unsigned, unsigned); + void did_receive_screen_rects(Badge, const Vector&, size_t, unsigned, unsigned); template void on_receive_screen_rects(F&& callback) diff --git a/Userland/Libraries/LibGUI/DisplayLink.cpp b/Userland/Libraries/LibGUI/DisplayLink.cpp index 1cc4720bb4e..a9d528fe81a 100644 --- a/Userland/Libraries/LibGUI/DisplayLink.cpp +++ b/Userland/Libraries/LibGUI/DisplayLink.cpp @@ -6,8 +6,8 @@ #include #include +#include #include -#include namespace GUI { @@ -40,7 +40,7 @@ static i32 s_next_callback_id = 1; i32 DisplayLink::register_callback(Function callback) { if (callbacks().is_empty()) - WindowServerConnection::the().async_enable_display_link(); + ConnectionToWindowServer::the().async_enable_display_link(); i32 callback_id = s_next_callback_id++; callbacks().set(callback_id, adopt_ref(*new DisplayLinkCallback(callback_id, move(callback)))); @@ -54,12 +54,12 @@ bool DisplayLink::unregister_callback(i32 callback_id) callbacks().remove(callback_id); if (callbacks().is_empty()) - WindowServerConnection::the().async_disable_display_link(); + ConnectionToWindowServer::the().async_disable_display_link(); return true; } -void DisplayLink::notify(Badge) +void DisplayLink::notify(Badge) { auto copy_of_callbacks = callbacks(); for (auto& it : copy_of_callbacks) diff --git a/Userland/Libraries/LibGUI/DisplayLink.h b/Userland/Libraries/LibGUI/DisplayLink.h index 253aa504f83..81da42e9cb0 100644 --- a/Userland/Libraries/LibGUI/DisplayLink.h +++ b/Userland/Libraries/LibGUI/DisplayLink.h @@ -16,7 +16,7 @@ public: static i32 register_callback(Function); static bool unregister_callback(i32 callback_id); - static void notify(Badge); + static void notify(Badge); }; } diff --git a/Userland/Libraries/LibGUI/DragOperation.cpp b/Userland/Libraries/LibGUI/DragOperation.cpp index 74e8e7af7a6..c521f90bdcd 100644 --- a/Userland/Libraries/LibGUI/DragOperation.cpp +++ b/Userland/Libraries/LibGUI/DragOperation.cpp @@ -7,8 +7,8 @@ #include #include #include +#include #include -#include #include namespace GUI { @@ -37,7 +37,7 @@ DragOperation::Outcome DragOperation::exec() drag_bitmap = bitmap->to_shareable_bitmap(); } - auto started = WindowServerConnection::the().start_drag( + auto started = ConnectionToWindowServer::the().start_drag( m_mime_data->text(), m_mime_data->all_data(), drag_bitmap); @@ -64,13 +64,13 @@ void DragOperation::done(Outcome outcome) m_event_loop->quit(0); } -void DragOperation::notify_accepted(Badge) +void DragOperation::notify_accepted(Badge) { VERIFY(s_current_drag_operation); s_current_drag_operation->done(Outcome::Accepted); } -void DragOperation::notify_cancelled(Badge) +void DragOperation::notify_cancelled(Badge) { if (s_current_drag_operation) s_current_drag_operation->done(Outcome::Cancelled); diff --git a/Userland/Libraries/LibGUI/DragOperation.h b/Userland/Libraries/LibGUI/DragOperation.h index 1480ecd4546..7b9107c577a 100644 --- a/Userland/Libraries/LibGUI/DragOperation.h +++ b/Userland/Libraries/LibGUI/DragOperation.h @@ -33,8 +33,8 @@ public: Outcome exec(); Outcome outcome() const { return m_outcome; } - static void notify_accepted(Badge); - static void notify_cancelled(Badge); + static void notify_accepted(Badge); + static void notify_cancelled(Badge); protected: explicit DragOperation(Core::Object* parent = nullptr); diff --git a/Userland/Libraries/LibGUI/Event.h b/Userland/Libraries/LibGUI/Event.h index be57fab47f8..20340ec04e0 100644 --- a/Userland/Libraries/LibGUI/Event.h +++ b/Userland/Libraries/LibGUI/Event.h @@ -391,7 +391,7 @@ public: } private: - friend class WindowServerConnection; + friend class ConnectionToWindowServer; KeyCode m_key { KeyCode::Key_Invalid }; u8 m_modifiers { 0 }; u32 m_code_point { 0 }; diff --git a/Userland/Libraries/LibGUI/Forward.h b/Userland/Libraries/LibGUI/Forward.h index 8e0bd22223d..57e74eaadaf 100644 --- a/Userland/Libraries/LibGUI/Forward.h +++ b/Userland/Libraries/LibGUI/Forward.h @@ -88,7 +88,7 @@ class VerticalSlider; class WMEvent; class Widget; class Window; -class WindowServerConnection; +class ConnectionToWindowServer; enum class ModelRole; enum class SortOrder; diff --git a/Userland/Libraries/LibGUI/Menu.cpp b/Userland/Libraries/LibGUI/Menu.cpp index b84323e8237..340c0b211ec 100644 --- a/Userland/Libraries/LibGUI/Menu.cpp +++ b/Userland/Libraries/LibGUI/Menu.cpp @@ -9,9 +9,9 @@ #include #include #include +#include #include #include -#include #include namespace GUI { @@ -67,7 +67,7 @@ void Menu::add_action(NonnullRefPtr action) void Menu::remove_all_actions() { for (auto& item : m_items) { - WindowServerConnection::the().async_remove_menu_item(m_menu_id, item.identifier()); + ConnectionToWindowServer::the().async_remove_menu_item(m_menu_id, item.identifier()); } m_items.clear(); } @@ -119,14 +119,14 @@ void Menu::realize_if_needed(const RefPtr& default_action) void Menu::popup(const Gfx::IntPoint& screen_position, const RefPtr& default_action) { realize_if_needed(default_action); - WindowServerConnection::the().async_popup_menu(m_menu_id, screen_position); + ConnectionToWindowServer::the().async_popup_menu(m_menu_id, screen_position); } void Menu::dismiss() { if (m_menu_id == -1) return; - WindowServerConnection::the().async_dismiss_menu(m_menu_id); + ConnectionToWindowServer::the().async_dismiss_menu(m_menu_id); } int Menu::realize_menu(RefPtr default_action) @@ -134,7 +134,7 @@ int Menu::realize_menu(RefPtr default_action) unrealize_menu(); m_menu_id = s_menu_id_allocator.allocate(); - WindowServerConnection::the().async_create_menu(m_menu_id, m_name); + ConnectionToWindowServer::the().async_create_menu(m_menu_id, m_name); dbgln_if(MENU_DEBUG, "GUI::Menu::realize_menu(): New menu ID: {}", m_menu_id); VERIFY(m_menu_id > 0); @@ -153,7 +153,7 @@ void Menu::unrealize_menu() if (m_menu_id == -1) return; all_menus().remove(m_menu_id); - WindowServerConnection::the().async_destroy_menu(m_menu_id); + ConnectionToWindowServer::the().async_destroy_menu(m_menu_id); m_menu_id = -1; } @@ -178,7 +178,7 @@ void Menu::set_children_actions_enabled(bool enabled) } } -void Menu::visibility_did_change(Badge, bool visible) +void Menu::visibility_did_change(Badge, bool visible) { if (m_visible == visible) return; @@ -193,7 +193,7 @@ void Menu::realize_menu_item(MenuItem& item, int item_id) item.set_identifier({}, item_id); switch (item.type()) { case MenuItem::Type::Separator: - WindowServerConnection::the().async_add_menu_separator(m_menu_id); + ConnectionToWindowServer::the().async_add_menu_separator(m_menu_id); break; case MenuItem::Type::Action: { auto& action = *item.action(); @@ -201,14 +201,14 @@ void Menu::realize_menu_item(MenuItem& item, int item_id) bool exclusive = action.group() && action.group()->is_exclusive() && action.is_checkable(); bool is_default = (m_current_default_action.ptr() == &action); auto icon = action.icon() ? action.icon()->to_shareable_bitmap() : Gfx::ShareableBitmap(); - WindowServerConnection::the().async_add_menu_item(m_menu_id, item_id, -1, action.text(), action.is_enabled(), action.is_checkable(), action.is_checkable() ? action.is_checked() : false, is_default, shortcut_text, icon, exclusive); + ConnectionToWindowServer::the().async_add_menu_item(m_menu_id, item_id, -1, action.text(), action.is_enabled(), action.is_checkable(), action.is_checkable() ? action.is_checked() : false, is_default, shortcut_text, icon, exclusive); break; } case MenuItem::Type::Submenu: { auto& submenu = *item.submenu(); submenu.realize_if_needed(m_current_default_action.strong_ref()); auto icon = submenu.icon() ? submenu.icon()->to_shareable_bitmap() : Gfx::ShareableBitmap(); - WindowServerConnection::the().async_add_menu_item(m_menu_id, item_id, submenu.menu_id(), submenu.name(), true, false, false, false, "", icon, false); + ConnectionToWindowServer::the().async_add_menu_item(m_menu_id, item_id, submenu.menu_id(), submenu.name(), true, false, false, false, "", icon, false); break; } case MenuItem::Type::Invalid: diff --git a/Userland/Libraries/LibGUI/Menu.h b/Userland/Libraries/LibGUI/Menu.h index 3950ca44482..2d60d51c38b 100644 --- a/Userland/Libraries/LibGUI/Menu.h +++ b/Userland/Libraries/LibGUI/Menu.h @@ -44,7 +44,7 @@ public: void popup(const Gfx::IntPoint& screen_position, const RefPtr& default_action = nullptr); void dismiss(); - void visibility_did_change(Badge, bool visible); + void visibility_did_change(Badge, bool visible); void set_children_actions_enabled(bool enabled); diff --git a/Userland/Libraries/LibGUI/MenuItem.cpp b/Userland/Libraries/LibGUI/MenuItem.cpp index 6658e7ac1b7..ece715f936f 100644 --- a/Userland/Libraries/LibGUI/MenuItem.cpp +++ b/Userland/Libraries/LibGUI/MenuItem.cpp @@ -5,9 +5,9 @@ */ #include +#include #include #include -#include namespace GUI { @@ -74,7 +74,7 @@ void MenuItem::update_window_server() return; auto& action = *m_action; auto shortcut_text = action.shortcut().is_valid() ? action.shortcut().to_string() : String(); - WindowServerConnection::the().async_update_menu_item(m_menu_id, m_identifier, -1, action.text(), action.is_enabled(), action.is_checkable(), action.is_checkable() ? action.is_checked() : false, m_default, shortcut_text); + ConnectionToWindowServer::the().async_update_menu_item(m_menu_id, m_identifier, -1, action.text(), action.is_enabled(), action.is_checkable(), action.is_checkable() ? action.is_checked() : false, m_default, shortcut_text); } void MenuItem::set_menu_id(Badge, unsigned int menu_id) diff --git a/Userland/Libraries/LibGUI/MouseTracker.cpp b/Userland/Libraries/LibGUI/MouseTracker.cpp index dd9926400a9..7b1d162a44e 100644 --- a/Userland/Libraries/LibGUI/MouseTracker.cpp +++ b/Userland/Libraries/LibGUI/MouseTracker.cpp @@ -4,8 +4,8 @@ * SPDX-License-Identifier: BSD-2-Clause */ +#include #include -#include namespace GUI { @@ -14,7 +14,7 @@ MouseTracker::List MouseTracker::s_trackers; MouseTracker::MouseTracker() { if (s_trackers.is_empty()) { - WindowServerConnection::the().async_set_global_mouse_tracking(true); + ConnectionToWindowServer::the().async_set_global_mouse_tracking(true); } s_trackers.append(*this); } @@ -22,11 +22,11 @@ MouseTracker::~MouseTracker() { m_list_node.remove(); if (s_trackers.is_empty()) { - WindowServerConnection::the().async_set_global_mouse_tracking(false); + ConnectionToWindowServer::the().async_set_global_mouse_tracking(false); } } -void MouseTracker::track_mouse_move(Badge, Gfx::IntPoint const& point) +void MouseTracker::track_mouse_move(Badge, Gfx::IntPoint const& point) { for (auto& tracker : s_trackers) { tracker.track_mouse_move(point); diff --git a/Userland/Libraries/LibGUI/MouseTracker.h b/Userland/Libraries/LibGUI/MouseTracker.h index f22e60f1f97..ca26bcd795d 100644 --- a/Userland/Libraries/LibGUI/MouseTracker.h +++ b/Userland/Libraries/LibGUI/MouseTracker.h @@ -19,7 +19,7 @@ public: MouseTracker(); virtual ~MouseTracker(); - static void track_mouse_move(Badge, Gfx::IntPoint const&); + static void track_mouse_move(Badge, Gfx::IntPoint const&); protected: virtual void track_mouse_move(Gfx::IntPoint const&) = 0; diff --git a/Userland/Libraries/LibGUI/Widget.cpp b/Userland/Libraries/LibGUI/Widget.cpp index 6429b96fc53..6f094a6d6c9 100644 --- a/Userland/Libraries/LibGUI/Widget.cpp +++ b/Userland/Libraries/LibGUI/Widget.cpp @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -21,7 +22,6 @@ #include #include #include -#include #include #include #include diff --git a/Userland/Libraries/LibGUI/Window.cpp b/Userland/Libraries/LibGUI/Window.cpp index 54758655fec..36975285970 100644 --- a/Userland/Libraries/LibGUI/Window.cpp +++ b/Userland/Libraries/LibGUI/Window.cpp @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -22,7 +23,6 @@ #include #include #include -#include #include #include #include @@ -110,7 +110,7 @@ void Window::move_to_front() if (!is_visible()) return; - WindowServerConnection::the().async_move_window_to_front(m_window_id); + ConnectionToWindowServer::the().async_move_window_to_front(m_window_id); } void Window::show() @@ -136,7 +136,7 @@ void Window::show() unsetenv("__libgui_launch_origin_rect"); } - WindowServerConnection::the().async_create_window( + ConnectionToWindowServer::the().async_create_window( m_window_id, m_rect_when_windowless, !m_moved_by_client, @@ -165,7 +165,7 @@ void Window::show() m_menubar->for_each_menu([&](Menu& menu) { menu.realize_menu_if_needed(); - WindowServerConnection::the().async_add_menu(m_window_id, menu.menu_id()); + ConnectionToWindowServer::the().async_add_menu(m_window_id, menu.menu_id()); return IterationDecision::Continue; }); @@ -205,7 +205,7 @@ void Window::hide() if (GUI::Application::in_teardown()) return; - auto destroyed_window_ids = WindowServerConnection::the().destroy_window(m_window_id); + auto destroyed_window_ids = ConnectionToWindowServer::the().destroy_window(m_window_id); server_did_destroy(); for (auto child_window_id : destroyed_window_ids) { @@ -232,27 +232,27 @@ void Window::set_title(String title) m_title_when_windowless = move(title); if (!is_visible()) return; - WindowServerConnection::the().async_set_window_title(m_window_id, m_title_when_windowless); + ConnectionToWindowServer::the().async_set_window_title(m_window_id, m_title_when_windowless); } String Window::title() const { if (!is_visible()) return m_title_when_windowless; - return WindowServerConnection::the().get_window_title(m_window_id); + return ConnectionToWindowServer::the().get_window_title(m_window_id); } Gfx::IntRect Window::applet_rect_on_screen() const { VERIFY(m_window_type == WindowType::Applet); - return WindowServerConnection::the().get_applet_rect_on_screen(m_window_id); + return ConnectionToWindowServer::the().get_applet_rect_on_screen(m_window_id); } Gfx::IntRect Window::rect() const { if (!is_visible()) return m_rect_when_windowless; - return WindowServerConnection::the().get_window_rect(m_window_id); + return ConnectionToWindowServer::the().get_window_rect(m_window_id); } void Window::set_rect(const Gfx::IntRect& a_rect) @@ -267,7 +267,7 @@ void Window::set_rect(const Gfx::IntRect& a_rect) m_main_widget->resize(m_rect_when_windowless.size()); return; } - auto window_rect = WindowServerConnection::the().set_window_rect(m_window_id, a_rect); + auto window_rect = ConnectionToWindowServer::the().set_window_rect(m_window_id, a_rect); if (m_back_store && m_back_store->size() != window_rect.size()) m_back_store = nullptr; if (m_front_store && m_front_store->size() != window_rect.size()) @@ -281,7 +281,7 @@ Gfx::IntSize Window::minimum_size() const if (!is_visible()) return m_minimum_size_when_windowless; - return WindowServerConnection::the().get_window_minimum_size(m_window_id); + return ConnectionToWindowServer::the().get_window_minimum_size(m_window_id); } void Window::set_minimum_size(const Gfx::IntSize& size) @@ -290,7 +290,7 @@ void Window::set_minimum_size(const Gfx::IntSize& size) m_minimum_size_when_windowless = size; if (is_visible()) - WindowServerConnection::the().async_set_window_minimum_size(m_window_id, size); + ConnectionToWindowServer::the().async_set_window_minimum_size(m_window_id, size); } void Window::center_on_screen() @@ -444,7 +444,7 @@ void Window::handle_multi_paint_event(MultiPaintEvent& event) set_current_backing_store(*m_back_store, true); if (is_visible()) - WindowServerConnection::the().async_did_finish_painting(m_window_id, rects); + ConnectionToWindowServer::the().async_did_finish_painting(m_window_id, rects); } void Window::handle_key_event(KeyEvent& event) @@ -685,7 +685,7 @@ void Window::force_update() if (!is_visible()) return; auto rect = this->rect(); - WindowServerConnection::the().async_invalidate_rect(m_window_id, { { 0, 0, rect.width(), rect.height() } }, true); + ConnectionToWindowServer::the().async_invalidate_rect(m_window_id, { { 0, 0, rect.width(), rect.height() } }, true); } void Window::update(const Gfx::IntRect& a_rect) @@ -705,7 +705,7 @@ void Window::update(const Gfx::IntRect& a_rect) auto rects = move(m_pending_paint_event_rects); if (rects.is_empty()) return; - WindowServerConnection::the().async_invalidate_rect(m_window_id, rects, false); + ConnectionToWindowServer::the().async_invalidate_rect(m_window_id, rects, false); }); } m_pending_paint_event_rects.append(a_rect); @@ -791,7 +791,7 @@ void Window::set_has_alpha_channel(bool value) m_back_store = nullptr; m_front_store = nullptr; - WindowServerConnection::the().async_set_window_has_alpha_channel(m_window_id, value); + ConnectionToWindowServer::the().async_set_window_has_alpha_channel(m_window_id, value); update(); } @@ -806,7 +806,7 @@ void Window::set_opacity(float opacity) m_opacity_when_windowless = opacity; if (!is_visible()) return; - WindowServerConnection::the().async_set_window_opacity(m_window_id, opacity); + ConnectionToWindowServer::the().async_set_window_opacity(m_window_id, opacity); } void Window::set_alpha_hit_threshold(float threshold) @@ -820,7 +820,7 @@ void Window::set_alpha_hit_threshold(float threshold) m_alpha_hit_threshold = threshold; if (!is_visible()) return; - WindowServerConnection::the().async_set_window_alpha_hit_threshold(m_window_id, threshold); + ConnectionToWindowServer::the().async_set_window_alpha_hit_threshold(m_window_id, threshold); } void Window::set_hovered_widget(Widget* widget) @@ -844,7 +844,7 @@ void Window::set_hovered_widget(Widget* widget) void Window::set_current_backing_store(WindowBackingStore& backing_store, bool flush_immediately) { auto& bitmap = backing_store.bitmap(); - WindowServerConnection::the().set_window_backing_store(m_window_id, 32, bitmap.pitch(), bitmap.anonymous_buffer().fd(), backing_store.serial(), bitmap.has_alpha_channel(), bitmap.size(), flush_immediately); + ConnectionToWindowServer::the().set_window_backing_store(m_window_id, 32, bitmap.pitch(), bitmap.anonymous_buffer().fd(), backing_store.serial(), bitmap.has_alpha_channel(), bitmap.size(), flush_immediately); } void Window::flip(const Vector& dirty_rects) @@ -935,12 +935,12 @@ void Window::apply_icon() if (!is_visible()) return; - WindowServerConnection::the().async_set_window_icon_bitmap(m_window_id, m_icon->to_shareable_bitmap()); + ConnectionToWindowServer::the().async_set_window_icon_bitmap(m_window_id, m_icon->to_shareable_bitmap()); } void Window::start_interactive_resize() { - WindowServerConnection::the().async_start_window_resize(m_window_id); + ConnectionToWindowServer::the().async_start_window_resize(m_window_id); } Vector Window::focusable_widgets(FocusSource source) const @@ -993,7 +993,7 @@ void Window::set_fullscreen(bool fullscreen) m_fullscreen = fullscreen; if (!is_visible()) return; - WindowServerConnection::the().async_set_fullscreen(m_window_id, fullscreen); + ConnectionToWindowServer::the().async_set_fullscreen(m_window_id, fullscreen); } void Window::set_frameless(bool frameless) @@ -1003,7 +1003,7 @@ void Window::set_frameless(bool frameless) m_frameless = frameless; if (!is_visible()) return; - WindowServerConnection::the().async_set_frameless(m_window_id, frameless); + ConnectionToWindowServer::the().async_set_frameless(m_window_id, frameless); if (!frameless) apply_icon(); @@ -1016,7 +1016,7 @@ void Window::set_forced_shadow(bool shadow) m_forced_shadow = shadow; if (!is_visible()) return; - WindowServerConnection::the().async_set_forced_shadow(m_window_id, shadow); + ConnectionToWindowServer::the().async_set_forced_shadow(m_window_id, shadow); } bool Window::is_maximized() const @@ -1024,7 +1024,7 @@ bool Window::is_maximized() const if (!is_visible()) return m_maximized_when_windowless; - return WindowServerConnection::the().is_maximized(m_window_id); + return ConnectionToWindowServer::the().is_maximized(m_window_id); } void Window::set_maximized(bool maximized) @@ -1033,7 +1033,7 @@ void Window::set_maximized(bool maximized) if (!is_visible()) return; - WindowServerConnection::the().async_set_maximized(m_window_id, maximized); + ConnectionToWindowServer::the().async_set_maximized(m_window_id, maximized); } void Window::schedule_relayout() @@ -1051,10 +1051,10 @@ void Window::schedule_relayout() void Window::refresh_system_theme() { - WindowServerConnection::the().async_refresh_system_theme(); + ConnectionToWindowServer::the().async_refresh_system_theme(); } -void Window::for_each_window(Badge, Function callback) +void Window::for_each_window(Badge, Function callback) { for (auto& e : *reified_windows) { VERIFY(e.value); @@ -1062,14 +1062,14 @@ void Window::for_each_window(Badge, Function) +void Window::update_all_windows(Badge) { for (auto& e : *reified_windows) { e.value->force_update(); } } -void Window::notify_state_changed(Badge, bool minimized, bool occluded) +void Window::notify_state_changed(Badge, bool minimized, bool occluded) { m_visible_for_timer_purposes = !minimized && !occluded; @@ -1116,7 +1116,7 @@ void Window::set_base_size(const Gfx::IntSize& base_size) return; m_base_size = base_size; if (is_visible()) - WindowServerConnection::the().async_set_window_base_size_and_size_increment(m_window_id, m_base_size, m_size_increment); + ConnectionToWindowServer::the().async_set_window_base_size_and_size_increment(m_window_id, m_base_size, m_size_increment); } void Window::set_size_increment(const Gfx::IntSize& size_increment) @@ -1125,7 +1125,7 @@ void Window::set_size_increment(const Gfx::IntSize& size_increment) return; m_size_increment = size_increment; if (is_visible()) - WindowServerConnection::the().async_set_window_base_size_and_size_increment(m_window_id, m_base_size, m_size_increment); + ConnectionToWindowServer::the().async_set_window_base_size_and_size_increment(m_window_id, m_base_size, m_size_increment); } void Window::set_resize_aspect_ratio(const Optional& ratio) @@ -1135,7 +1135,7 @@ void Window::set_resize_aspect_ratio(const Optional& ratio) m_resize_aspect_ratio = ratio; if (is_visible()) - WindowServerConnection::the().async_set_window_resize_aspect_ratio(m_window_id, m_resize_aspect_ratio); + ConnectionToWindowServer::the().async_set_window_resize_aspect_ratio(m_window_id, m_resize_aspect_ratio); } void Window::did_add_widget(Badge, Widget&) @@ -1157,7 +1157,7 @@ void Window::did_remove_widget(Badge, Widget& widget) void Window::set_progress(Optional progress) { VERIFY(m_window_id); - WindowServerConnection::the().async_set_window_progress(m_window_id, progress); + ConnectionToWindowServer::the().async_set_window_progress(m_window_id, progress); } void Window::update_cursor() @@ -1175,9 +1175,9 @@ void Window::update_cursor() m_effective_cursor = new_cursor; if (new_cursor.has>()) - WindowServerConnection::the().async_set_window_custom_cursor(m_window_id, new_cursor.get>()->to_shareable_bitmap()); + ConnectionToWindowServer::the().async_set_window_custom_cursor(m_window_id, new_cursor.get>()->to_shareable_bitmap()); else - WindowServerConnection::the().async_set_window_cursor(m_window_id, (u32)new_cursor.get()); + ConnectionToWindowServer::the().async_set_window_cursor(m_window_id, (u32)new_cursor.get()); } void Window::focus_a_widget_if_possible(FocusSource source) @@ -1208,7 +1208,7 @@ ErrorOr> Window::try_add_menu(String name) auto menu = TRY(m_menubar->try_add_menu({}, move(name))); if (m_window_id) { menu->realize_menu_if_needed(); - WindowServerConnection::the().async_add_menu(m_window_id, menu->menu_id()); + ConnectionToWindowServer::the().async_add_menu(m_window_id, menu->menu_id()); } return menu; } @@ -1225,21 +1225,21 @@ void Window::flash_menubar_menu_for(const MenuItem& menu_item) if (menu_id < 0) return; - WindowServerConnection::the().async_flash_menubar_menu(m_window_id, menu_id); + ConnectionToWindowServer::the().async_flash_menubar_menu(m_window_id, menu_id); } bool Window::is_modified() const { if (!m_window_id) return false; - return WindowServerConnection::the().is_window_modified(m_window_id); + return ConnectionToWindowServer::the().is_window_modified(m_window_id); } void Window::set_modified(bool modified) { if (!m_window_id) return; - WindowServerConnection::the().async_set_window_modified(m_window_id, modified); + ConnectionToWindowServer::the().async_set_window_modified(m_window_id, modified); } void Window::flush_pending_paints_immediately() diff --git a/Userland/Libraries/LibGUI/Window.h b/Userland/Libraries/LibGUI/Window.h index 696706616e5..102d834eb78 100644 --- a/Userland/Libraries/LibGUI/Window.h +++ b/Userland/Libraries/LibGUI/Window.h @@ -190,9 +190,9 @@ public: void refresh_system_theme(); - static void for_each_window(Badge, Function); - static void update_all_windows(Badge); - void notify_state_changed(Badge, bool minimized, bool occluded); + static void for_each_window(Badge, Function); + static void update_all_windows(Badge); + void notify_state_changed(Badge, bool minimized, bool occluded); virtual bool is_visible_for_timer_purposes() const override { return m_visible_for_timer_purposes; } diff --git a/Userland/Services/FileSystemAccessServer/ConnectionFromClient.cpp b/Userland/Services/FileSystemAccessServer/ConnectionFromClient.cpp index 48bbb2a548c..d3852791786 100644 --- a/Userland/Services/FileSystemAccessServer/ConnectionFromClient.cpp +++ b/Userland/Services/FileSystemAccessServer/ConnectionFromClient.cpp @@ -6,7 +6,7 @@ // FIXME: LibIPC Decoder and Encoder are sensitive to include order here // clang-format off -#include +#include // clang-format on #include #include @@ -41,10 +41,10 @@ RefPtr ConnectionFromClient::create_dummy_child_window(i32 window_s auto window = GUI::Window::construct(); window->set_opacity(0); window->set_frameless(true); - auto rect = GUI::WindowServerConnection::the().get_window_rect_from_client(window_server_client_id, parent_window_id); + auto rect = GUI::ConnectionToWindowServer::the().get_window_rect_from_client(window_server_client_id, parent_window_id); window->set_rect(rect); window->show(); - GUI::WindowServerConnection::the().async_set_window_parent_from_client(window_server_client_id, parent_window_id, window->window_id()); + GUI::ConnectionToWindowServer::the().async_set_window_parent_from_client(window_server_client_id, parent_window_id, window->window_id()); return window; } @@ -171,7 +171,7 @@ void ConnectionFromClient::prompt_helper(Optional const& user_picked_fil Messages::FileSystemAccessServer::ExposeWindowServerClientIdResponse ConnectionFromClient::expose_window_server_client_id() { - return GUI::WindowServerConnection::the().expose_client_id(); + return GUI::ConnectionToWindowServer::the().expose_client_id(); } } diff --git a/Userland/Services/Taskbar/TaskbarButton.cpp b/Userland/Services/Taskbar/TaskbarButton.cpp index 553b6301c8e..b6cef3e1fbf 100644 --- a/Userland/Services/Taskbar/TaskbarButton.cpp +++ b/Userland/Services/Taskbar/TaskbarButton.cpp @@ -8,8 +8,8 @@ #include "WindowList.h" #include #include +#include #include -#include #include #include #include diff --git a/Userland/Services/Taskbar/TaskbarWindow.cpp b/Userland/Services/Taskbar/TaskbarWindow.cpp index 2e285fa382b..80c8b10603e 100644 --- a/Userland/Services/Taskbar/TaskbarWindow.cpp +++ b/Userland/Services/Taskbar/TaskbarWindow.cpp @@ -14,13 +14,13 @@ #include #include #include +#include #include #include #include #include #include #include -#include #include #include #include @@ -210,7 +210,7 @@ void TaskbarWindow::event(Core::Event& event) Gfx::IntPoint adjusted_point = { adjusted_x, adjusted_y }; if (adjusted_point != mouse_event.position()) { - GUI::WindowServerConnection::the().async_set_global_cursor_position(position() + adjusted_point); + GUI::ConnectionToWindowServer::the().async_set_global_cursor_position(position() + adjusted_point); GUI::MouseEvent adjusted_event = { (GUI::Event::Type)mouse_event.type(), adjusted_point, mouse_event.buttons(), mouse_event.button(), mouse_event.modifiers(), mouse_event.wheel_delta_x(), mouse_event.wheel_delta_y() }; Window::event(adjusted_event); return; diff --git a/Userland/Services/Taskbar/main.cpp b/Userland/Services/Taskbar/main.cpp index b0bd84c7ae8..aa62e6b38f1 100644 --- a/Userland/Services/Taskbar/main.cpp +++ b/Userland/Services/Taskbar/main.cpp @@ -21,8 +21,8 @@ #include #include #include +#include #include -#include #include #include #include @@ -224,7 +224,7 @@ ErrorOr> build_system_menu() quick_sort(g_themes, [](auto& a, auto& b) { return a.name < b.name; }); } - auto current_theme_name = GUI::WindowServerConnection::the().get_system_theme(); + auto current_theme_name = GUI::ConnectionToWindowServer::the().get_system_theme(); { int theme_identifier = 0; @@ -232,7 +232,7 @@ ErrorOr> build_system_menu() auto action = GUI::Action::create_checkable(theme.name, [theme_identifier](auto&) { auto& theme = g_themes[theme_identifier]; dbgln("Theme switched to {} at path {}", theme.name, theme.path); - auto success = GUI::WindowServerConnection::the().set_system_theme(theme.path, theme.name); + auto success = GUI::ConnectionToWindowServer::the().set_system_theme(theme.path, theme.name); VERIFY(success); }); if (theme.name == current_theme_name) diff --git a/Userland/Services/WindowServer/WindowManager.cpp b/Userland/Services/WindowServer/WindowManager.cpp index a9d713fd2b6..c70d9d6ac85 100644 --- a/Userland/Services/WindowServer/WindowManager.cpp +++ b/Userland/Services/WindowServer/WindowManager.cpp @@ -548,7 +548,7 @@ void WindowManager::tell_wms_super_space_key_pressed() void WindowManager::tell_wms_super_digit_key_pressed(u8 digit) { - for_each_window_manager([digit](WMClientConnection& conn) { + for_each_window_manager([digit](WMConnectionFromClient& conn) { if (conn.window_id() < 0) return IterationDecision::Continue; diff --git a/Userland/Utilities/chres.cpp b/Userland/Utilities/chres.cpp index 07ffb47332e..3f27e0b029c 100644 --- a/Userland/Utilities/chres.cpp +++ b/Userland/Utilities/chres.cpp @@ -6,7 +6,7 @@ #include #include -#include +#include #include ErrorOr serenity_main(Main::Arguments arguments) @@ -24,10 +24,10 @@ ErrorOr serenity_main(Main::Arguments arguments) args_parser.add_positional_argument(scale, "Scale Factor", "scale", Core::ArgsParser::Required::No); args_parser.parse(arguments); - // A Core::EventLoop is all we need, but WindowServerConnection needs a full Application object. + // A Core::EventLoop is all we need, but ConnectionToWindowServer needs a full Application object. char* dummy_argv[] = { arguments.argv[0] }; auto app = GUI::Application::construct(1, dummy_argv); - auto screen_layout = GUI::WindowServerConnection::the().get_screen_layout(); + auto screen_layout = GUI::ConnectionToWindowServer::the().get_screen_layout(); if (screen < 0 || (size_t)screen >= screen_layout.screens.size()) { warnln("invalid screen index: {}", screen); return 1; @@ -36,7 +36,7 @@ ErrorOr serenity_main(Main::Arguments arguments) main_screen.resolution = { width, height }; if (scale != -1) main_screen.scale_factor = scale; - auto set_result = GUI::WindowServerConnection::the().set_screen_layout(screen_layout, true); + auto set_result = GUI::ConnectionToWindowServer::the().set_screen_layout(screen_layout, true); if (!set_result.success()) { warnln("failed to set resolution: {}", set_result.error_msg()); return 1; diff --git a/Userland/Utilities/shot.cpp b/Userland/Utilities/shot.cpp index aeff161434a..7c7223c4d28 100644 --- a/Userland/Utilities/shot.cpp +++ b/Userland/Utilities/shot.cpp @@ -14,10 +14,10 @@ #include #include #include +#include #include #include #include -#include #include #include #include @@ -133,7 +133,7 @@ ErrorOr serenity_main(Main::Arguments arguments) if (screen >= 0) screen_index = (u32)screen; dbgln("getting screenshot..."); - auto shared_bitmap = GUI::WindowServerConnection::the().get_screen_bitmap(crop_region, screen_index); + auto shared_bitmap = GUI::ConnectionToWindowServer::the().get_screen_bitmap(crop_region, screen_index); dbgln("got screenshot"); RefPtr bitmap = shared_bitmap.bitmap(); diff --git a/Userland/Utilities/wsctl.cpp b/Userland/Utilities/wsctl.cpp index f0ab607f76f..29c8b7480e9 100644 --- a/Userland/Utilities/wsctl.cpp +++ b/Userland/Utilities/wsctl.cpp @@ -6,7 +6,7 @@ #include #include -#include +#include ErrorOr serenity_main(Main::Arguments arguments) { @@ -18,6 +18,6 @@ ErrorOr serenity_main(Main::Arguments arguments) args_parser.parse(arguments); if (flash_flush != -1) - GUI::WindowServerConnection::the().async_set_flash_flush(flash_flush); + GUI::ConnectionToWindowServer::the().async_set_flash_flush(flash_flush); return 0; }