From c3d36a5fe997f5bbd1ccdd61587653ff0bc5b20e Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 16 Feb 2019 12:25:47 +0100 Subject: [PATCH] WindowServer: Prune more kernel-related gunk. --- WindowServer/WSClientConnection.cpp | 11 +---------- WindowServer/WSClientConnection.h | 6 ------ WindowServer/WSScreen.cpp | 1 - WindowServer/WSWindowManager.cpp | 9 ++++++++- 4 files changed, 9 insertions(+), 18 deletions(-) diff --git a/WindowServer/WSClientConnection.cpp b/WindowServer/WSClientConnection.cpp index aadb48b7ebb..d0499945338 100644 --- a/WindowServer/WSClientConnection.cpp +++ b/WindowServer/WSClientConnection.cpp @@ -6,7 +6,6 @@ #include #include #include -#include #include Lockable>* s_connections; @@ -42,17 +41,9 @@ WSClientConnection* WSClientConnection::ensure_for_client_id(int client_id) WSClientConnection::WSClientConnection(int fd) : m_fd(fd) { - int rc = WSMessageLoop::the().server_process().sys$ioctl(m_fd, 413, (int)&m_pid); + int rc = current->sys$ioctl(m_fd, 413, (int)&m_pid); ASSERT(rc == 0); - { - InterruptDisabler disabler; - auto* process = Process::from_pid(m_pid); - ASSERT(process); - m_process = process->make_weak_ptr(); - m_client_id = (int)process; - } - if (!s_connections) s_connections = new Lockable>; LOCKER(s_connections->lock()); diff --git a/WindowServer/WSClientConnection.h b/WindowServer/WSClientConnection.h index c835014d305..e92921150a5 100644 --- a/WindowServer/WSClientConnection.h +++ b/WindowServer/WSClientConnection.h @@ -13,9 +13,6 @@ class WSMenu; class WSMenuBar; struct WSAPI_ServerMessage; -// FIXME: Remove. -class Process; - class WSClientConnection final : public WSMessageReceiver { public: explicit WSClientConnection(int fd); @@ -72,7 +69,4 @@ private: int m_next_menubar_id { 10000 }; int m_next_menu_id { 20000 }; int m_next_window_id { 1982 }; - - // FIXME: Remove. - WeakPtr m_process; }; diff --git a/WindowServer/WSScreen.cpp b/WindowServer/WSScreen.cpp index 940f6d61fe2..743bfbba8b3 100644 --- a/WindowServer/WSScreen.cpp +++ b/WindowServer/WSScreen.cpp @@ -3,7 +3,6 @@ #include "WSMessage.h" #include "WSWindowManager.h" #include -#include static WSScreen* s_the; diff --git a/WindowServer/WSWindowManager.cpp b/WindowServer/WSWindowManager.cpp index 6d5b19bbedd..cf300bb0da4 100644 --- a/WindowServer/WSWindowManager.cpp +++ b/WindowServer/WSWindowManager.cpp @@ -4,7 +4,6 @@ #include "WSMessageLoop.h" #include "Process.h" #include "MemoryManager.h" -#include #include #include #include @@ -14,7 +13,11 @@ #include "WSMenuBar.h" #include "WSMenuItem.h" #include + +#ifdef KERNEL +#include #include +#endif //#define DEBUG_COUNTERS //#define DEBUG_WID_IN_TITLE_BAR @@ -175,12 +178,14 @@ WSWindowManager::WSWindowManager() m_wallpaper = GraphicsBitmap::load_from_file(m_wallpaper_path.resource(), m_screen_rect.size()); } +#ifdef KERNEL ProcFS::the().add_sys_bool("wm_flash_flush", m_flash_flush); ProcFS::the().add_sys_string("wm_wallpaper", m_wallpaper_path, [this] { LOCKER(m_wallpaper_path.lock()); m_wallpaper = GraphicsBitmap::load_from_file(m_wallpaper_path.resource(), m_screen_rect.size()); invalidate(m_screen_rect); }); +#endif m_menu_selection_color = Color(0x84351a); @@ -695,11 +700,13 @@ void WSWindowManager::draw_menubar() return true; }); +#ifdef KERNEL unsigned year, month, day, hour, minute, second; RTC::read_registers(year, month, day, hour, minute, second); auto time_text = String::format("%04u-%02u-%02u %02u:%02u:%02u", year, month, day, hour, minute, second); auto time_rect = menubar_rect().translated(-(menubar_menu_margin() / 2), 0); m_back_painter->draw_text(time_rect, time_text, TextAlignment::CenterRight, Color::Black); +#endif } void WSWindowManager::draw_cursor()