Skip to content

Commit 004aad0

Browse files
committed
WindowServer: Set the WSMessageLoop::server_process() as early as possible.
1 parent a3799cb commit 004aad0

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

WindowServer/WSMessageLoop.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ WSMessageLoop& WSMessageLoop::the()
3131

3232
int WSMessageLoop::exec()
3333
{
34-
m_server_process = current;
34+
ASSERT(m_server_process == current);
3535

3636
m_keyboard_fd = m_server_process->sys$open("/dev/keyboard", O_RDONLY);
3737
m_mouse_fd = m_server_process->sys$open("/dev/psaux", O_RDONLY);

WindowServer/WSMessageLoop.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ class WSMessageLoop {
2222
bool running() const { return m_running; }
2323
Process& server_process() { return *m_server_process; }
2424

25+
void set_server_process(Process& process) { m_server_process = &process; }
26+
2527
private:
2628
void wait_for_message();
2729
void drain_mouse();

WindowServer/main.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
void WindowServer_main()
1212
{
13+
WSMessageLoop::the().set_server_process(*current);
1314
current->set_priority(Process::HighPriority);
1415
auto info = current->set_video_resolution(1024, 768);
1516

0 commit comments

Comments
 (0)