mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-03-09 06:58:44 +00:00
WindowServer: Give a thread boost to the currently active window
When the currently active (foreground) window is owned by a client, we now apply a +10 priority boost to the client's main thread. You normally want the window you're interacting with to be responsive, so this little boost allows it to run a bit sooner and more often. :^)
This commit is contained in:
@@ -15,10 +15,8 @@
|
||||
#include <WindowServer/WSWindowSwitcher.h>
|
||||
#include <WindowServer/WindowClientEndpoint.h>
|
||||
#include <errno.h>
|
||||
#include <serenity.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/uio.h>
|
||||
#include <unistd.h>
|
||||
|
||||
HashMap<int, NonnullRefPtr<WSClientConnection>>* s_connections;
|
||||
@@ -654,3 +652,15 @@ OwnPtr<WindowServer::StartDragResponse> WSClientConnection::handle(const WindowS
|
||||
wm.start_dnd_drag(*this, message.text(), bitmap, message.data_type(), message.data());
|
||||
return make<WindowServer::StartDragResponse>(true);
|
||||
}
|
||||
|
||||
void WSClientConnection::boost()
|
||||
{
|
||||
if (set_thread_boost(client_pid(), 10) < 0)
|
||||
perror("boost: set_thread_boost");
|
||||
}
|
||||
|
||||
void WSClientConnection::deboost()
|
||||
{
|
||||
if (set_thread_boost(client_pid(), 0) < 0)
|
||||
perror("deboost: set_thread_boost");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user