1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:08:11 +00:00

WindowServer: Spawn a secondary thread to decode wallpapers.

The threading API's are not very mature, so this code looks a bit crufty
but it does take the load off the WindowServer main thread when changing
wallpapers. :^)
This commit is contained in:
Andreas Kling 2019-05-01 16:07:47 +02:00
parent cff3685a4c
commit 6614746ca8
3 changed files with 39 additions and 11 deletions

View file

@ -332,11 +332,12 @@ void WSClientConnection::handle_request(const WSAPISetWindowOpacityRequest& requ
void WSClientConnection::handle_request(const WSAPISetWallpaperRequest& request)
{
bool success = WSWindowManager::the().set_wallpaper(request.wallpaper());
WSAPI_ServerMessage response;
response.type = WSAPI_ServerMessage::Type::DidSetWallpaper;
response.value = success;
post_message(response);
WSWindowManager::the().set_wallpaper(request.wallpaper(), [&] (bool success) {
WSAPI_ServerMessage response;
response.type = WSAPI_ServerMessage::Type::DidSetWallpaper;
response.value = success;
post_message(response);
});
}
void WSClientConnection::handle_request(const WSAPIGetWallpaperRequest&)