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:
parent
cff3685a4c
commit
6614746ca8
3 changed files with 39 additions and 11 deletions
|
@ -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&)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue