mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 06:07:34 +00:00
Userland: Rename IPC ClientConnection => ConnectionFromClient
This was done with CLion's automatic rename feature and with: find . -name ClientConnection.h | rename 's/ClientConnection\.h/ConnectionFromClient.h/' find . -name ClientConnection.cpp | rename 's/ClientConnection\.cpp/ConnectionFromClient.cpp/'
This commit is contained in:
parent
efac862570
commit
3a71748e5d
137 changed files with 896 additions and 896 deletions
|
@ -13,7 +13,7 @@ set(SOURCES
|
|||
Animation.cpp
|
||||
AppletManager.cpp
|
||||
Button.cpp
|
||||
ClientConnection.cpp
|
||||
ConnectionFromClient.cpp
|
||||
Compositor.cpp
|
||||
Cursor.cpp
|
||||
EventLoop.cpp
|
||||
|
@ -35,7 +35,7 @@ set(SOURCES
|
|||
WindowClientEndpoint.h
|
||||
WindowManagerServerEndpoint.h
|
||||
WindowManagerClientEndpoint.h
|
||||
WMClientConnection.cpp
|
||||
WMConnectionFromClient.cpp
|
||||
KeymapSwitcher.cpp
|
||||
)
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
#include "Compositor.h"
|
||||
#include "Animation.h"
|
||||
#include "ClientConnection.h"
|
||||
#include "ConnectionFromClient.h"
|
||||
#include "Event.h"
|
||||
#include "EventLoop.h"
|
||||
#include "MultiScaleBitmaps.h"
|
||||
|
@ -66,19 +66,19 @@ Compositor::Compositor()
|
|||
init_bitmaps();
|
||||
}
|
||||
|
||||
const Gfx::Bitmap* Compositor::cursor_bitmap_for_screenshot(Badge<ClientConnection>, Screen& screen) const
|
||||
const Gfx::Bitmap* Compositor::cursor_bitmap_for_screenshot(Badge<ConnectionFromClient>, Screen& screen) const
|
||||
{
|
||||
if (!m_current_cursor)
|
||||
return nullptr;
|
||||
return &m_current_cursor->bitmap(screen.scale_factor());
|
||||
}
|
||||
|
||||
const Gfx::Bitmap& Compositor::front_bitmap_for_screenshot(Badge<ClientConnection>, Screen& screen) const
|
||||
const Gfx::Bitmap& Compositor::front_bitmap_for_screenshot(Badge<ConnectionFromClient>, Screen& screen) const
|
||||
{
|
||||
return *screen.compositor_screen_data().m_front_bitmap;
|
||||
}
|
||||
|
||||
Gfx::Color Compositor::color_at_position(Badge<ClientConnection>, Screen& screen, Gfx::IntPoint const& position) const
|
||||
Gfx::Color Compositor::color_at_position(Badge<ConnectionFromClient>, Screen& screen, Gfx::IntPoint const& position) const
|
||||
{
|
||||
return screen.compositor_screen_data().m_front_bitmap->get_pixel(position);
|
||||
}
|
||||
|
@ -977,19 +977,19 @@ void Compositor::update_fonts()
|
|||
|
||||
void Compositor::notify_display_links()
|
||||
{
|
||||
ClientConnection::for_each_client([](auto& client) {
|
||||
ConnectionFromClient::for_each_client([](auto& client) {
|
||||
client.notify_display_link({});
|
||||
});
|
||||
}
|
||||
|
||||
void Compositor::increment_display_link_count(Badge<ClientConnection>)
|
||||
void Compositor::increment_display_link_count(Badge<ConnectionFromClient>)
|
||||
{
|
||||
++m_display_link_count;
|
||||
if (m_display_link_count == 1)
|
||||
m_display_link_notify_timer->start();
|
||||
}
|
||||
|
||||
void Compositor::decrement_display_link_count(Badge<ClientConnection>)
|
||||
void Compositor::decrement_display_link_count(Badge<ConnectionFromClient>)
|
||||
{
|
||||
VERIFY(m_display_link_count);
|
||||
--m_display_link_count;
|
||||
|
@ -1007,7 +1007,7 @@ void Compositor::invalidate_current_screen_number_rects()
|
|||
});
|
||||
}
|
||||
|
||||
void Compositor::increment_show_screen_number(Badge<ClientConnection>)
|
||||
void Compositor::increment_show_screen_number(Badge<ConnectionFromClient>)
|
||||
{
|
||||
if (m_show_screen_number_count++ == 0) {
|
||||
Screen::for_each([&](auto& screen) {
|
||||
|
@ -1019,7 +1019,7 @@ void Compositor::increment_show_screen_number(Badge<ClientConnection>)
|
|||
});
|
||||
}
|
||||
}
|
||||
void Compositor::decrement_show_screen_number(Badge<ClientConnection>)
|
||||
void Compositor::decrement_show_screen_number(Badge<ConnectionFromClient>)
|
||||
{
|
||||
if (--m_show_screen_number_count == 0) {
|
||||
invalidate_current_screen_number_rects();
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
namespace WindowServer {
|
||||
|
||||
class Animation;
|
||||
class ClientConnection;
|
||||
class ConnectionFromClient;
|
||||
class Compositor;
|
||||
class Cursor;
|
||||
class MultiScaleBitmaps;
|
||||
|
@ -113,11 +113,11 @@ public:
|
|||
const Cursor* current_cursor() const { return m_current_cursor; }
|
||||
void current_cursor_was_reloaded(const Cursor* new_cursor) { m_current_cursor = new_cursor; }
|
||||
|
||||
void increment_display_link_count(Badge<ClientConnection>);
|
||||
void decrement_display_link_count(Badge<ClientConnection>);
|
||||
void increment_display_link_count(Badge<ConnectionFromClient>);
|
||||
void decrement_display_link_count(Badge<ConnectionFromClient>);
|
||||
|
||||
void increment_show_screen_number(Badge<ClientConnection>);
|
||||
void decrement_show_screen_number(Badge<ClientConnection>);
|
||||
void increment_show_screen_number(Badge<ConnectionFromClient>);
|
||||
void decrement_show_screen_number(Badge<ConnectionFromClient>);
|
||||
bool showing_screen_numbers() const { return m_show_screen_number_count > 0; }
|
||||
|
||||
void invalidate_after_theme_or_font_change()
|
||||
|
@ -174,9 +174,9 @@ public:
|
|||
|
||||
void did_construct_window_manager(Badge<WindowManager>);
|
||||
|
||||
const Gfx::Bitmap* cursor_bitmap_for_screenshot(Badge<ClientConnection>, Screen&) const;
|
||||
const Gfx::Bitmap& front_bitmap_for_screenshot(Badge<ClientConnection>, Screen&) const;
|
||||
Gfx::Color color_at_position(Badge<ClientConnection>, Screen&, Gfx::IntPoint const&) const;
|
||||
const Gfx::Bitmap* cursor_bitmap_for_screenshot(Badge<ConnectionFromClient>, Screen&) const;
|
||||
const Gfx::Bitmap& front_bitmap_for_screenshot(Badge<ConnectionFromClient>, Screen&) const;
|
||||
Gfx::Color color_at_position(Badge<ConnectionFromClient>, Screen&, Gfx::IntPoint const&) const;
|
||||
|
||||
void register_animation(Badge<Animation>, Animation&);
|
||||
void unregister_animation(Badge<Animation>, Animation&);
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
#include <LibGfx/StandardCursor.h>
|
||||
#include <LibGfx/SystemTheme.h>
|
||||
#include <WindowServer/AppletManager.h>
|
||||
#include <WindowServer/ClientConnection.h>
|
||||
#include <WindowServer/Compositor.h>
|
||||
#include <WindowServer/ConnectionFromClient.h>
|
||||
#include <WindowServer/Menu.h>
|
||||
#include <WindowServer/MenuItem.h>
|
||||
#include <WindowServer/Screen.h>
|
||||
|
@ -24,9 +24,9 @@
|
|||
|
||||
namespace WindowServer {
|
||||
|
||||
HashMap<int, NonnullRefPtr<ClientConnection>>* s_connections;
|
||||
HashMap<int, NonnullRefPtr<ConnectionFromClient>>* s_connections;
|
||||
|
||||
void ClientConnection::for_each_client(Function<void(ClientConnection&)> callback)
|
||||
void ConnectionFromClient::for_each_client(Function<void(ConnectionFromClient&)> callback)
|
||||
{
|
||||
if (!s_connections)
|
||||
return;
|
||||
|
@ -35,7 +35,7 @@ void ClientConnection::for_each_client(Function<void(ClientConnection&)> callbac
|
|||
}
|
||||
}
|
||||
|
||||
ClientConnection* ClientConnection::from_client_id(int client_id)
|
||||
ConnectionFromClient* ConnectionFromClient::from_client_id(int client_id)
|
||||
{
|
||||
if (!s_connections)
|
||||
return nullptr;
|
||||
|
@ -45,18 +45,18 @@ ClientConnection* ClientConnection::from_client_id(int client_id)
|
|||
return (*it).value.ptr();
|
||||
}
|
||||
|
||||
ClientConnection::ClientConnection(NonnullOwnPtr<Core::Stream::LocalSocket> client_socket, int client_id)
|
||||
: IPC::ClientConnection<WindowClientEndpoint, WindowServerEndpoint>(*this, move(client_socket), client_id)
|
||||
ConnectionFromClient::ConnectionFromClient(NonnullOwnPtr<Core::Stream::LocalSocket> client_socket, int client_id)
|
||||
: IPC::ConnectionFromClient<WindowClientEndpoint, WindowServerEndpoint>(*this, move(client_socket), client_id)
|
||||
{
|
||||
if (!s_connections)
|
||||
s_connections = new HashMap<int, NonnullRefPtr<ClientConnection>>;
|
||||
s_connections = new HashMap<int, NonnullRefPtr<ConnectionFromClient>>;
|
||||
s_connections->set(client_id, *this);
|
||||
|
||||
auto& wm = WindowManager::the();
|
||||
async_fast_greet(Screen::rects(), Screen::main().index(), wm.window_stack_rows(), wm.window_stack_columns(), Gfx::current_system_theme_buffer(), Gfx::FontDatabase::default_font_query(), Gfx::FontDatabase::fixed_width_font_query(), client_id);
|
||||
}
|
||||
|
||||
ClientConnection::~ClientConnection()
|
||||
ConnectionFromClient::~ConnectionFromClient()
|
||||
{
|
||||
auto& wm = WindowManager::the();
|
||||
if (wm.dnd_client() == this)
|
||||
|
@ -77,26 +77,26 @@ ClientConnection::~ClientConnection()
|
|||
Compositor::the().decrement_show_screen_number({});
|
||||
}
|
||||
|
||||
void ClientConnection::die()
|
||||
void ConnectionFromClient::die()
|
||||
{
|
||||
deferred_invoke([this] {
|
||||
s_connections->remove(client_id());
|
||||
});
|
||||
}
|
||||
|
||||
void ClientConnection::notify_about_new_screen_rects()
|
||||
void ConnectionFromClient::notify_about_new_screen_rects()
|
||||
{
|
||||
auto& wm = WindowManager::the();
|
||||
async_screen_rects_changed(Screen::rects(), Screen::main().index(), wm.window_stack_rows(), wm.window_stack_columns());
|
||||
}
|
||||
|
||||
void ClientConnection::create_menu(i32 menu_id, String const& menu_title)
|
||||
void ConnectionFromClient::create_menu(i32 menu_id, String const& menu_title)
|
||||
{
|
||||
auto menu = Menu::construct(this, menu_id, menu_title);
|
||||
m_menus.set(menu_id, move(menu));
|
||||
}
|
||||
|
||||
void ClientConnection::destroy_menu(i32 menu_id)
|
||||
void ConnectionFromClient::destroy_menu(i32 menu_id)
|
||||
{
|
||||
auto it = m_menus.find(menu_id);
|
||||
if (it == m_menus.end()) {
|
||||
|
@ -109,7 +109,7 @@ void ClientConnection::destroy_menu(i32 menu_id)
|
|||
remove_child(menu);
|
||||
}
|
||||
|
||||
void ClientConnection::add_menu(i32 window_id, i32 menu_id)
|
||||
void ConnectionFromClient::add_menu(i32 window_id, i32 menu_id)
|
||||
{
|
||||
auto it = m_windows.find(window_id);
|
||||
auto jt = m_menus.find(menu_id);
|
||||
|
@ -126,7 +126,7 @@ void ClientConnection::add_menu(i32 window_id, i32 menu_id)
|
|||
window.add_menu(menu);
|
||||
}
|
||||
|
||||
void ClientConnection::add_menu_item(i32 menu_id, i32 identifier, i32 submenu_id,
|
||||
void ConnectionFromClient::add_menu_item(i32 menu_id, i32 identifier, i32 submenu_id,
|
||||
String const& text, bool enabled, bool checkable, bool checked, bool is_default,
|
||||
String const& shortcut, Gfx::ShareableBitmap const& icon, bool exclusive)
|
||||
{
|
||||
|
@ -145,7 +145,7 @@ void ClientConnection::add_menu_item(i32 menu_id, i32 identifier, i32 submenu_id
|
|||
menu.add_item(move(menu_item));
|
||||
}
|
||||
|
||||
void ClientConnection::popup_menu(i32 menu_id, Gfx::IntPoint const& screen_position)
|
||||
void ConnectionFromClient::popup_menu(i32 menu_id, Gfx::IntPoint const& screen_position)
|
||||
{
|
||||
auto position = screen_position;
|
||||
auto it = m_menus.find(menu_id);
|
||||
|
@ -157,7 +157,7 @@ void ClientConnection::popup_menu(i32 menu_id, Gfx::IntPoint const& screen_posit
|
|||
menu.popup(position);
|
||||
}
|
||||
|
||||
void ClientConnection::dismiss_menu(i32 menu_id)
|
||||
void ConnectionFromClient::dismiss_menu(i32 menu_id)
|
||||
{
|
||||
auto it = m_menus.find(menu_id);
|
||||
if (it == m_menus.end()) {
|
||||
|
@ -168,7 +168,7 @@ void ClientConnection::dismiss_menu(i32 menu_id)
|
|||
menu.close();
|
||||
}
|
||||
|
||||
void ClientConnection::update_menu_item(i32 menu_id, i32 identifier, [[maybe_unused]] i32 submenu_id,
|
||||
void ConnectionFromClient::update_menu_item(i32 menu_id, i32 identifier, [[maybe_unused]] i32 submenu_id,
|
||||
String const& text, bool enabled, bool checkable, bool checked, bool is_default,
|
||||
String const& shortcut)
|
||||
{
|
||||
|
@ -192,7 +192,7 @@ void ClientConnection::update_menu_item(i32 menu_id, i32 identifier, [[maybe_unu
|
|||
menu_item->set_checked(checked);
|
||||
}
|
||||
|
||||
void ClientConnection::remove_menu_item(i32 menu_id, i32 identifier)
|
||||
void ConnectionFromClient::remove_menu_item(i32 menu_id, i32 identifier)
|
||||
{
|
||||
auto it = m_menus.find(menu_id);
|
||||
if (it == m_menus.end()) {
|
||||
|
@ -204,7 +204,7 @@ void ClientConnection::remove_menu_item(i32 menu_id, i32 identifier)
|
|||
did_misbehave("RemoveMenuItem: Bad menu item identifier");
|
||||
}
|
||||
|
||||
void ClientConnection::flash_menubar_menu(i32 window_id, i32 menu_id)
|
||||
void ConnectionFromClient::flash_menubar_menu(i32 window_id, i32 menu_id)
|
||||
{
|
||||
auto itw = m_windows.find(window_id);
|
||||
if (itw == m_windows.end()) {
|
||||
|
@ -240,7 +240,7 @@ void ClientConnection::flash_menubar_menu(i32 window_id, i32 menu_id)
|
|||
}
|
||||
}
|
||||
|
||||
void ClientConnection::add_menu_separator(i32 menu_id)
|
||||
void ConnectionFromClient::add_menu_separator(i32 menu_id)
|
||||
{
|
||||
auto it = m_menus.find(menu_id);
|
||||
if (it == m_menus.end()) {
|
||||
|
@ -251,7 +251,7 @@ void ClientConnection::add_menu_separator(i32 menu_id)
|
|||
menu.add_item(make<MenuItem>(menu, MenuItem::Separator));
|
||||
}
|
||||
|
||||
void ClientConnection::move_window_to_front(i32 window_id)
|
||||
void ConnectionFromClient::move_window_to_front(i32 window_id)
|
||||
{
|
||||
auto it = m_windows.find(window_id);
|
||||
if (it == m_windows.end()) {
|
||||
|
@ -261,7 +261,7 @@ void ClientConnection::move_window_to_front(i32 window_id)
|
|||
WindowManager::the().move_to_front_and_make_active(*(*it).value);
|
||||
}
|
||||
|
||||
void ClientConnection::set_fullscreen(i32 window_id, bool fullscreen)
|
||||
void ConnectionFromClient::set_fullscreen(i32 window_id, bool fullscreen)
|
||||
{
|
||||
auto it = m_windows.find(window_id);
|
||||
if (it == m_windows.end()) {
|
||||
|
@ -271,7 +271,7 @@ void ClientConnection::set_fullscreen(i32 window_id, bool fullscreen)
|
|||
it->value->set_fullscreen(fullscreen);
|
||||
}
|
||||
|
||||
void ClientConnection::set_frameless(i32 window_id, bool frameless)
|
||||
void ConnectionFromClient::set_frameless(i32 window_id, bool frameless)
|
||||
{
|
||||
auto it = m_windows.find(window_id);
|
||||
if (it == m_windows.end()) {
|
||||
|
@ -282,7 +282,7 @@ void ClientConnection::set_frameless(i32 window_id, bool frameless)
|
|||
WindowManager::the().tell_wms_window_state_changed(*it->value);
|
||||
}
|
||||
|
||||
void ClientConnection::set_forced_shadow(i32 window_id, bool shadow)
|
||||
void ConnectionFromClient::set_forced_shadow(i32 window_id, bool shadow)
|
||||
{
|
||||
auto it = m_windows.find(window_id);
|
||||
if (it == m_windows.end()) {
|
||||
|
@ -294,7 +294,7 @@ void ClientConnection::set_forced_shadow(i32 window_id, bool shadow)
|
|||
Compositor::the().invalidate_occlusions();
|
||||
}
|
||||
|
||||
void ClientConnection::set_window_opacity(i32 window_id, float opacity)
|
||||
void ConnectionFromClient::set_window_opacity(i32 window_id, float opacity)
|
||||
{
|
||||
auto it = m_windows.find(window_id);
|
||||
if (it == m_windows.end()) {
|
||||
|
@ -304,47 +304,47 @@ void ClientConnection::set_window_opacity(i32 window_id, float opacity)
|
|||
it->value->set_opacity(opacity);
|
||||
}
|
||||
|
||||
void ClientConnection::set_wallpaper(Gfx::ShareableBitmap const& bitmap)
|
||||
void ConnectionFromClient::set_wallpaper(Gfx::ShareableBitmap const& bitmap)
|
||||
{
|
||||
Compositor::the().set_wallpaper(bitmap.bitmap());
|
||||
async_set_wallpaper_finished(true);
|
||||
}
|
||||
|
||||
void ClientConnection::set_background_color(String const& background_color)
|
||||
void ConnectionFromClient::set_background_color(String const& background_color)
|
||||
{
|
||||
Compositor::the().set_background_color(background_color);
|
||||
}
|
||||
|
||||
void ClientConnection::set_wallpaper_mode(String const& mode)
|
||||
void ConnectionFromClient::set_wallpaper_mode(String const& mode)
|
||||
{
|
||||
Compositor::the().set_wallpaper_mode(mode);
|
||||
}
|
||||
|
||||
Messages::WindowServer::GetWallpaperResponse ClientConnection::get_wallpaper()
|
||||
Messages::WindowServer::GetWallpaperResponse ConnectionFromClient::get_wallpaper()
|
||||
{
|
||||
return Compositor::the().wallpaper_bitmap()->to_shareable_bitmap();
|
||||
}
|
||||
|
||||
Messages::WindowServer::SetScreenLayoutResponse ClientConnection::set_screen_layout(ScreenLayout const& screen_layout, bool save)
|
||||
Messages::WindowServer::SetScreenLayoutResponse ConnectionFromClient::set_screen_layout(ScreenLayout const& screen_layout, bool save)
|
||||
{
|
||||
String error_msg;
|
||||
bool success = WindowManager::the().set_screen_layout(ScreenLayout(screen_layout), save, error_msg);
|
||||
return { success, move(error_msg) };
|
||||
}
|
||||
|
||||
Messages::WindowServer::GetScreenLayoutResponse ClientConnection::get_screen_layout()
|
||||
Messages::WindowServer::GetScreenLayoutResponse ConnectionFromClient::get_screen_layout()
|
||||
{
|
||||
return { WindowManager::the().get_screen_layout() };
|
||||
}
|
||||
|
||||
Messages::WindowServer::SaveScreenLayoutResponse ClientConnection::save_screen_layout()
|
||||
Messages::WindowServer::SaveScreenLayoutResponse ConnectionFromClient::save_screen_layout()
|
||||
{
|
||||
String error_msg;
|
||||
bool success = WindowManager::the().save_screen_layout(error_msg);
|
||||
return { success, move(error_msg) };
|
||||
}
|
||||
|
||||
Messages::WindowServer::ApplyWorkspaceSettingsResponse ClientConnection::apply_workspace_settings(u32 rows, u32 columns, bool save)
|
||||
Messages::WindowServer::ApplyWorkspaceSettingsResponse ConnectionFromClient::apply_workspace_settings(u32 rows, u32 columns, bool save)
|
||||
{
|
||||
if (rows == 0 || columns == 0 || rows > WindowManager::max_window_stack_rows || columns > WindowManager::max_window_stack_columns)
|
||||
return { false };
|
||||
|
@ -352,13 +352,13 @@ Messages::WindowServer::ApplyWorkspaceSettingsResponse ClientConnection::apply_w
|
|||
return { WindowManager::the().apply_workspace_settings(rows, columns, save) };
|
||||
}
|
||||
|
||||
Messages::WindowServer::GetWorkspaceSettingsResponse ClientConnection::get_workspace_settings()
|
||||
Messages::WindowServer::GetWorkspaceSettingsResponse ConnectionFromClient::get_workspace_settings()
|
||||
{
|
||||
auto& wm = WindowManager::the();
|
||||
return { (unsigned)wm.window_stack_rows(), (unsigned)wm.window_stack_columns(), WindowManager::max_window_stack_rows, WindowManager::max_window_stack_columns };
|
||||
}
|
||||
|
||||
void ClientConnection::show_screen_numbers(bool show)
|
||||
void ConnectionFromClient::show_screen_numbers(bool show)
|
||||
{
|
||||
if (m_show_screen_number == show)
|
||||
return;
|
||||
|
@ -369,7 +369,7 @@ void ClientConnection::show_screen_numbers(bool show)
|
|||
Compositor::the().decrement_show_screen_number({});
|
||||
}
|
||||
|
||||
void ClientConnection::set_window_title(i32 window_id, String const& title)
|
||||
void ConnectionFromClient::set_window_title(i32 window_id, String const& title)
|
||||
{
|
||||
auto it = m_windows.find(window_id);
|
||||
if (it == m_windows.end()) {
|
||||
|
@ -379,7 +379,7 @@ void ClientConnection::set_window_title(i32 window_id, String const& title)
|
|||
it->value->set_title(title);
|
||||
}
|
||||
|
||||
Messages::WindowServer::GetWindowTitleResponse ClientConnection::get_window_title(i32 window_id)
|
||||
Messages::WindowServer::GetWindowTitleResponse ConnectionFromClient::get_window_title(i32 window_id)
|
||||
{
|
||||
auto it = m_windows.find(window_id);
|
||||
if (it == m_windows.end()) {
|
||||
|
@ -389,7 +389,7 @@ Messages::WindowServer::GetWindowTitleResponse ClientConnection::get_window_titl
|
|||
return it->value->title();
|
||||
}
|
||||
|
||||
Messages::WindowServer::IsMaximizedResponse ClientConnection::is_maximized(i32 window_id)
|
||||
Messages::WindowServer::IsMaximizedResponse ConnectionFromClient::is_maximized(i32 window_id)
|
||||
{
|
||||
auto it = m_windows.find(window_id);
|
||||
if (it == m_windows.end()) {
|
||||
|
@ -399,7 +399,7 @@ Messages::WindowServer::IsMaximizedResponse ClientConnection::is_maximized(i32 w
|
|||
return it->value->is_maximized();
|
||||
}
|
||||
|
||||
void ClientConnection::set_maximized(i32 window_id, bool maximized)
|
||||
void ConnectionFromClient::set_maximized(i32 window_id, bool maximized)
|
||||
{
|
||||
auto it = m_windows.find(window_id);
|
||||
if (it == m_windows.end()) {
|
||||
|
@ -409,7 +409,7 @@ void ClientConnection::set_maximized(i32 window_id, bool maximized)
|
|||
it->value->set_maximized(maximized);
|
||||
}
|
||||
|
||||
void ClientConnection::set_window_icon_bitmap(i32 window_id, Gfx::ShareableBitmap const& icon)
|
||||
void ConnectionFromClient::set_window_icon_bitmap(i32 window_id, Gfx::ShareableBitmap const& icon)
|
||||
{
|
||||
auto it = m_windows.find(window_id);
|
||||
if (it == m_windows.end()) {
|
||||
|
@ -428,7 +428,7 @@ void ClientConnection::set_window_icon_bitmap(i32 window_id, Gfx::ShareableBitma
|
|||
WindowManager::the().tell_wms_window_icon_changed(window);
|
||||
}
|
||||
|
||||
Messages::WindowServer::SetWindowRectResponse ClientConnection::set_window_rect(i32 window_id, Gfx::IntRect const& rect)
|
||||
Messages::WindowServer::SetWindowRectResponse ConnectionFromClient::set_window_rect(i32 window_id, Gfx::IntRect const& rect)
|
||||
{
|
||||
auto it = m_windows.find(window_id);
|
||||
if (it == m_windows.end()) {
|
||||
|
@ -437,7 +437,7 @@ Messages::WindowServer::SetWindowRectResponse ClientConnection::set_window_rect(
|
|||
}
|
||||
auto& window = *(*it).value;
|
||||
if (window.is_fullscreen()) {
|
||||
dbgln("ClientConnection: Ignoring SetWindowRect request for fullscreen window");
|
||||
dbgln("ConnectionFromClient: Ignoring SetWindowRect request for fullscreen window");
|
||||
return nullptr;
|
||||
}
|
||||
if (rect.width() > INT16_MAX || rect.height() > INT16_MAX) {
|
||||
|
@ -456,7 +456,7 @@ Messages::WindowServer::SetWindowRectResponse ClientConnection::set_window_rect(
|
|||
return window.rect();
|
||||
}
|
||||
|
||||
Messages::WindowServer::GetWindowRectResponse ClientConnection::get_window_rect(i32 window_id)
|
||||
Messages::WindowServer::GetWindowRectResponse ConnectionFromClient::get_window_rect(i32 window_id)
|
||||
{
|
||||
auto it = m_windows.find(window_id);
|
||||
if (it == m_windows.end()) {
|
||||
|
@ -466,7 +466,7 @@ Messages::WindowServer::GetWindowRectResponse ClientConnection::get_window_rect(
|
|||
return it->value->rect();
|
||||
}
|
||||
|
||||
void ClientConnection::set_window_minimum_size(i32 window_id, Gfx::IntSize const& size)
|
||||
void ConnectionFromClient::set_window_minimum_size(i32 window_id, Gfx::IntSize const& size)
|
||||
{
|
||||
auto it = m_windows.find(window_id);
|
||||
if (it == m_windows.end()) {
|
||||
|
@ -475,7 +475,7 @@ void ClientConnection::set_window_minimum_size(i32 window_id, Gfx::IntSize const
|
|||
}
|
||||
auto& window = *(*it).value;
|
||||
if (window.is_fullscreen()) {
|
||||
dbgln("ClientConnection: Ignoring SetWindowMinimumSize request for fullscreen window");
|
||||
dbgln("ConnectionFromClient: Ignoring SetWindowMinimumSize request for fullscreen window");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -494,7 +494,7 @@ void ClientConnection::set_window_minimum_size(i32 window_id, Gfx::IntSize const
|
|||
}
|
||||
}
|
||||
|
||||
Messages::WindowServer::GetWindowMinimumSizeResponse ClientConnection::get_window_minimum_size(i32 window_id)
|
||||
Messages::WindowServer::GetWindowMinimumSizeResponse ConnectionFromClient::get_window_minimum_size(i32 window_id)
|
||||
{
|
||||
auto it = m_windows.find(window_id);
|
||||
if (it == m_windows.end()) {
|
||||
|
@ -504,7 +504,7 @@ Messages::WindowServer::GetWindowMinimumSizeResponse ClientConnection::get_windo
|
|||
return it->value->minimum_size();
|
||||
}
|
||||
|
||||
Messages::WindowServer::GetAppletRectOnScreenResponse ClientConnection::get_applet_rect_on_screen(i32 window_id)
|
||||
Messages::WindowServer::GetAppletRectOnScreenResponse ConnectionFromClient::get_applet_rect_on_screen(i32 window_id)
|
||||
{
|
||||
auto it = m_windows.find(window_id);
|
||||
if (it == m_windows.end()) {
|
||||
|
@ -519,7 +519,7 @@ Messages::WindowServer::GetAppletRectOnScreenResponse ClientConnection::get_appl
|
|||
return it->value->rect_in_applet_area().translated(applet_area_rect.location());
|
||||
}
|
||||
|
||||
Window* ClientConnection::window_from_id(i32 window_id)
|
||||
Window* ConnectionFromClient::window_from_id(i32 window_id)
|
||||
{
|
||||
auto it = m_windows.find(window_id);
|
||||
if (it == m_windows.end())
|
||||
|
@ -527,7 +527,7 @@ Window* ClientConnection::window_from_id(i32 window_id)
|
|||
return it->value.ptr();
|
||||
}
|
||||
|
||||
void ClientConnection::create_window(i32 window_id, Gfx::IntRect const& rect,
|
||||
void ConnectionFromClient::create_window(i32 window_id, Gfx::IntRect const& rect,
|
||||
bool auto_position, bool has_alpha_channel, bool modal, bool minimizable, bool closeable, bool resizable,
|
||||
bool fullscreen, bool frameless, bool forced_shadow, bool accessory, float opacity,
|
||||
float alpha_hit_threshold, Gfx::IntSize const& base_size, Gfx::IntSize const& size_increment,
|
||||
|
@ -592,7 +592,7 @@ void ClientConnection::create_window(i32 window_id, Gfx::IntRect const& rect,
|
|||
m_windows.set(window_id, move(window));
|
||||
}
|
||||
|
||||
void ClientConnection::destroy_window(Window& window, Vector<i32>& destroyed_window_ids)
|
||||
void ConnectionFromClient::destroy_window(Window& window, Vector<i32>& destroyed_window_ids)
|
||||
{
|
||||
for (auto& child_window : window.child_windows()) {
|
||||
if (!child_window)
|
||||
|
@ -618,7 +618,7 @@ void ClientConnection::destroy_window(Window& window, Vector<i32>& destroyed_win
|
|||
m_windows.remove(window.window_id());
|
||||
}
|
||||
|
||||
Messages::WindowServer::DestroyWindowResponse ClientConnection::destroy_window(i32 window_id)
|
||||
Messages::WindowServer::DestroyWindowResponse ConnectionFromClient::destroy_window(i32 window_id)
|
||||
{
|
||||
auto it = m_windows.find(window_id);
|
||||
if (it == m_windows.end()) {
|
||||
|
@ -631,7 +631,7 @@ Messages::WindowServer::DestroyWindowResponse ClientConnection::destroy_window(i
|
|||
return destroyed_window_ids;
|
||||
}
|
||||
|
||||
void ClientConnection::post_paint_message(Window& window, bool ignore_occlusion)
|
||||
void ConnectionFromClient::post_paint_message(Window& window, bool ignore_occlusion)
|
||||
{
|
||||
auto rect_set = window.take_pending_paint_rects();
|
||||
if (window.is_minimized() || (!ignore_occlusion && window.is_occluded()))
|
||||
|
@ -640,7 +640,7 @@ void ClientConnection::post_paint_message(Window& window, bool ignore_occlusion)
|
|||
async_paint(window.window_id(), window.size(), rect_set.rects());
|
||||
}
|
||||
|
||||
void ClientConnection::invalidate_rect(i32 window_id, Vector<Gfx::IntRect> const& rects, bool ignore_occlusion)
|
||||
void ConnectionFromClient::invalidate_rect(i32 window_id, Vector<Gfx::IntRect> const& rects, bool ignore_occlusion)
|
||||
{
|
||||
auto it = m_windows.find(window_id);
|
||||
if (it == m_windows.end()) {
|
||||
|
@ -652,7 +652,7 @@ void ClientConnection::invalidate_rect(i32 window_id, Vector<Gfx::IntRect> const
|
|||
window.request_update(rects[i].intersected({ {}, window.size() }), ignore_occlusion);
|
||||
}
|
||||
|
||||
void ClientConnection::did_finish_painting(i32 window_id, Vector<Gfx::IntRect> const& rects)
|
||||
void ConnectionFromClient::did_finish_painting(i32 window_id, Vector<Gfx::IntRect> const& rects)
|
||||
{
|
||||
auto it = m_windows.find(window_id);
|
||||
if (it == m_windows.end()) {
|
||||
|
@ -668,7 +668,7 @@ void ClientConnection::did_finish_painting(i32 window_id, Vector<Gfx::IntRect> c
|
|||
WindowSwitcher::the().refresh_if_needed();
|
||||
}
|
||||
|
||||
void ClientConnection::set_window_backing_store(i32 window_id, [[maybe_unused]] i32 bpp,
|
||||
void ConnectionFromClient::set_window_backing_store(i32 window_id, [[maybe_unused]] i32 bpp,
|
||||
[[maybe_unused]] i32 pitch, IPC::File const& anon_file, i32 serial, bool has_alpha_channel,
|
||||
Gfx::IntSize const& size, bool flush_immediately)
|
||||
{
|
||||
|
@ -703,12 +703,12 @@ void ClientConnection::set_window_backing_store(i32 window_id, [[maybe_unused]]
|
|||
window.invalidate(false);
|
||||
}
|
||||
|
||||
void ClientConnection::set_global_mouse_tracking(bool enabled)
|
||||
void ConnectionFromClient::set_global_mouse_tracking(bool enabled)
|
||||
{
|
||||
m_does_global_mouse_tracking = enabled;
|
||||
}
|
||||
|
||||
void ClientConnection::set_window_cursor(i32 window_id, i32 cursor_type)
|
||||
void ConnectionFromClient::set_window_cursor(i32 window_id, i32 cursor_type)
|
||||
{
|
||||
auto it = m_windows.find(window_id);
|
||||
if (it == m_windows.end()) {
|
||||
|
@ -725,7 +725,7 @@ void ClientConnection::set_window_cursor(i32 window_id, i32 cursor_type)
|
|||
Compositor::the().invalidate_cursor();
|
||||
}
|
||||
|
||||
void ClientConnection::set_window_custom_cursor(i32 window_id, Gfx::ShareableBitmap const& cursor)
|
||||
void ConnectionFromClient::set_window_custom_cursor(i32 window_id, Gfx::ShareableBitmap const& cursor)
|
||||
{
|
||||
auto it = m_windows.find(window_id);
|
||||
if (it == m_windows.end()) {
|
||||
|
@ -743,7 +743,7 @@ void ClientConnection::set_window_custom_cursor(i32 window_id, Gfx::ShareableBit
|
|||
Compositor::the().invalidate_cursor();
|
||||
}
|
||||
|
||||
void ClientConnection::set_window_has_alpha_channel(i32 window_id, bool has_alpha_channel)
|
||||
void ConnectionFromClient::set_window_has_alpha_channel(i32 window_id, bool has_alpha_channel)
|
||||
{
|
||||
auto it = m_windows.find(window_id);
|
||||
if (it == m_windows.end()) {
|
||||
|
@ -753,7 +753,7 @@ void ClientConnection::set_window_has_alpha_channel(i32 window_id, bool has_alph
|
|||
it->value->set_has_alpha_channel(has_alpha_channel);
|
||||
}
|
||||
|
||||
void ClientConnection::set_window_alpha_hit_threshold(i32 window_id, float threshold)
|
||||
void ConnectionFromClient::set_window_alpha_hit_threshold(i32 window_id, float threshold)
|
||||
{
|
||||
auto it = m_windows.find(window_id);
|
||||
if (it == m_windows.end()) {
|
||||
|
@ -763,7 +763,7 @@ void ClientConnection::set_window_alpha_hit_threshold(i32 window_id, float thres
|
|||
it->value->set_alpha_hit_threshold(threshold);
|
||||
}
|
||||
|
||||
void ClientConnection::start_window_resize(i32 window_id)
|
||||
void ConnectionFromClient::start_window_resize(i32 window_id)
|
||||
{
|
||||
auto it = m_windows.find(window_id);
|
||||
if (it == m_windows.end()) {
|
||||
|
@ -780,7 +780,7 @@ void ClientConnection::start_window_resize(i32 window_id)
|
|||
WindowManager::the().start_window_resize(window, ScreenInput::the().cursor_location(), MouseButton::Primary);
|
||||
}
|
||||
|
||||
Messages::WindowServer::StartDragResponse ClientConnection::start_drag(String const& text, HashMap<String, ByteBuffer> const& mime_data, Gfx::ShareableBitmap const& drag_bitmap)
|
||||
Messages::WindowServer::StartDragResponse ConnectionFromClient::start_drag(String const& text, HashMap<String, ByteBuffer> const& mime_data, Gfx::ShareableBitmap const& drag_bitmap)
|
||||
{
|
||||
auto& wm = WindowManager::the();
|
||||
if (wm.dnd_client())
|
||||
|
@ -790,32 +790,32 @@ Messages::WindowServer::StartDragResponse ClientConnection::start_drag(String co
|
|||
return true;
|
||||
}
|
||||
|
||||
Messages::WindowServer::SetSystemThemeResponse ClientConnection::set_system_theme(String const& theme_path, String const& theme_name)
|
||||
Messages::WindowServer::SetSystemThemeResponse ConnectionFromClient::set_system_theme(String const& theme_path, String const& theme_name)
|
||||
{
|
||||
bool success = WindowManager::the().update_theme(theme_path, theme_name);
|
||||
return success;
|
||||
}
|
||||
|
||||
Messages::WindowServer::GetSystemThemeResponse ClientConnection::get_system_theme()
|
||||
Messages::WindowServer::GetSystemThemeResponse ConnectionFromClient::get_system_theme()
|
||||
{
|
||||
auto wm_config = Core::ConfigFile::open("/etc/WindowServer.ini").release_value_but_fixme_should_propagate_errors();
|
||||
auto name = wm_config->read_entry("Theme", "Name");
|
||||
return name;
|
||||
}
|
||||
|
||||
void ClientConnection::apply_cursor_theme(String const& name)
|
||||
void ConnectionFromClient::apply_cursor_theme(String const& name)
|
||||
{
|
||||
WindowManager::the().apply_cursor_theme(name);
|
||||
}
|
||||
|
||||
Messages::WindowServer::GetCursorThemeResponse ClientConnection::get_cursor_theme()
|
||||
Messages::WindowServer::GetCursorThemeResponse ConnectionFromClient::get_cursor_theme()
|
||||
{
|
||||
auto config = Core::ConfigFile::open("/etc/WindowServer.ini").release_value_but_fixme_should_propagate_errors();
|
||||
auto name = config->read_entry("Mouse", "CursorTheme");
|
||||
return name;
|
||||
}
|
||||
|
||||
Messages::WindowServer::SetSystemFontsResponse ClientConnection::set_system_fonts(String const& default_font_query, String const& fixed_width_font_query)
|
||||
Messages::WindowServer::SetSystemFontsResponse ConnectionFromClient::set_system_fonts(String const& default_font_query, String const& fixed_width_font_query)
|
||||
{
|
||||
if (!Gfx::FontDatabase::the().get_by_name(default_font_query)
|
||||
|| !Gfx::FontDatabase::the().get_by_name(fixed_width_font_query)) {
|
||||
|
@ -828,7 +828,7 @@ Messages::WindowServer::SetSystemFontsResponse ClientConnection::set_system_font
|
|||
Gfx::FontDatabase::set_default_font_query(default_font_query);
|
||||
Gfx::FontDatabase::set_fixed_width_font_query(fixed_width_font_query);
|
||||
|
||||
ClientConnection::for_each_client([&](auto& client) {
|
||||
ConnectionFromClient::for_each_client([&](auto& client) {
|
||||
client.async_update_system_fonts(default_font_query, fixed_width_font_query);
|
||||
});
|
||||
|
||||
|
@ -845,7 +845,7 @@ Messages::WindowServer::SetSystemFontsResponse ClientConnection::set_system_font
|
|||
return true;
|
||||
}
|
||||
|
||||
void ClientConnection::set_window_base_size_and_size_increment(i32 window_id, Gfx::IntSize const& base_size, Gfx::IntSize const& size_increment)
|
||||
void ConnectionFromClient::set_window_base_size_and_size_increment(i32 window_id, Gfx::IntSize const& base_size, Gfx::IntSize const& size_increment)
|
||||
{
|
||||
auto it = m_windows.find(window_id);
|
||||
if (it == m_windows.end()) {
|
||||
|
@ -858,7 +858,7 @@ void ClientConnection::set_window_base_size_and_size_increment(i32 window_id, Gf
|
|||
window.set_size_increment(size_increment);
|
||||
}
|
||||
|
||||
void ClientConnection::set_window_resize_aspect_ratio(i32 window_id, Optional<Gfx::IntSize> const& resize_aspect_ratio)
|
||||
void ConnectionFromClient::set_window_resize_aspect_ratio(i32 window_id, Optional<Gfx::IntSize> const& resize_aspect_ratio)
|
||||
{
|
||||
auto it = m_windows.find(window_id);
|
||||
if (it == m_windows.end()) {
|
||||
|
@ -870,7 +870,7 @@ void ClientConnection::set_window_resize_aspect_ratio(i32 window_id, Optional<Gf
|
|||
window.set_resize_aspect_ratio(resize_aspect_ratio);
|
||||
}
|
||||
|
||||
void ClientConnection::enable_display_link()
|
||||
void ConnectionFromClient::enable_display_link()
|
||||
{
|
||||
if (m_has_display_link)
|
||||
return;
|
||||
|
@ -878,7 +878,7 @@ void ClientConnection::enable_display_link()
|
|||
Compositor::the().increment_display_link_count({});
|
||||
}
|
||||
|
||||
void ClientConnection::disable_display_link()
|
||||
void ConnectionFromClient::disable_display_link()
|
||||
{
|
||||
if (!m_has_display_link)
|
||||
return;
|
||||
|
@ -886,7 +886,7 @@ void ClientConnection::disable_display_link()
|
|||
Compositor::the().decrement_display_link_count({});
|
||||
}
|
||||
|
||||
void ClientConnection::notify_display_link(Badge<Compositor>)
|
||||
void ConnectionFromClient::notify_display_link(Badge<Compositor>)
|
||||
{
|
||||
if (!m_has_display_link)
|
||||
return;
|
||||
|
@ -894,7 +894,7 @@ void ClientConnection::notify_display_link(Badge<Compositor>)
|
|||
async_display_link_notification();
|
||||
}
|
||||
|
||||
void ClientConnection::set_window_progress(i32 window_id, Optional<i32> const& progress)
|
||||
void ConnectionFromClient::set_window_progress(i32 window_id, Optional<i32> const& progress)
|
||||
{
|
||||
auto it = m_windows.find(window_id);
|
||||
if (it == m_windows.end()) {
|
||||
|
@ -904,19 +904,19 @@ void ClientConnection::set_window_progress(i32 window_id, Optional<i32> const& p
|
|||
it->value->set_progress(progress);
|
||||
}
|
||||
|
||||
void ClientConnection::refresh_system_theme()
|
||||
void ConnectionFromClient::refresh_system_theme()
|
||||
{
|
||||
// Post the client an UpdateSystemTheme message to refresh its theme.
|
||||
async_update_system_theme(Gfx::current_system_theme_buffer());
|
||||
}
|
||||
|
||||
void ClientConnection::pong()
|
||||
void ConnectionFromClient::pong()
|
||||
{
|
||||
m_ping_timer = nullptr;
|
||||
set_unresponsive(false);
|
||||
}
|
||||
|
||||
void ClientConnection::set_global_cursor_position(Gfx::IntPoint const& position)
|
||||
void ConnectionFromClient::set_global_cursor_position(Gfx::IntPoint const& position)
|
||||
{
|
||||
if (!Screen::main().rect().contains(position)) {
|
||||
did_misbehave("SetGlobalCursorPosition with bad position");
|
||||
|
@ -928,12 +928,12 @@ void ClientConnection::set_global_cursor_position(Gfx::IntPoint const& position)
|
|||
}
|
||||
}
|
||||
|
||||
Messages::WindowServer::GetGlobalCursorPositionResponse ClientConnection::get_global_cursor_position()
|
||||
Messages::WindowServer::GetGlobalCursorPositionResponse ConnectionFromClient::get_global_cursor_position()
|
||||
{
|
||||
return ScreenInput::the().cursor_location();
|
||||
}
|
||||
|
||||
void ClientConnection::set_mouse_acceleration(float factor)
|
||||
void ConnectionFromClient::set_mouse_acceleration(float factor)
|
||||
{
|
||||
double dbl_factor = (double)factor;
|
||||
if (dbl_factor < mouse_accel_min || dbl_factor > mouse_accel_max) {
|
||||
|
@ -943,12 +943,12 @@ void ClientConnection::set_mouse_acceleration(float factor)
|
|||
WindowManager::the().set_acceleration_factor(dbl_factor);
|
||||
}
|
||||
|
||||
Messages::WindowServer::GetMouseAccelerationResponse ClientConnection::get_mouse_acceleration()
|
||||
Messages::WindowServer::GetMouseAccelerationResponse ConnectionFromClient::get_mouse_acceleration()
|
||||
{
|
||||
return ScreenInput::the().acceleration_factor();
|
||||
}
|
||||
|
||||
void ClientConnection::set_scroll_step_size(u32 step_size)
|
||||
void ConnectionFromClient::set_scroll_step_size(u32 step_size)
|
||||
{
|
||||
if (step_size < scroll_step_size_min) {
|
||||
did_misbehave("SetScrollStepSize with bad scroll step size");
|
||||
|
@ -957,12 +957,12 @@ void ClientConnection::set_scroll_step_size(u32 step_size)
|
|||
WindowManager::the().set_scroll_step_size(step_size);
|
||||
}
|
||||
|
||||
Messages::WindowServer::GetScrollStepSizeResponse ClientConnection::get_scroll_step_size()
|
||||
Messages::WindowServer::GetScrollStepSizeResponse ConnectionFromClient::get_scroll_step_size()
|
||||
{
|
||||
return ScreenInput::the().scroll_step_size();
|
||||
}
|
||||
|
||||
void ClientConnection::set_double_click_speed(i32 speed)
|
||||
void ConnectionFromClient::set_double_click_speed(i32 speed)
|
||||
{
|
||||
if (speed < double_click_speed_min || speed > double_click_speed_max) {
|
||||
did_misbehave("SetDoubleClickSpeed with bad speed");
|
||||
|
@ -971,22 +971,22 @@ void ClientConnection::set_double_click_speed(i32 speed)
|
|||
WindowManager::the().set_double_click_speed(speed);
|
||||
}
|
||||
|
||||
Messages::WindowServer::GetDoubleClickSpeedResponse ClientConnection::get_double_click_speed()
|
||||
Messages::WindowServer::GetDoubleClickSpeedResponse ConnectionFromClient::get_double_click_speed()
|
||||
{
|
||||
return WindowManager::the().double_click_speed();
|
||||
}
|
||||
|
||||
void ClientConnection::set_buttons_switched(bool switched)
|
||||
void ConnectionFromClient::set_buttons_switched(bool switched)
|
||||
{
|
||||
WindowManager::the().set_buttons_switched(switched);
|
||||
}
|
||||
|
||||
Messages::WindowServer::GetButtonsSwitchedResponse ClientConnection::get_buttons_switched()
|
||||
Messages::WindowServer::GetButtonsSwitchedResponse ConnectionFromClient::get_buttons_switched()
|
||||
{
|
||||
return WindowManager::the().get_buttons_switched();
|
||||
}
|
||||
|
||||
void ClientConnection::set_unresponsive(bool unresponsive)
|
||||
void ConnectionFromClient::set_unresponsive(bool unresponsive)
|
||||
{
|
||||
if (m_unresponsive == unresponsive)
|
||||
return;
|
||||
|
@ -1003,7 +1003,7 @@ void ClientConnection::set_unresponsive(bool unresponsive)
|
|||
Compositor::the().invalidate_cursor();
|
||||
}
|
||||
|
||||
void ClientConnection::may_have_become_unresponsive()
|
||||
void ConnectionFromClient::may_have_become_unresponsive()
|
||||
{
|
||||
async_ping();
|
||||
m_ping_timer = Core::Timer::create_single_shot(1000, [this] {
|
||||
|
@ -1012,12 +1012,12 @@ void ClientConnection::may_have_become_unresponsive()
|
|||
m_ping_timer->start();
|
||||
}
|
||||
|
||||
void ClientConnection::did_become_responsive()
|
||||
void ConnectionFromClient::did_become_responsive()
|
||||
{
|
||||
set_unresponsive(false);
|
||||
}
|
||||
|
||||
Messages::WindowServer::GetScreenBitmapResponse ClientConnection::get_screen_bitmap(Optional<Gfx::IntRect> const& rect, Optional<u32> const& screen_index)
|
||||
Messages::WindowServer::GetScreenBitmapResponse ConnectionFromClient::get_screen_bitmap(Optional<Gfx::IntRect> const& rect, Optional<u32> const& screen_index)
|
||||
{
|
||||
if (screen_index.has_value()) {
|
||||
auto* screen = Screen::find_by_index(screen_index.value());
|
||||
|
@ -1057,7 +1057,7 @@ Messages::WindowServer::GetScreenBitmapResponse ClientConnection::get_screen_bit
|
|||
return { Gfx::ShareableBitmap() };
|
||||
}
|
||||
|
||||
Messages::WindowServer::GetScreenBitmapAroundCursorResponse ClientConnection::get_screen_bitmap_around_cursor(Gfx::IntSize const& size)
|
||||
Messages::WindowServer::GetScreenBitmapAroundCursorResponse ConnectionFromClient::get_screen_bitmap_around_cursor(Gfx::IntSize const& size)
|
||||
{
|
||||
// TODO: Mixed scale setups at what scale? Lowest? Highest? Configurable?
|
||||
auto cursor_location = ScreenInput::the().cursor_location();
|
||||
|
@ -1126,7 +1126,7 @@ Messages::WindowServer::GetScreenBitmapAroundCursorResponse ClientConnection::ge
|
|||
return { {} };
|
||||
}
|
||||
|
||||
Messages::WindowServer::GetColorUnderCursorResponse ClientConnection::get_color_under_cursor()
|
||||
Messages::WindowServer::GetColorUnderCursorResponse ConnectionFromClient::get_color_under_cursor()
|
||||
{
|
||||
// FIXME: Add a mechanism to get screen bitmap without cursor, so we don't have to do this
|
||||
// manual translation to avoid sampling the color on the actual cursor itself.
|
||||
|
@ -1139,7 +1139,7 @@ Messages::WindowServer::GetColorUnderCursorResponse ClientConnection::get_color_
|
|||
return { Compositor::the().color_at_position({}, screen_with_cursor, cursor_location) };
|
||||
}
|
||||
|
||||
Messages::WindowServer::IsWindowModifiedResponse ClientConnection::is_window_modified(i32 window_id)
|
||||
Messages::WindowServer::IsWindowModifiedResponse ConnectionFromClient::is_window_modified(i32 window_id)
|
||||
{
|
||||
auto it = m_windows.find(window_id);
|
||||
if (it == m_windows.end()) {
|
||||
|
@ -1150,7 +1150,7 @@ Messages::WindowServer::IsWindowModifiedResponse ClientConnection::is_window_mod
|
|||
return window.is_modified();
|
||||
}
|
||||
|
||||
Messages::WindowServer::GetDesktopDisplayScaleResponse ClientConnection::get_desktop_display_scale(u32 screen_index)
|
||||
Messages::WindowServer::GetDesktopDisplayScaleResponse ConnectionFromClient::get_desktop_display_scale(u32 screen_index)
|
||||
{
|
||||
if (auto* screen = Screen::find_by_index(screen_index))
|
||||
return screen->scale_factor();
|
||||
|
@ -1158,7 +1158,7 @@ Messages::WindowServer::GetDesktopDisplayScaleResponse ClientConnection::get_des
|
|||
return 0;
|
||||
}
|
||||
|
||||
void ClientConnection::set_window_modified(i32 window_id, bool modified)
|
||||
void ConnectionFromClient::set_window_modified(i32 window_id, bool modified)
|
||||
{
|
||||
auto it = m_windows.find(window_id);
|
||||
if (it == m_windows.end()) {
|
||||
|
@ -1169,12 +1169,12 @@ void ClientConnection::set_window_modified(i32 window_id, bool modified)
|
|||
window.set_modified(modified);
|
||||
}
|
||||
|
||||
void ClientConnection::set_flash_flush(bool enabled)
|
||||
void ConnectionFromClient::set_flash_flush(bool enabled)
|
||||
{
|
||||
Compositor::the().set_flash_flush(enabled);
|
||||
}
|
||||
|
||||
void ClientConnection::set_window_parent_from_client(i32 client_id, i32 parent_id, i32 child_id)
|
||||
void ConnectionFromClient::set_window_parent_from_client(i32 client_id, i32 parent_id, i32 child_id)
|
||||
{
|
||||
auto child_window = window_from_id(child_id);
|
||||
if (!child_window)
|
||||
|
@ -1195,7 +1195,7 @@ void ClientConnection::set_window_parent_from_client(i32 client_id, i32 parent_i
|
|||
}
|
||||
}
|
||||
|
||||
Messages::WindowServer::GetWindowRectFromClientResponse ClientConnection::get_window_rect_from_client(i32 client_id, i32 window_id)
|
||||
Messages::WindowServer::GetWindowRectFromClientResponse ConnectionFromClient::get_window_rect_from_client(i32 client_id, i32 window_id)
|
||||
{
|
||||
auto client_connection = from_client_id(client_id);
|
||||
if (!client_connection)
|
||||
|
@ -1208,7 +1208,7 @@ Messages::WindowServer::GetWindowRectFromClientResponse ClientConnection::get_wi
|
|||
return window->rect();
|
||||
}
|
||||
|
||||
void ClientConnection::add_window_stealing_for_client(i32 client_id, i32 window_id)
|
||||
void ConnectionFromClient::add_window_stealing_for_client(i32 client_id, i32 window_id)
|
||||
{
|
||||
auto window = window_from_id(window_id);
|
||||
if (!window)
|
||||
|
@ -1220,7 +1220,7 @@ void ClientConnection::add_window_stealing_for_client(i32 client_id, i32 window_
|
|||
window->add_stealing_for_client(client_id);
|
||||
}
|
||||
|
||||
void ClientConnection::remove_window_stealing_for_client(i32 client_id, i32 window_id)
|
||||
void ConnectionFromClient::remove_window_stealing_for_client(i32 client_id, i32 window_id)
|
||||
{
|
||||
auto window = window_from_id(window_id);
|
||||
if (!window)
|
||||
|
@ -1231,7 +1231,7 @@ void ClientConnection::remove_window_stealing_for_client(i32 client_id, i32 wind
|
|||
window->remove_stealing_for_client(client_id);
|
||||
}
|
||||
|
||||
void ClientConnection::remove_window_stealing(i32 window_id)
|
||||
void ConnectionFromClient::remove_window_stealing(i32 window_id)
|
||||
{
|
||||
auto window = window_from_id(window_id);
|
||||
if (!window)
|
|
@ -15,7 +15,7 @@
|
|||
#include <LibCore/Object.h>
|
||||
#include <LibGfx/Bitmap.h>
|
||||
#include <LibGfx/Rect.h>
|
||||
#include <LibIPC/ClientConnection.h>
|
||||
#include <LibIPC/ConnectionFromClient.h>
|
||||
#include <WindowServer/Event.h>
|
||||
#include <WindowServer/Menu.h>
|
||||
#include <WindowServer/ScreenLayout.h>
|
||||
|
@ -29,19 +29,19 @@ class Window;
|
|||
class Menu;
|
||||
class Menubar;
|
||||
class ScreenLayout;
|
||||
class WMClientConnection;
|
||||
class WMConnectionFromClient;
|
||||
|
||||
class ClientConnection final
|
||||
: public IPC::ClientConnection<WindowClientEndpoint, WindowServerEndpoint> {
|
||||
C_OBJECT(ClientConnection)
|
||||
class ConnectionFromClient final
|
||||
: public IPC::ConnectionFromClient<WindowClientEndpoint, WindowServerEndpoint> {
|
||||
C_OBJECT(ConnectionFromClient)
|
||||
public:
|
||||
~ClientConnection() override;
|
||||
~ConnectionFromClient() override;
|
||||
|
||||
bool is_unresponsive() const { return m_unresponsive; }
|
||||
bool does_global_mouse_tracking() const { return m_does_global_mouse_tracking; }
|
||||
|
||||
static ClientConnection* from_client_id(int client_id);
|
||||
static void for_each_client(Function<void(ClientConnection&)>);
|
||||
static ConnectionFromClient* from_client_id(int client_id);
|
||||
static void for_each_client(Function<void(ConnectionFromClient&)>);
|
||||
|
||||
void notify_about_new_screen_rects();
|
||||
void post_paint_message(Window&, bool ignore_occlusion = false);
|
||||
|
@ -81,9 +81,9 @@ public:
|
|||
void notify_display_link(Badge<Compositor>);
|
||||
|
||||
private:
|
||||
explicit ClientConnection(NonnullOwnPtr<Core::Stream::LocalSocket>, int client_id);
|
||||
explicit ConnectionFromClient(NonnullOwnPtr<Core::Stream::LocalSocket>, int client_id);
|
||||
|
||||
// ^ClientConnection
|
||||
// ^ConnectionFromClient
|
||||
virtual void die() override;
|
||||
virtual void may_have_become_unresponsive() override;
|
||||
virtual void did_become_responsive() override;
|
||||
|
@ -189,7 +189,7 @@ private:
|
|||
bool m_does_global_mouse_tracking { false };
|
||||
|
||||
// Need this to get private client connection stuff
|
||||
friend WMClientConnection;
|
||||
friend WMConnectionFromClient;
|
||||
};
|
||||
|
||||
}
|
|
@ -6,11 +6,11 @@
|
|||
|
||||
#include <AK/Debug.h>
|
||||
#include <Kernel/API/MousePacket.h>
|
||||
#include <WindowServer/ClientConnection.h>
|
||||
#include <WindowServer/ConnectionFromClient.h>
|
||||
#include <WindowServer/Cursor.h>
|
||||
#include <WindowServer/EventLoop.h>
|
||||
#include <WindowServer/Screen.h>
|
||||
#include <WindowServer/WMClientConnection.h>
|
||||
#include <WindowServer/WMConnectionFromClient.h>
|
||||
#include <WindowServer/WindowManager.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
|
@ -23,8 +23,8 @@ EventLoop::EventLoop()
|
|||
m_keyboard_fd = open("/dev/keyboard0", O_RDONLY | O_NONBLOCK | O_CLOEXEC);
|
||||
m_mouse_fd = open("/dev/mouse0", O_RDONLY | O_NONBLOCK | O_CLOEXEC);
|
||||
|
||||
m_window_server = MUST(IPC::MultiServer<ClientConnection>::try_create("/tmp/portal/window"));
|
||||
m_wm_server = MUST(IPC::MultiServer<WMClientConnection>::try_create("/tmp/portal/wm"));
|
||||
m_window_server = MUST(IPC::MultiServer<ConnectionFromClient>::try_create("/tmp/portal/window"));
|
||||
m_wm_server = MUST(IPC::MultiServer<WMConnectionFromClient>::try_create("/tmp/portal/wm"));
|
||||
|
||||
if (m_keyboard_fd >= 0) {
|
||||
m_keyboard_notifier = Core::Notifier::construct(m_keyboard_fd, Core::Notifier::Read);
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "ClientConnection.h"
|
||||
#include "WMClientConnection.h"
|
||||
#include "ConnectionFromClient.h"
|
||||
#include "WMConnectionFromClient.h"
|
||||
#include <AK/ByteBuffer.h>
|
||||
#include <LibCore/EventLoop.h>
|
||||
#include <LibCore/Notifier.h>
|
||||
|
@ -15,7 +15,7 @@
|
|||
|
||||
namespace WindowServer {
|
||||
|
||||
class ClientConnection;
|
||||
class ConnectionFromClient;
|
||||
|
||||
class EventLoop {
|
||||
public:
|
||||
|
@ -33,8 +33,8 @@ private:
|
|||
RefPtr<Core::Notifier> m_keyboard_notifier;
|
||||
int m_mouse_fd { -1 };
|
||||
RefPtr<Core::Notifier> m_mouse_notifier;
|
||||
OwnPtr<IPC::MultiServer<ClientConnection>> m_window_server;
|
||||
OwnPtr<IPC::MultiServer<WMClientConnection>> m_wm_server;
|
||||
OwnPtr<IPC::MultiServer<ConnectionFromClient>> m_window_server;
|
||||
OwnPtr<IPC::MultiServer<WMConnectionFromClient>> m_wm_server;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
#include <LibCore/FileWatcher.h>
|
||||
#include <LibCore/Object.h>
|
||||
#include <LibKeyboard/CharacterMap.h>
|
||||
#include <WindowServer/WMClientConnection.h>
|
||||
#include <WindowServer/WMConnectionFromClient.h>
|
||||
|
||||
namespace WindowServer {
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
#include <LibGfx/Painter.h>
|
||||
#include <LibGfx/StylePainter.h>
|
||||
#include <LibGfx/Triangle.h>
|
||||
#include <WindowServer/ClientConnection.h>
|
||||
#include <WindowServer/ConnectionFromClient.h>
|
||||
#include <WindowServer/WindowClientEndpoint.h>
|
||||
|
||||
namespace WindowServer {
|
||||
|
@ -37,7 +37,7 @@ u32 find_ampersand_shortcut_character(StringView string)
|
|||
return 0;
|
||||
}
|
||||
|
||||
Menu::Menu(ClientConnection* client, int menu_id, String name)
|
||||
Menu::Menu(ConnectionFromClient* client, int menu_id, String name)
|
||||
: Core::Object(client)
|
||||
, m_client(client)
|
||||
, m_menu_id(menu_id)
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
namespace WindowServer {
|
||||
|
||||
class ClientConnection;
|
||||
class ConnectionFromClient;
|
||||
class Menubar;
|
||||
class Window;
|
||||
|
||||
|
@ -30,8 +30,8 @@ class Menu final : public Core::Object {
|
|||
public:
|
||||
virtual ~Menu() override;
|
||||
|
||||
ClientConnection* client() { return m_client; }
|
||||
const ClientConnection* client() const { return m_client; }
|
||||
ConnectionFromClient* client() { return m_client; }
|
||||
const ConnectionFromClient* client() const { return m_client; }
|
||||
int menu_id() const { return m_menu_id; }
|
||||
|
||||
bool is_open() const;
|
||||
|
@ -129,7 +129,7 @@ public:
|
|||
const Vector<size_t>* items_with_alt_shortcut(u32 alt_shortcut) const;
|
||||
|
||||
private:
|
||||
Menu(ClientConnection*, int menu_id, String name);
|
||||
Menu(ConnectionFromClient*, int menu_id, String name);
|
||||
|
||||
virtual void event(Core::Event&) override;
|
||||
|
||||
|
@ -144,7 +144,7 @@ private:
|
|||
|
||||
void start_activation_animation(MenuItem&);
|
||||
|
||||
ClientConnection* m_client { nullptr };
|
||||
ConnectionFromClient* m_client { nullptr };
|
||||
int m_menu_id { 0 };
|
||||
String m_name;
|
||||
u32 m_alt_shortcut_character { 0 };
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
*/
|
||||
|
||||
#include "MenuItem.h"
|
||||
#include "ClientConnection.h"
|
||||
#include "ConnectionFromClient.h"
|
||||
#include "Menu.h"
|
||||
#include "WindowManager.h"
|
||||
#include <LibGfx/Bitmap.h>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
#include <AK/Badge.h>
|
||||
#include <WindowServer/ClientConnection.h>
|
||||
#include <WindowServer/ConnectionFromClient.h>
|
||||
#include <WindowServer/MenuManager.h>
|
||||
#include <WindowServer/Screen.h>
|
||||
#include <WindowServer/WindowManager.h>
|
||||
|
@ -41,7 +41,7 @@ bool MenuManager::is_open(const Menu& menu) const
|
|||
|
||||
void MenuManager::refresh()
|
||||
{
|
||||
ClientConnection::for_each_client([&](ClientConnection& client) {
|
||||
ConnectionFromClient::for_each_client([&](ConnectionFromClient& client) {
|
||||
client.for_each_menu([&](Menu& menu) {
|
||||
menu.redraw();
|
||||
return IterationDecision::Continue;
|
||||
|
@ -213,7 +213,7 @@ void MenuManager::handle_mouse_event(MouseEvent& mouse_event)
|
|||
}
|
||||
}
|
||||
|
||||
void MenuManager::close_all_menus_from_client(Badge<ClientConnection>, ClientConnection& client)
|
||||
void MenuManager::close_all_menus_from_client(Badge<ConnectionFromClient>, ConnectionFromClient& client)
|
||||
{
|
||||
if (!has_open_menu())
|
||||
return;
|
||||
|
|
|
@ -34,7 +34,7 @@ public:
|
|||
void close_everyone_not_in_lineage(Menu&);
|
||||
void close_menu_and_descendants(Menu&);
|
||||
|
||||
void close_all_menus_from_client(Badge<ClientConnection>, ClientConnection&);
|
||||
void close_all_menus_from_client(Badge<ConnectionFromClient>, ConnectionFromClient&);
|
||||
|
||||
int theme_index() const { return m_theme_index; }
|
||||
|
||||
|
|
|
@ -5,35 +5,35 @@
|
|||
*/
|
||||
|
||||
#include <WindowServer/AppletManager.h>
|
||||
#include <WindowServer/ClientConnection.h>
|
||||
#include <WindowServer/ConnectionFromClient.h>
|
||||
#include <WindowServer/Screen.h>
|
||||
#include <WindowServer/WMClientConnection.h>
|
||||
#include <WindowServer/WMConnectionFromClient.h>
|
||||
|
||||
namespace WindowServer {
|
||||
|
||||
HashMap<int, NonnullRefPtr<WMClientConnection>> WMClientConnection::s_connections {};
|
||||
HashMap<int, NonnullRefPtr<WMConnectionFromClient>> WMConnectionFromClient::s_connections {};
|
||||
|
||||
WMClientConnection::WMClientConnection(NonnullOwnPtr<Core::Stream::LocalSocket> client_socket, int client_id)
|
||||
: IPC::ClientConnection<WindowManagerClientEndpoint, WindowManagerServerEndpoint>(*this, move(client_socket), client_id)
|
||||
WMConnectionFromClient::WMConnectionFromClient(NonnullOwnPtr<Core::Stream::LocalSocket> client_socket, int client_id)
|
||||
: IPC::ConnectionFromClient<WindowManagerClientEndpoint, WindowManagerServerEndpoint>(*this, move(client_socket), client_id)
|
||||
{
|
||||
s_connections.set(client_id, *this);
|
||||
}
|
||||
|
||||
WMClientConnection::~WMClientConnection()
|
||||
WMConnectionFromClient::~WMConnectionFromClient()
|
||||
{
|
||||
// The WM has gone away, so take away the applet manager (cause there's nowhere
|
||||
// to draw it in).
|
||||
AppletManager::the().set_position({});
|
||||
}
|
||||
|
||||
void WMClientConnection::die()
|
||||
void WMConnectionFromClient::die()
|
||||
{
|
||||
deferred_invoke([this] {
|
||||
s_connections.remove(client_id());
|
||||
});
|
||||
}
|
||||
|
||||
void WMClientConnection::set_applet_area_position(Gfx::IntPoint const& position)
|
||||
void WMConnectionFromClient::set_applet_area_position(Gfx::IntPoint const& position)
|
||||
{
|
||||
if (m_window_id < 0) {
|
||||
did_misbehave("SetAppletAreaPosition: WM didn't assign window as manager yet");
|
||||
|
@ -43,16 +43,16 @@ void WMClientConnection::set_applet_area_position(Gfx::IntPoint const& position)
|
|||
|
||||
AppletManager::the().set_position(position);
|
||||
|
||||
WindowServer::ClientConnection::for_each_client([](auto& connection) {
|
||||
WindowServer::ConnectionFromClient::for_each_client([](auto& connection) {
|
||||
if (auto result = connection.post_message(Messages::WindowClient::AppletAreaRectChanged(AppletManager::the().window()->rect())); result.is_error()) {
|
||||
dbgln("WMClientConnection::set_applet_area_position: {}", result.error());
|
||||
dbgln("WMConnectionFromClient::set_applet_area_position: {}", result.error());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void WMClientConnection::set_active_window(i32 client_id, i32 window_id)
|
||||
void WMConnectionFromClient::set_active_window(i32 client_id, i32 window_id)
|
||||
{
|
||||
auto* client = WindowServer::ClientConnection::from_client_id(client_id);
|
||||
auto* client = WindowServer::ConnectionFromClient::from_client_id(client_id);
|
||||
if (!client) {
|
||||
did_misbehave("SetActiveWindow: Bad client ID");
|
||||
return;
|
||||
|
@ -67,9 +67,9 @@ void WMClientConnection::set_active_window(i32 client_id, i32 window_id)
|
|||
WindowManager::the().move_to_front_and_make_active(window);
|
||||
}
|
||||
|
||||
void WMClientConnection::popup_window_menu(i32 client_id, i32 window_id, Gfx::IntPoint const& screen_position)
|
||||
void WMConnectionFromClient::popup_window_menu(i32 client_id, i32 window_id, Gfx::IntPoint const& screen_position)
|
||||
{
|
||||
auto* client = WindowServer::ClientConnection::from_client_id(client_id);
|
||||
auto* client = WindowServer::ConnectionFromClient::from_client_id(client_id);
|
||||
if (!client) {
|
||||
did_misbehave("PopupWindowMenu: Bad client ID");
|
||||
return;
|
||||
|
@ -87,9 +87,9 @@ void WMClientConnection::popup_window_menu(i32 client_id, i32 window_id, Gfx::In
|
|||
}
|
||||
}
|
||||
|
||||
void WMClientConnection::start_window_resize(i32 client_id, i32 window_id)
|
||||
void WMConnectionFromClient::start_window_resize(i32 client_id, i32 window_id)
|
||||
{
|
||||
auto* client = WindowServer::ClientConnection::from_client_id(client_id);
|
||||
auto* client = WindowServer::ConnectionFromClient::from_client_id(client_id);
|
||||
if (!client) {
|
||||
did_misbehave("WM_StartWindowResize: Bad client ID");
|
||||
return;
|
||||
|
@ -105,9 +105,9 @@ void WMClientConnection::start_window_resize(i32 client_id, i32 window_id)
|
|||
WindowManager::the().start_window_resize(window, ScreenInput::the().cursor_location(), MouseButton::Primary);
|
||||
}
|
||||
|
||||
void WMClientConnection::set_window_minimized(i32 client_id, i32 window_id, bool minimized)
|
||||
void WMConnectionFromClient::set_window_minimized(i32 client_id, i32 window_id, bool minimized)
|
||||
{
|
||||
auto* client = WindowServer::ClientConnection::from_client_id(client_id);
|
||||
auto* client = WindowServer::ConnectionFromClient::from_client_id(client_id);
|
||||
if (!client) {
|
||||
did_misbehave("WM_SetWindowMinimized: Bad client ID");
|
||||
return;
|
||||
|
@ -121,7 +121,7 @@ void WMClientConnection::set_window_minimized(i32 client_id, i32 window_id, bool
|
|||
WindowManager::the().minimize_windows(window, minimized);
|
||||
}
|
||||
|
||||
void WMClientConnection::toggle_show_desktop()
|
||||
void WMConnectionFromClient::toggle_show_desktop()
|
||||
{
|
||||
bool should_hide = false;
|
||||
auto& current_window_stack = WindowManager::the().current_window_stack();
|
||||
|
@ -146,12 +146,12 @@ void WMClientConnection::toggle_show_desktop()
|
|||
});
|
||||
}
|
||||
|
||||
void WMClientConnection::set_event_mask(u32 event_mask)
|
||||
void WMConnectionFromClient::set_event_mask(u32 event_mask)
|
||||
{
|
||||
m_event_mask = event_mask;
|
||||
}
|
||||
|
||||
void WMClientConnection::set_manager_window(i32 window_id)
|
||||
void WMConnectionFromClient::set_manager_window(i32 window_id)
|
||||
{
|
||||
m_window_id = window_id;
|
||||
|
||||
|
@ -160,18 +160,18 @@ void WMClientConnection::set_manager_window(i32 window_id)
|
|||
WindowManager::the().greet_window_manager(*this);
|
||||
}
|
||||
|
||||
void WMClientConnection::set_workspace(u32 row, u32 col)
|
||||
void WMConnectionFromClient::set_workspace(u32 row, u32 col)
|
||||
{
|
||||
WindowManager::the().switch_to_window_stack(row, col);
|
||||
}
|
||||
|
||||
void WMClientConnection::set_window_taskbar_rect(i32 client_id, i32 window_id, Gfx::IntRect const& rect)
|
||||
void WMConnectionFromClient::set_window_taskbar_rect(i32 client_id, i32 window_id, Gfx::IntRect const& rect)
|
||||
{
|
||||
// Because the Taskbar (which should be the only user of this API) does not own the
|
||||
// window or the client id, there is a possibility that it may send this message for
|
||||
// a window or client that may have been destroyed already. This is not an error,
|
||||
// and we should not call did_misbehave() for either.
|
||||
auto* client = WindowServer::ClientConnection::from_client_id(client_id);
|
||||
auto* client = WindowServer::ConnectionFromClient::from_client_id(client_id);
|
||||
if (!client)
|
||||
return;
|
||||
|
|
@ -8,18 +8,18 @@
|
|||
|
||||
#include "AK/NonnullRefPtr.h"
|
||||
#include <AK/HashMap.h>
|
||||
#include <LibIPC/ClientConnection.h>
|
||||
#include <LibIPC/ConnectionFromClient.h>
|
||||
#include <WindowServer/WindowManagerClientEndpoint.h>
|
||||
#include <WindowServer/WindowManagerServerEndpoint.h>
|
||||
|
||||
namespace WindowServer {
|
||||
|
||||
class WMClientConnection final
|
||||
: public IPC::ClientConnection<WindowManagerClientEndpoint, WindowManagerServerEndpoint> {
|
||||
C_OBJECT(WMClientConnection)
|
||||
class WMConnectionFromClient final
|
||||
: public IPC::ConnectionFromClient<WindowManagerClientEndpoint, WindowManagerServerEndpoint> {
|
||||
C_OBJECT(WMConnectionFromClient)
|
||||
|
||||
public:
|
||||
~WMClientConnection() override;
|
||||
~WMConnectionFromClient() override;
|
||||
|
||||
virtual void set_active_window(i32, i32) override;
|
||||
virtual void set_window_minimized(i32, i32, bool) override;
|
||||
|
@ -36,13 +36,13 @@ public:
|
|||
int window_id() const { return m_window_id; }
|
||||
|
||||
private:
|
||||
explicit WMClientConnection(NonnullOwnPtr<Core::Stream::LocalSocket> client_socket, int client_id);
|
||||
explicit WMConnectionFromClient(NonnullOwnPtr<Core::Stream::LocalSocket> client_socket, int client_id);
|
||||
|
||||
// ^ClientConnection
|
||||
// ^ConnectionFromClient
|
||||
virtual void die() override;
|
||||
|
||||
// RefPtr<Core::Timer> m_ping_timer;
|
||||
static HashMap<int, NonnullRefPtr<WMClientConnection>> s_connections;
|
||||
static HashMap<int, NonnullRefPtr<WMConnectionFromClient>> s_connections;
|
||||
unsigned m_event_mask { 0 };
|
||||
int m_window_id { -1 };
|
||||
|
|
@ -7,8 +7,8 @@
|
|||
#include "Window.h"
|
||||
#include "Animation.h"
|
||||
#include "AppletManager.h"
|
||||
#include "ClientConnection.h"
|
||||
#include "Compositor.h"
|
||||
#include "ConnectionFromClient.h"
|
||||
#include "Event.h"
|
||||
#include "EventLoop.h"
|
||||
#include "Screen.h"
|
||||
|
@ -96,7 +96,7 @@ Window::Window(Core::Object& parent, WindowType type)
|
|||
frame().window_was_constructed({});
|
||||
}
|
||||
|
||||
Window::Window(ClientConnection& client, WindowType window_type, int window_id, bool modal, bool minimizable, bool closeable, bool frameless, bool resizable, bool fullscreen, bool accessory, Window* parent_window)
|
||||
Window::Window(ConnectionFromClient& client, WindowType window_type, int window_id, bool modal, bool minimizable, bool closeable, bool frameless, bool resizable, bool fullscreen, bool accessory, Window* parent_window)
|
||||
: Core::Object(&client)
|
||||
, m_client(&client)
|
||||
, m_type(window_type)
|
||||
|
@ -1017,7 +1017,7 @@ void Window::set_tiled(WindowTileType tile_type)
|
|||
Core::EventLoop::current().post_event(*this, make<ResizeEvent>(m_rect));
|
||||
}
|
||||
|
||||
void Window::detach_client(Badge<ClientConnection>)
|
||||
void Window::detach_client(Badge<ConnectionFromClient>)
|
||||
{
|
||||
m_client = nullptr;
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
namespace WindowServer {
|
||||
|
||||
class Animation;
|
||||
class ClientConnection;
|
||||
class ConnectionFromClient;
|
||||
class Cursor;
|
||||
class KeyEvent;
|
||||
class Menu;
|
||||
|
@ -143,8 +143,8 @@ public:
|
|||
|
||||
Window* blocking_modal_window();
|
||||
|
||||
ClientConnection* client() { return m_client; }
|
||||
const ClientConnection* client() const { return m_client; }
|
||||
ConnectionFromClient* client() { return m_client; }
|
||||
const ConnectionFromClient* client() const { return m_client; }
|
||||
|
||||
WindowType type() const { return m_type; }
|
||||
int window_id() const { return m_window_id; }
|
||||
|
@ -296,7 +296,7 @@ public:
|
|||
|
||||
IntrusiveListNode<Window> m_list_node;
|
||||
|
||||
void detach_client(Badge<ClientConnection>);
|
||||
void detach_client(Badge<ConnectionFromClient>);
|
||||
|
||||
Window* parent_window() { return m_parent_window; }
|
||||
const Window* parent_window() const { return m_parent_window; }
|
||||
|
@ -381,7 +381,7 @@ public:
|
|||
bool is_stealable_by_client(i32 client_id) const { return m_stealable_by_client_ids.contains_slow(client_id); }
|
||||
|
||||
private:
|
||||
Window(ClientConnection&, WindowType, int window_id, bool modal, bool minimizable, bool closeable, bool frameless, bool resizable, bool fullscreen, bool accessory, Window* parent_window = nullptr);
|
||||
Window(ConnectionFromClient&, WindowType, int window_id, bool modal, bool minimizable, bool closeable, bool frameless, bool resizable, bool fullscreen, bool accessory, Window* parent_window = nullptr);
|
||||
Window(Core::Object&, WindowType);
|
||||
|
||||
virtual void event(Core::Event&) override;
|
||||
|
@ -393,7 +393,7 @@ private:
|
|||
void update_window_menu_items();
|
||||
void modal_unparented();
|
||||
|
||||
ClientConnection* m_client { nullptr };
|
||||
ConnectionFromClient* m_client { nullptr };
|
||||
|
||||
WeakPtr<Window> m_parent_window;
|
||||
Vector<WeakPtr<Window>> m_child_windows;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include "ClientConnection.h"
|
||||
#include "ConnectionFromClient.h"
|
||||
#include <AK/Badge.h>
|
||||
#include <LibGfx/Font.h>
|
||||
#include <LibGfx/Painter.h>
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
#include <LibGfx/SystemTheme.h>
|
||||
#include <WindowServer/AppletManager.h>
|
||||
#include <WindowServer/Button.h>
|
||||
#include <WindowServer/ClientConnection.h>
|
||||
#include <WindowServer/ConnectionFromClient.h>
|
||||
#include <WindowServer/Cursor.h>
|
||||
#include <WindowServer/WindowClientEndpoint.h>
|
||||
|
||||
|
@ -54,7 +54,7 @@ WindowManager::WindowManager(Gfx::PaletteImpl const& palette)
|
|||
reload_config();
|
||||
|
||||
m_keymap_switcher->on_keymap_change = [&](String const& keymap) {
|
||||
for_each_window_manager([&keymap](WMClientConnection& conn) {
|
||||
for_each_window_manager([&keymap](WMConnectionFromClient& conn) {
|
||||
if (!(conn.event_mask() & WMEventMask::KeymapChanged))
|
||||
return IterationDecision::Continue;
|
||||
if (conn.window_id() < 0)
|
||||
|
@ -409,7 +409,7 @@ void WindowManager::remove_window(Window& window)
|
|||
|
||||
Compositor::the().invalidate_occlusions();
|
||||
|
||||
for_each_window_manager([&](WMClientConnection& conn) {
|
||||
for_each_window_manager([&](WMConnectionFromClient& conn) {
|
||||
if (conn.window_id() < 0 || !(conn.event_mask() & WMEventMask::WindowRemovals))
|
||||
return IterationDecision::Continue;
|
||||
if (!window.is_internal() && !was_modal)
|
||||
|
@ -418,7 +418,7 @@ void WindowManager::remove_window(Window& window)
|
|||
});
|
||||
}
|
||||
|
||||
void WindowManager::greet_window_manager(WMClientConnection& conn)
|
||||
void WindowManager::greet_window_manager(WMConnectionFromClient& conn)
|
||||
{
|
||||
if (conn.window_id() < 0)
|
||||
return;
|
||||
|
@ -437,7 +437,7 @@ void WindowManager::greet_window_manager(WMClientConnection& conn)
|
|||
tell_wms_applet_area_size_changed(applet_area_window->size());
|
||||
}
|
||||
|
||||
void WindowManager::tell_wm_about_window(WMClientConnection& conn, Window& window)
|
||||
void WindowManager::tell_wm_about_window(WMConnectionFromClient& conn, Window& window)
|
||||
{
|
||||
if (conn.window_id() < 0)
|
||||
return;
|
||||
|
@ -450,7 +450,7 @@ void WindowManager::tell_wm_about_window(WMClientConnection& conn, Window& windo
|
|||
conn.async_window_state_changed(conn.window_id(), window.client_id(), window.window_id(), parent ? parent->client_id() : -1, parent ? parent->window_id() : -1, window_stack.row(), window_stack.column(), window.is_active(), window.is_minimized(), window.is_modal_dont_unparent(), window.is_frameless(), (i32)window.type(), window.computed_title(), window.rect(), window.progress());
|
||||
}
|
||||
|
||||
void WindowManager::tell_wm_about_window_rect(WMClientConnection& conn, Window& window)
|
||||
void WindowManager::tell_wm_about_window_rect(WMConnectionFromClient& conn, Window& window)
|
||||
{
|
||||
if (conn.window_id() < 0)
|
||||
return;
|
||||
|
@ -461,7 +461,7 @@ void WindowManager::tell_wm_about_window_rect(WMClientConnection& conn, Window&
|
|||
conn.async_window_rect_changed(conn.window_id(), window.client_id(), window.window_id(), window.rect());
|
||||
}
|
||||
|
||||
void WindowManager::tell_wm_about_window_icon(WMClientConnection& conn, Window& window)
|
||||
void WindowManager::tell_wm_about_window_icon(WMConnectionFromClient& conn, Window& window)
|
||||
{
|
||||
if (conn.window_id() < 0)
|
||||
return;
|
||||
|
@ -472,7 +472,7 @@ void WindowManager::tell_wm_about_window_icon(WMClientConnection& conn, Window&
|
|||
conn.async_window_icon_bitmap_changed(conn.window_id(), window.client_id(), window.window_id(), window.icon().to_shareable_bitmap());
|
||||
}
|
||||
|
||||
void WindowManager::tell_wm_about_current_window_stack(WMClientConnection& conn)
|
||||
void WindowManager::tell_wm_about_current_window_stack(WMConnectionFromClient& conn)
|
||||
{
|
||||
if (conn.window_id() < 0)
|
||||
return;
|
||||
|
@ -484,7 +484,7 @@ void WindowManager::tell_wm_about_current_window_stack(WMClientConnection& conn)
|
|||
|
||||
void WindowManager::tell_wms_window_state_changed(Window& window)
|
||||
{
|
||||
for_each_window_manager([&](WMClientConnection& conn) {
|
||||
for_each_window_manager([&](WMConnectionFromClient& conn) {
|
||||
tell_wm_about_window(conn, window);
|
||||
return IterationDecision::Continue;
|
||||
});
|
||||
|
@ -492,7 +492,7 @@ void WindowManager::tell_wms_window_state_changed(Window& window)
|
|||
|
||||
void WindowManager::tell_wms_window_icon_changed(Window& window)
|
||||
{
|
||||
for_each_window_manager([&](WMClientConnection& conn) {
|
||||
for_each_window_manager([&](WMConnectionFromClient& conn) {
|
||||
tell_wm_about_window_icon(conn, window);
|
||||
return IterationDecision::Continue;
|
||||
});
|
||||
|
@ -500,7 +500,7 @@ void WindowManager::tell_wms_window_icon_changed(Window& window)
|
|||
|
||||
void WindowManager::tell_wms_window_rect_changed(Window& window)
|
||||
{
|
||||
for_each_window_manager([&](WMClientConnection& conn) {
|
||||
for_each_window_manager([&](WMConnectionFromClient& conn) {
|
||||
tell_wm_about_window_rect(conn, window);
|
||||
return IterationDecision::Continue;
|
||||
});
|
||||
|
@ -508,14 +508,14 @@ void WindowManager::tell_wms_window_rect_changed(Window& window)
|
|||
|
||||
void WindowManager::tell_wms_screen_rects_changed()
|
||||
{
|
||||
ClientConnection::for_each_client([&](ClientConnection& client) {
|
||||
ConnectionFromClient::for_each_client([&](ConnectionFromClient& client) {
|
||||
client.notify_about_new_screen_rects();
|
||||
});
|
||||
}
|
||||
|
||||
void WindowManager::tell_wms_applet_area_size_changed(Gfx::IntSize const& size)
|
||||
{
|
||||
for_each_window_manager([&](WMClientConnection& conn) {
|
||||
for_each_window_manager([&](WMConnectionFromClient& conn) {
|
||||
if (conn.window_id() < 0)
|
||||
return IterationDecision::Continue;
|
||||
|
||||
|
@ -526,7 +526,7 @@ void WindowManager::tell_wms_applet_area_size_changed(Gfx::IntSize const& size)
|
|||
|
||||
void WindowManager::tell_wms_super_key_pressed()
|
||||
{
|
||||
for_each_window_manager([](WMClientConnection& conn) {
|
||||
for_each_window_manager([](WMConnectionFromClient& conn) {
|
||||
if (conn.window_id() < 0)
|
||||
return IterationDecision::Continue;
|
||||
|
||||
|
@ -537,7 +537,7 @@ void WindowManager::tell_wms_super_key_pressed()
|
|||
|
||||
void WindowManager::tell_wms_super_space_key_pressed()
|
||||
{
|
||||
for_each_window_manager([](WMClientConnection& conn) {
|
||||
for_each_window_manager([](WMConnectionFromClient& conn) {
|
||||
if (conn.window_id() < 0)
|
||||
return IterationDecision::Continue;
|
||||
|
||||
|
@ -559,7 +559,7 @@ void WindowManager::tell_wms_super_digit_key_pressed(u8 digit)
|
|||
|
||||
void WindowManager::tell_wms_current_window_stack_changed()
|
||||
{
|
||||
for_each_window_manager([&](WMClientConnection& conn) {
|
||||
for_each_window_manager([&](WMConnectionFromClient& conn) {
|
||||
tell_wm_about_current_window_stack(conn);
|
||||
return IterationDecision::Continue;
|
||||
});
|
||||
|
@ -1289,7 +1289,7 @@ void WindowManager::process_mouse_event(MouseEvent& event)
|
|||
return;
|
||||
|
||||
// 2. Send the mouse event to all clients with global cursor tracking enabled.
|
||||
ClientConnection::for_each_client([&](ClientConnection& conn) {
|
||||
ConnectionFromClient::for_each_client([&](ConnectionFromClient& conn) {
|
||||
if (conn.does_global_mouse_tracking()) {
|
||||
conn.async_track_mouse_move(event.position());
|
||||
}
|
||||
|
@ -1917,7 +1917,7 @@ bool WindowManager::set_hovered_window(Window* window)
|
|||
return true;
|
||||
}
|
||||
|
||||
ClientConnection const* WindowManager::active_client() const
|
||||
ConnectionFromClient const* WindowManager::active_client() const
|
||||
{
|
||||
if (auto* window = const_cast<WindowManager*>(this)->current_window_stack().active_window())
|
||||
return window->client();
|
||||
|
@ -2052,7 +2052,7 @@ Gfx::IntRect WindowManager::tiled_window_rect(Window const& window, WindowTileTy
|
|||
return rect;
|
||||
}
|
||||
|
||||
void WindowManager::start_dnd_drag(ClientConnection& client, String const& text, Gfx::Bitmap const* bitmap, Core::MimeData const& mime_data)
|
||||
void WindowManager::start_dnd_drag(ConnectionFromClient& client, String const& text, Gfx::Bitmap const* bitmap, Core::MimeData const& mime_data)
|
||||
{
|
||||
VERIFY(!m_dnd_client);
|
||||
m_dnd_client = client;
|
||||
|
@ -2084,7 +2084,7 @@ void WindowManager::invalidate_after_theme_or_font_change()
|
|||
});
|
||||
return IterationDecision::Continue;
|
||||
});
|
||||
ClientConnection::for_each_client([&](ClientConnection& client) {
|
||||
ConnectionFromClient::for_each_client([&](ConnectionFromClient& client) {
|
||||
client.async_update_system_theme(Gfx::current_system_theme_buffer());
|
||||
});
|
||||
MenuManager::the().did_change_theme();
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
#include <WindowServer/KeymapSwitcher.h>
|
||||
#include <WindowServer/MenuManager.h>
|
||||
#include <WindowServer/ScreenLayout.h>
|
||||
#include <WindowServer/WMClientConnection.h>
|
||||
#include <WindowServer/WMConnectionFromClient.h>
|
||||
#include <WindowServer/WindowSwitcher.h>
|
||||
#include <WindowServer/WindowType.h>
|
||||
|
||||
|
@ -34,7 +34,7 @@ const int double_click_speed_min = 100;
|
|||
class Screen;
|
||||
class MouseEvent;
|
||||
class Window;
|
||||
class ClientConnection;
|
||||
class ConnectionFromClient;
|
||||
class WindowSwitcher;
|
||||
class Button;
|
||||
class DndOverlay;
|
||||
|
@ -90,10 +90,10 @@ public:
|
|||
|
||||
Gfx::IntRect tiled_window_rect(Window const&, WindowTileType tile_type = WindowTileType::Maximized, bool relative_to_window_screen = false) const;
|
||||
|
||||
ClientConnection const* dnd_client() const { return m_dnd_client.ptr(); }
|
||||
ConnectionFromClient const* dnd_client() const { return m_dnd_client.ptr(); }
|
||||
Core::MimeData const& dnd_mime_data() const { return *m_dnd_mime_data; }
|
||||
|
||||
void start_dnd_drag(ClientConnection&, String const& text, Gfx::Bitmap const*, Core::MimeData const&);
|
||||
void start_dnd_drag(ConnectionFromClient&, String const& text, Gfx::Bitmap const*, Core::MimeData const&);
|
||||
void end_dnd_drag();
|
||||
|
||||
Window* active_window()
|
||||
|
@ -118,7 +118,7 @@ public:
|
|||
return m_current_window_stack->active_input_window();
|
||||
}
|
||||
|
||||
ClientConnection const* active_client() const;
|
||||
ConnectionFromClient const* active_client() const;
|
||||
|
||||
Window* window_with_active_menu() { return m_window_with_active_menu; }
|
||||
Window const* window_with_active_menu() const { return m_window_with_active_menu; }
|
||||
|
@ -179,7 +179,7 @@ public:
|
|||
void clear_resize_candidate();
|
||||
ResizeDirection resize_direction_of_window(Window const&);
|
||||
|
||||
void greet_window_manager(WMClientConnection&);
|
||||
void greet_window_manager(WMConnectionFromClient&);
|
||||
void tell_wms_window_state_changed(Window&);
|
||||
void tell_wms_window_icon_changed(Window&);
|
||||
void tell_wms_window_rect_changed(Window&);
|
||||
|
@ -345,10 +345,10 @@ private:
|
|||
void for_each_window_manager(Callback);
|
||||
|
||||
virtual void event(Core::Event&) override;
|
||||
void tell_wm_about_window(WMClientConnection& conn, Window&);
|
||||
void tell_wm_about_window_icon(WMClientConnection& conn, Window&);
|
||||
void tell_wm_about_window_rect(WMClientConnection& conn, Window&);
|
||||
void tell_wm_about_current_window_stack(WMClientConnection&);
|
||||
void tell_wm_about_window(WMConnectionFromClient& conn, Window&);
|
||||
void tell_wm_about_window_icon(WMConnectionFromClient& conn, Window&);
|
||||
void tell_wm_about_window_rect(WMConnectionFromClient& conn, Window&);
|
||||
void tell_wm_about_current_window_stack(WMConnectionFromClient&);
|
||||
bool pick_new_active_window(Window*);
|
||||
|
||||
void do_move_to_front(Window&, bool, bool);
|
||||
|
@ -449,7 +449,7 @@ private:
|
|||
RefPtr<Core::ConfigFile> m_config;
|
||||
|
||||
OwnPtr<DndOverlay> m_dnd_overlay;
|
||||
WeakPtr<ClientConnection> m_dnd_client;
|
||||
WeakPtr<ConnectionFromClient> m_dnd_client;
|
||||
String m_dnd_text;
|
||||
|
||||
RefPtr<Core::MimeData> m_dnd_mime_data;
|
||||
|
@ -535,7 +535,7 @@ inline IterationDecision WindowManager::for_each_visible_window_from_front_to_ba
|
|||
template<typename Callback>
|
||||
void WindowManager::for_each_window_manager(Callback callback)
|
||||
{
|
||||
auto& connections = WMClientConnection::s_connections;
|
||||
auto& connections = WMConnectionFromClient::s_connections;
|
||||
|
||||
// FIXME: this isn't really ordered... does it need to be?
|
||||
for (auto it = connections.begin(); it != connections.end(); ++it) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue