mirror of
https://github.com/RGBCube/serenity
synced 2025-06-15 08:02:09 +00:00
WindowServer: Remove "unsafe" flag in WSMessageLoop::post_event().
This hack is no longer needed now that we have a Finalizer process that can take locks without having to worry about the interrupt flag.
This commit is contained in:
parent
f7b25773ab
commit
26230c0647
3 changed files with 4 additions and 13 deletions
|
@ -77,7 +77,7 @@ int Process::gui$destroy_window(int window_id)
|
||||||
if (it == m_windows.end())
|
if (it == m_windows.end())
|
||||||
return -EBADWINDOW;
|
return -EBADWINDOW;
|
||||||
auto message = make<WSMessage>(WSMessage::WM_DestroyWindow);
|
auto message = make<WSMessage>(WSMessage::WM_DestroyWindow);
|
||||||
WSMessageLoop::the().post_message((*it).value.leak_ptr(), move(message), true);
|
WSMessageLoop::the().post_message((*it).value.leak_ptr(), move(message));
|
||||||
m_windows.remove(window_id);
|
m_windows.remove(window_id);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -258,12 +258,10 @@ int Process::gui$set_global_cursor_tracking_enabled(int window_id, bool enabled)
|
||||||
|
|
||||||
void Process::destroy_all_windows()
|
void Process::destroy_all_windows()
|
||||||
{
|
{
|
||||||
InterruptFlagSaver saver;
|
|
||||||
sti();
|
|
||||||
for (auto& it : m_windows) {
|
for (auto& it : m_windows) {
|
||||||
auto message = make<WSMessage>(WSMessage::WM_DestroyWindow);
|
auto message = make<WSMessage>(WSMessage::WM_DestroyWindow);
|
||||||
it.value->notify_process_died(Badge<Process>());
|
it.value->notify_process_died(Badge<Process>());
|
||||||
WSMessageLoop::the().post_message(it.value.leak_ptr(), move(message), true);
|
WSMessageLoop::the().post_message(it.value.leak_ptr(), move(message));
|
||||||
}
|
}
|
||||||
m_windows.clear();
|
m_windows.clear();
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,15 +67,8 @@ int WSMessageLoop::exec()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void WSMessageLoop::post_message(WSMessageReceiver* receiver, OwnPtr<WSMessage>&& message, bool unsafe)
|
void WSMessageLoop::post_message(WSMessageReceiver* receiver, OwnPtr<WSMessage>&& message)
|
||||||
{
|
{
|
||||||
if (unsafe) {
|
|
||||||
// FIXME: This is such a hack. It should not exist.
|
|
||||||
m_queued_messages.append({ receiver, move(message) });
|
|
||||||
if (current != m_server_process)
|
|
||||||
m_server_process->request_wakeup();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
LOCKER(m_lock);
|
LOCKER(m_lock);
|
||||||
#ifdef WSEVENTLOOP_DEBUG
|
#ifdef WSEVENTLOOP_DEBUG
|
||||||
dbgprintf("WSMessageLoop::post_message: {%u} << receiver=%p, message=%p\n", m_queued_messages.size(), receiver, message.ptr());
|
dbgprintf("WSMessageLoop::post_message: {%u} << receiver=%p, message=%p\n", m_queued_messages.size(), receiver, message.ptr());
|
||||||
|
|
|
@ -15,7 +15,7 @@ public:
|
||||||
|
|
||||||
int exec();
|
int exec();
|
||||||
|
|
||||||
void post_message(WSMessageReceiver* receiver, OwnPtr<WSMessage>&&, bool unsafe = false);
|
void post_message(WSMessageReceiver* receiver, OwnPtr<WSMessage>&&);
|
||||||
|
|
||||||
static WSMessageLoop& the();
|
static WSMessageLoop& the();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue