WindowServer: Make clients nonblock
Also dont allow freezed windows to "steal" focus and lock up the window server :D
This commit is contained in:
parent
f166cb09ec
commit
9803209ba1
|
|
@ -789,10 +789,7 @@ void WindowServer::set_focused_window(BAN::RefPtr<Window> window)
|
|||
LibGUI::EventPacket::WindowFocusEvent packet;
|
||||
packet.event.focused = false;
|
||||
if (auto ret = packet.send_serialized(m_focused_window->client_fd()); ret.is_error())
|
||||
{
|
||||
dwarnln("could not send window focus event: {}", ret.error());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
for (size_t i = m_client_windows.size(); i > 0; i--)
|
||||
|
|
@ -812,10 +809,7 @@ void WindowServer::set_focused_window(BAN::RefPtr<Window> window)
|
|||
LibGUI::EventPacket::WindowFocusEvent packet;
|
||||
packet.event.focused = true;
|
||||
if (auto ret = packet.send_serialized(m_focused_window->client_fd()); ret.is_error())
|
||||
{
|
||||
dwarnln("could not send window focus event: {}", ret.error());
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -254,7 +254,7 @@ int main()
|
|||
|
||||
if (FD_ISSET(server_fd, &fds))
|
||||
{
|
||||
int window_fd = accept4(server_fd, nullptr, nullptr, SOCK_CLOEXEC);
|
||||
int window_fd = accept4(server_fd, nullptr, nullptr, SOCK_NONBLOCK | SOCK_CLOEXEC);
|
||||
if (window_fd == -1)
|
||||
{
|
||||
dwarnln("accept: {}", strerror(errno));
|
||||
|
|
|
|||
Loading…
Reference in New Issue