WindowServer: Prune more kernel-related gunk.
This commit is contained in:
parent
09aaa41e62
commit
c3d36a5fe9
Notes:
sideshowbarker
2024-07-19 15:41:57 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/c3d36a5fe99
4 changed files with 9 additions and 18 deletions
|
@ -6,7 +6,6 @@
|
||||||
#include <WindowServer/WSWindow.h>
|
#include <WindowServer/WSWindow.h>
|
||||||
#include <WindowServer/WSWindowManager.h>
|
#include <WindowServer/WSWindowManager.h>
|
||||||
#include <WindowServer/WSAPITypes.h>
|
#include <WindowServer/WSAPITypes.h>
|
||||||
#include <Kernel/MemoryManager.h>
|
|
||||||
#include <Kernel/Process.h>
|
#include <Kernel/Process.h>
|
||||||
|
|
||||||
Lockable<HashMap<int, WSClientConnection*>>* s_connections;
|
Lockable<HashMap<int, WSClientConnection*>>* s_connections;
|
||||||
|
@ -42,17 +41,9 @@ WSClientConnection* WSClientConnection::ensure_for_client_id(int client_id)
|
||||||
WSClientConnection::WSClientConnection(int fd)
|
WSClientConnection::WSClientConnection(int fd)
|
||||||
: m_fd(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);
|
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)
|
if (!s_connections)
|
||||||
s_connections = new Lockable<HashMap<int, WSClientConnection*>>;
|
s_connections = new Lockable<HashMap<int, WSClientConnection*>>;
|
||||||
LOCKER(s_connections->lock());
|
LOCKER(s_connections->lock());
|
||||||
|
|
|
@ -13,9 +13,6 @@ class WSMenu;
|
||||||
class WSMenuBar;
|
class WSMenuBar;
|
||||||
struct WSAPI_ServerMessage;
|
struct WSAPI_ServerMessage;
|
||||||
|
|
||||||
// FIXME: Remove.
|
|
||||||
class Process;
|
|
||||||
|
|
||||||
class WSClientConnection final : public WSMessageReceiver {
|
class WSClientConnection final : public WSMessageReceiver {
|
||||||
public:
|
public:
|
||||||
explicit WSClientConnection(int fd);
|
explicit WSClientConnection(int fd);
|
||||||
|
@ -72,7 +69,4 @@ private:
|
||||||
int m_next_menubar_id { 10000 };
|
int m_next_menubar_id { 10000 };
|
||||||
int m_next_menu_id { 20000 };
|
int m_next_menu_id { 20000 };
|
||||||
int m_next_window_id { 1982 };
|
int m_next_window_id { 1982 };
|
||||||
|
|
||||||
// FIXME: Remove.
|
|
||||||
WeakPtr<Process> m_process;
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
#include "WSMessage.h"
|
#include "WSMessage.h"
|
||||||
#include "WSWindowManager.h"
|
#include "WSWindowManager.h"
|
||||||
#include <AK/Assertions.h>
|
#include <AK/Assertions.h>
|
||||||
#include <Kernel/IO.h>
|
|
||||||
|
|
||||||
static WSScreen* s_the;
|
static WSScreen* s_the;
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
#include "WSMessageLoop.h"
|
#include "WSMessageLoop.h"
|
||||||
#include "Process.h"
|
#include "Process.h"
|
||||||
#include "MemoryManager.h"
|
#include "MemoryManager.h"
|
||||||
#include <Kernel/ProcFS.h>
|
|
||||||
#include <SharedGraphics/Font.h>
|
#include <SharedGraphics/Font.h>
|
||||||
#include <SharedGraphics/Painter.h>
|
#include <SharedGraphics/Painter.h>
|
||||||
#include <SharedGraphics/CharacterBitmap.h>
|
#include <SharedGraphics/CharacterBitmap.h>
|
||||||
|
@ -14,7 +13,11 @@
|
||||||
#include "WSMenuBar.h"
|
#include "WSMenuBar.h"
|
||||||
#include "WSMenuItem.h"
|
#include "WSMenuItem.h"
|
||||||
#include <WindowServer/WSClientConnection.h>
|
#include <WindowServer/WSClientConnection.h>
|
||||||
|
|
||||||
|
#ifdef KERNEL
|
||||||
|
#include <Kernel/ProcFS.h>
|
||||||
#include <Kernel/RTC.h>
|
#include <Kernel/RTC.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
//#define DEBUG_COUNTERS
|
//#define DEBUG_COUNTERS
|
||||||
//#define DEBUG_WID_IN_TITLE_BAR
|
//#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());
|
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_bool("wm_flash_flush", m_flash_flush);
|
||||||
ProcFS::the().add_sys_string("wm_wallpaper", m_wallpaper_path, [this] {
|
ProcFS::the().add_sys_string("wm_wallpaper", m_wallpaper_path, [this] {
|
||||||
LOCKER(m_wallpaper_path.lock());
|
LOCKER(m_wallpaper_path.lock());
|
||||||
m_wallpaper = GraphicsBitmap::load_from_file(m_wallpaper_path.resource(), m_screen_rect.size());
|
m_wallpaper = GraphicsBitmap::load_from_file(m_wallpaper_path.resource(), m_screen_rect.size());
|
||||||
invalidate(m_screen_rect);
|
invalidate(m_screen_rect);
|
||||||
});
|
});
|
||||||
|
#endif
|
||||||
|
|
||||||
m_menu_selection_color = Color(0x84351a);
|
m_menu_selection_color = Color(0x84351a);
|
||||||
|
|
||||||
|
@ -695,11 +700,13 @@ void WSWindowManager::draw_menubar()
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
#ifdef KERNEL
|
||||||
unsigned year, month, day, hour, minute, second;
|
unsigned year, month, day, hour, minute, second;
|
||||||
RTC::read_registers(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_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);
|
auto time_rect = menubar_rect().translated(-(menubar_menu_margin() / 2), 0);
|
||||||
m_back_painter->draw_text(time_rect, time_text, TextAlignment::CenterRight, Color::Black);
|
m_back_painter->draw_text(time_rect, time_text, TextAlignment::CenterRight, Color::Black);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void WSWindowManager::draw_cursor()
|
void WSWindowManager::draw_cursor()
|
||||||
|
|
Loading…
Add table
Reference in a new issue